CinePaint Mac OS X README
11/11/07 Robin.Rowe@MovieEditor.com

Building Mac OS X CinePaint is not easy. These notes are based on info from Andy Prock. He did most of the Mac CinePaint port work.

(** GTK1 X11 Mac OS X CinePaint Build ***

1) download and install the following libraries:

   dlcompat-20021117
   gettext-0.10.40
   libiconv-1.8
   glib-1.2.10
   gtk-1.2.10
   jpeg-6b
   libpng-1.2.5
   tiff-3.5.7
   openEXR

2) Change the following tokens in the configure script
   -flat_namespace -> -twolevel_namespace
   -undefined suppress -> -undefined error
   /sw/... -> (where the libraries are installed e.g. /opt/local/... if installed via binary installer.)

GTK1 Build Notes:

Typically the "multiple definitions of symbol", error on Mac OS X, can be handled by using  -flat_namespace -undefined suppress.  So try changing back to that from -twolevel_namespace -undefined error.

Try typing in the terminal:
$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/local/lib/pkgconfig
and then reconfigure with 
$ configure

You can set the configure option --prefix=/opt/local to check this 
direction of paths.

You can switch between the Gtk's by putting the according gtk-config 
script in your executeable path. export PATH=/path/to/gtk:$PATH  can help 
with this. Note the gtk path is in front to launch the intended script.
Or rename one of the gtk-config scripts. In case CinePaint shall use the 
alternative Gtk1 version, it needs to be reconfigured and to run 
$ make clean   and then 'make' again.

Alternatively you could configure CinePaint with the --disable-print 
option. configure --help shows which options are available.

db2html not found should only occure in the pygimp plug-in path. As it is by default 
disabled in 0.22-x CinePaint I think you'd have to edit Makefiles in the 
CP version you compile.
Anyway eighter edit the plug-ins/Makefile and search and remove there the 
pygimp entry for the SUBDIRS variable or put a minus in front of the 
pygimp.html target lines in plug-ins/pygimp/doc/Makefile:
pygimp.html: pygimp.sgml
	-cd $(srcdir) && (db2html pygimp.sgml || docbook2html pygimp.sgml)
	-cd $(srcdir) && mv pygimp/*.html .
	-rm -rf $(srcdir)/pygimp

"-lintl" is a hack. It is added 2 times in the configure script 
next to "-framework ApplicationServices". Remove "-lintl" there and run 
everything again, including configure. Open confgure.in in your editor,
remove the -lintl occurences, save, run autoconf and run configure with the previous options (they stand in top of config.log)

I don't have a /sw/lib directory. But when I search the root I find a
bunch of libintl files in /opt/local/lib

/opt/local/lib/libintl.3.4.3.dylib
/opt/local/lib/libintl.3.dylib
/opt/local/lib/libintl.8.0.1.dylib
/opt/local/lib/libintl.8.dylib
/opt/local/lib/libintl.a
/opt/local/lib/libintl.dylib
/opt/local/lib/libintl.la

Use:
$ export CFLAGS=-I/opt/local/include
$ export CXXFLAGS=-I/opt/local/include
$ export LDFLAGS=-L/opt/local/lib

*** GTK2 X11 Mac OS X CinePaint Build ***

In theory this can be done, based on work by Kai-Uwe Behrmann on the Linux version of CinePaint. Untried on Mac.

The configure option is --enable-gtk2 .

The Linux release candidate 4 is up and available on the sf downloadpage.
It includes bugfixes and OpenEXR with multi layer support.
RnH 16-bit float is replaced by OpenEXR half float.

*** Native Aqua GTK+OSX Mac OS X CinePaint Build ***

This port of GTK to native Aqua OS X is close to complete, but not finished. Do not expect to be able to use this version of CinePaint for real work without further development on GTK+OSX. This is the most desirable port of CinePaint for the Mac because it doesn't have X11 baggage or quirkiness when mouse-clicking. It's also much smaller when built.

Requirements:
XCode 1.5 is required to build the xcode project
"cinepaint-0.18-3/CinePaintAqua/CinePaintAqua.xcode".  There are build
variables that rely on changes made in XCode 1.5.

Differences:
There are a few places where #defines were used to rename variables or
types, when there were collisions with names from the Carbon namespace.
These defines should all be following the convention. #define Foo
CInePaintFoo.  They are not guarded by ifdef's.
	e.g. text_tool.c : line 106
		#define FontInfo CinePaintFontInfo

Build Instructions (using CinePaintAqua.xcode)
1) Install the req'd graphics libs via either fink or darwinpors (I
suggest darwinports, this is what the project has been tested against)
	a) If you use fink, be sure to change the EXR_PATH var to where
it installs OpenEXR, in the configure target of the xcode project.
2) build the CinePaint target
	a) it creates the CinePaint.app skeleton
3) build the configure target
4) manually alter the libtool generated by configure (add the Gtk-OSX
linker commands:
	libtool : line 185
	archive_cmds="\$CC -r -keep_private_externs -nostdlib -o
\${lib}-master.o \$libobjs && \$CC \$(test .\$module = .yes && echo
-bundle || echo -dynamiclib) \$allow_undefined_flag -o \$lib
\${lib}-master.o \$deplibs\$linker_flags \$(test .\$module != .yes && echo
-install_name \$rpath/\$soname \$verstring)"
	becomes::
	archive_cmds="\$CC -r -keep_private_externs -nostdlib
-F/Library/Frameworks -framework GLIB -framework GDK -framework GTK -o
\${lib}-master.o \$libobjs && \$CC \$(test .\$module = .yes && echo
-bundle || echo -dynamiclib) \$allow_undefined_flag -F/Library/Frameworks
-framework GLIB -framework GDK -framework GTK -o \$lib \${lib}-master.o
\$deplibs\$linker_flags \$(test .\$module != .yes && echo -install_name
\$rpath/\$soname \$verstring)"
5) build the cinepaint target
6) build the install target
7) Open the Terminal and cd to the CinePaintAqua directory
	a) run the following command
		i) perl AddRez.pl
./build/CinePaint.app/Contents/Resources/cinepaint/0.18-3/plugins
	b) this adds a dummy resource fork to all the plugins, which is
supposed to make their UI usable, however it isn't working. (probably due
to the current plug-in loading architecture)

Notes:

You can't statically link to the frameworks.  They're dynamic libraries.

For distribution you can use the PackageMaker tool.  It gets installed in /Developer/Applications/Utilities, when you install the XCode Developer Tools.  There are several tutorials available on the web on using PackageMaker.

Ultimately, it will generate an installer that mac users are familiar with.

The canonical directory for frameworks in OS X is /Library/Frameworks (when installing for multiple users), and ~/Library/Frameworks (when installing for a single user).

###
