– Edsger W. Dijkstra (1975)
How do we tell truths that might hurt? src
“It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.â€
PDFKit patch for Freetype related errors (SplashFTFont.cc)
For whoever needs to compile the unsupported PDFKit framework (probably i conjunction with GWorkspace) and incurs in the following errors:
SplashFTFont.cc:17:10: error: #include expects "FILENAME" or <FILENAME>
SplashFTFont.cc: In constructor ‘SplashFTFont::SplashFTFont(SplashFTFontFile*, SplashCoord*)’:
SplashFTFont.cc:46: error: ‘FT_New_Size’ was not declared in this scope
SplashFTFont.cc: In member function ‘virtual SplashPath* SplashFTFont::getGlyphPath(int)’:
SplashFTFont.cc:219: error: invalid conversion from ‘int (*)(FT_Vector*, void*)’ to ‘int (*)(const FT_Vector*, void*)’
SplashFTFont.cc:219: error: invalid conversion from ‘int (*)(FT_Vector*, void*)’ to ‘int (*)(const FT_Vector*, void*)’
SplashFTFont.cc:219: error: invalid conversion from ‘int (*)(FT_Vector*, FT_Vector*, void*)’ to ‘int (*)(const FT_Vector*, const FT_Vector*, void*)’
SplashFTFont.cc:219: error: invalid conversion from ‘int (*)(FT_Vector*, FT_Vector*, FT_Vector*, void*)’ to ‘int (*)(const FT_Vector*, const FT_Vector*, const FT_Vector*, void*)’
SplashFTFont.cc:224: error: ‘FT_Glyph’ was not declared in this scope
SplashFTFont.cc:224: error: expected `;' before ‘glyph’
SplashFTFont.cc:238: error: ‘glyph’ was not declared in this scope
SplashFTFont.cc:238: error: ‘FT_Get_Glyph’ was not declared in this scope
SplashFTFont.cc:243: error: ‘FT_OutlineGlyph’ was not declared in this scope
SplashFTFont.cc:243: error: expected `)' before ‘glyph’
SplashFTFont.cc:248: error: ‘glyph’ was not declared in this scope
SplashFTFont.cc:248: error: ‘FT_Done_Glyph’ was not declared in this scope
here’s a patch to fix those errors. (I had them on Debian 2.6.18-4-686.)
Building GIMP on Mac OS X
Just a few notes about this, because the instructions available at wiki.gimp.org/gimp/HowToCompileGimp/MacOSX are really great. The only things I might add are:
- If you’re thinking about usign Fink instead of MacPorts, don’t. I tried that way and it was hell. Reasons: MacPorts had more of the packages I needed, and more updated.
- MacPorts is indeed your friend and I used it to install almost all the packages mentioned in the previous how-to: git-core, freetype, fontconfig, libart_lgpl, XML::Parser (p5-xml-parser on MacPorts, but I actually think the GTK build already installs it), LCMS, py-cairo, pyGOObject and PyGTK; in any case, just run (e.g.) port search cairo to find what you’re looking for.
- build BABL and GEGL: be sure to get GEGL v0.0.16+ or refer to this page. You still need to manually copy gegl.pc to the installation path:
sudo cp ~/Desktop/gegl-0.0.16/gegl.pc /usr/local/lib/pkgconfig/
- finally run:
$ ./autogen.sh --without-mng --without-alsa --disable-alsatest --without-x --with-libtiff --enable-gtk-doc LDFLAGS="-L/opt/gtk/lib -L/opt/local/lib" CPPFLAGS="-I/opt/gtk/include -I/opt/local/include" --prefix=/opt/gimp
ignore the warnings about the m4 files (See http://www.gimp.org/source/howtos/stable-cvs-build.html ).
Note about libtiff: either one of “--with-libtiff” or “--without-libtiff” options is needed, otherwise ./configure will complain.
Note: if you don’t care about the docs, add a --disable-gtk-doc option to avoid building the GTK docs.
$ make
Done.
Upcoming GEGL release for OS X
Update on GEGL for Mac OS X: upcoming release 0.0.16 will build on Mac OS X. Those guys were indeed fast in fixing the reported build problems. Thanks!
Update: GEGL 0.0.16 was released!
Building GEGL and BABL on Mac OS X
Since GEGL depends on BABL, we’ll build BABL first. Note: this was done on PPC 10.4.11.
There are 2 ways to build BABL, either from the tarballs or from svn. The svn “bleeding edge” way has no problems at the time of this writing:
$ svn co http://svn.gnome.org/svn/babl/trunk/ babl-trunk
$ cd babl-trunk
$ ./autogen.sh
$ make
$ sudo make install
However, if you build from the current source releases at ftp://ftp.gtk.org/pub/babl/ on OS X, you might incur into the error: “unrecognized option '-shared'“. (gcc that comes with OS X doesn’t support the -shared option.) E.g. I verified this problem on the 0.0.18 tarball. To fix this, you can just edit the ./extensions/Makefile:
#LDFLAGS = -shared
LDFLAGS = -dynamiclib # OSX setting
#SHREXT = .so
SHREXT = .dylib # OSX setting
then run make again.
Once BABL is installed, let’s do GEGL. At the time of this writing, GEGL doesn’t officially build on OS X.
If you build GEGL from the tarballs, you might incur in similar “-shared” errors as for BABL. (E.g. the 0.0.14 tarball is affected by this problem). Building from svn initially gave me a few errors which were quickly fixed in a few hours, so it’s simply as:
$ svn co http://svn.gnome.org/svn/gegl/trunk/ gegl-trunk
$ cd gegl-trunk
$ ./autogen.sh
$ make
$ sudo make install
Only problem here is that the build failed on the sample compositions with errors like:
--[Updating sample compositions]--
./OpenRaster-00.xml
make[5]: *** No rule to make target `OpenRaster-00.png'. Stop.
(Similar errors for OpenRaster-01.xml, OpenRaster-04.xml, clones.xml.) I figured this was not essential and ran make install anyway. The library files seemed to get installed (/usr/local) so hopefully that’s enough. However, the gegl.pc file did NOT get installed, so I had to copy it manually. Assuming you installed GEGL in the default /usr/local tree:
$ cp gegl-trunk/gegl.pc /usr/local/lib/pkgconfig/
This build seemed good enough to build GIMP with it. So, there you have it. I guess the morale here is, sometimes svn is just better than a tarball.
Update: these bugs seem fixed now. Cool!
