Code

updated spanish.nsh and inkscape.nsi to reflect latest file-changes
[inkscape.git] / trunk / packaging / macosx / native-gtk / build-gtk.sh
1 #!/bin/sh
2 #
3 # Based on the Imendio 'build-gtk.sh' script.
4 #
5 # Inkscape build additions by Michael Wybrow <mjwybrow@users.sf.net>
6 #
7 # See the following page for build instructions:
8 # http://developer.imendio.com/projects/gtk-macosx/build-instructions
9 #
10 # Usage:
11 # export PREFIX=/your/install/prefix
12 # ./build-gtk bootstrap
13 # ./build-gtk build inkscape
14 #
16 # XXX: Check for xargs with -i
17 #
18 # In lib/pkgconfig/freetpe2.pc
19 #
20 # -  Libs: -L${libdir} -lfreetype -lz
21 # +  Libs: -L${libdir} -lfreetype -lz -Wl,-framework,CoreServices,-framework,ApplicationServices 
22 #
23 # bin/freetype-config
24 #
25 # -  libs="-lfreetype -lz"
26 # +  libs="-lfreetype -lz -Wl,-framework,CoreServices,-framework,ApplicationServices"
27 #
28 # In lib/pkgconfig/fontconfig.pc
29 #       Add -lexpat
30 #       
32 version=1.3.1-inkscape
35 SCRIPTDIR=`dirname $0`
37 export PREFIX=${PREFIX-/opt/gtk}
38 export PATH=$PREFIX/bin:/usr/bin:$PATH
39 #export PATH=$PREFIX/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:
40 export LIBTOOLIZE=$PREFIX/bin/libtoolize
42 # FIXME: We might need some more intelligent way to get the path here.
43 export PYTHONPATH=$PREFIX/lib/python2.3/site-packages
45 # Needed for glib etc to pick up gettext
46 export LDFLAGS=-L$PREFIX/lib
47 export CPPFLAGS=-I$PREFIX/include
49 export XDG_DATA_DIRS=$PREFIX/share
51 COMMON_OPTIONS="--prefix=$PREFIX --disable-static --enable-shared \
52 --disable-gtk-doc --disable-scrollkeeper"
54 #export MAKEFLAGS=-j2
56 if [ "x$PANTHER_BUILD" = "xYes" ]; then
57     # XXX: Check the machine is PPC
58     #      or rework to have things like pkg-config built natively.
60     # Overwrite some build settings.
61     export SDK="/Developer/SDKs/MacOSX10.3.9.sdk"
62     export MACOSX_DEPLOYMENT_TARGET=10.3
63     export CFLAGS="-isysroot ${SDK} -arch ppc"
64     export CXXFLAGS="-isysroot ${SDK} -arch ppc"
66     export STABLE_BUILD=Yes
67 fi
69 if [ "x$UNIVERSAL_BUILD" = "xYes" ]; then
70     COMMON_OPTIONS="$COMMON_OPTIONS --disable-dependency-tracking"
72     export SDK="/Developer/SDKs/MacOSX10.4u.sdk"
73     export MACOSX_DEPLOYMENT_TARGET=10.4
74     #export MACOSX_DEPLOYMENT_TARGET_i386=10.4
75     #export MACOSX_DEPLOYMENT_TARGET_ppc=10.3
76     export CFLAGS="-isysroot ${SDK} -arch ppc -arch i386"
77     export CXXFLAGS="-isysroot ${SDK} -arch ppc -arch i386"
79     CONFIGURE_pkg_config="--with-pc-path=$PREFIX/lib/pkgconfig:/usr/X11R6/lib/pkgconfig --enable-indirect-deps --disable-dependency-tracking"
81     CONFIGURE_libpng="--disable-dependency-tracking"
82     PRECONFIGURE_libpng="eval CPPFLAGS='$CPPFLAGS -DPNG_NO_ASSEMBLER_CODE'"
83     
84     CONFIGURE_tiff="--disable-dependency-tracking"
86     POSTCONFIGURE_jpeg_6b="patch_libtool_dylib"
87     
88     CONFIGURE_gc="--disable-dependency-tracking"
89     POSTCONFIGURE_gc="patch_libtool_dylib"
90     PRECONFIGURE_gc="eval CFLAGS='$CFLAGS -DUSE_GENERIC_PUSH_REGS'"
91     
92     POSTCONFIGURE_freetype="eval cd builds/unix/ && pwd && patch_libtool_dylib && cd ../.."
94     CONFIGURE_fontconfig="--disable-dependency-tracking --disable-docs"
95     POSTCONFIGURE_fontconfig="eval cd fc-arch && make all && cd .. && perl -pi~ -e 's|#define FC_ARCHITECTURE \"x86\"|#ifdef __ppc__\n#define FC_ARCHITECTURE \"ppc\"\n#else\n#define FC_ARCHITECTURE \"x86\"\n#endif|g' fc-arch/fcarch.h"
97     PRECONFIGURE_cairo="export ax_cv_c_float_words_bigendian=no"
98     CONFIGURE_cairo="--disable-dependency-tracking --enable-shared --disable-quartz --disable-atsui --enable-glitz"
99     POSTCONFIGURE_cairo="eval patch_libtool_dylib && export ax_cv_c_float_words_bigendian='' && perl -pi~ -e 's|/\* #undef FLOAT_WORDS_BIGENDIAN \*/|#ifdef __ppc__\n#define FLOAT_WORDS_BIGENDIAN 1\n#endif|g;s|/\* #undef WORDS_BIGENDIAN \*/|#ifdef __ppc__\n#define WORDS_BIGENDIAN 1\n#endif|g' config.h && perl -pi~ -e 's|DIST_SUBDIRS = pixman src boilerplate test perf doc|DIST_SUBDIRS = pixman src test perf doc|g;s|am__append_1 = boilerplate test|am__append_1 = test|g' Makefile"
100     
101     CONFIGURE_glitz="--disable-dependency-tracking"
103     CONFIGURE_lcms="--disable-dependency-tracking"
104     
105     CONFIGURE_glib="$COMMON_OPTIONS"
106     POSTCONFIGURE_glib="eval make glibconfig.h config.h && cp $DIRNAME/{glib,}config.h ."
107     #POSTCONFIGURE_glib="eval make glibconfig.h && perl -pi~ -e 's|#define G_BYTE_ORDER G_LITTLE_ENDIAN|#include <machine/endian.h>\n#define G_BYTE_ORDER __DARWIN_BYTE_ORDER|g' glibconfig.h"
108     
109     CONFIGURE_pango="$COMMON_OPTIONS"
110     POSTCONFIGURE_pango="eval perl -pi~ -e 's|SUBDIRS = pango modules examples docs tools tests|SUBDIRS = pango modules docs tools tests|g' Makefile && perl -pi~ -e 's|harfbuzz_dump_LDADD = |harfbuzz_dump_LDADD = -Xlinker -framework -Xlinker CoreServices -Xlinker -framework -Xlinker ApplicationServices|g' pango/opentype/Makefile"
111     
112     CONFIGURE_gtk="$COMMON_OPTIONS"
114     CONFIGURE_atk="$COMMON_OPTIONS"
115     
116     CONFIGURE_libxml2="$COMMON_OPTIONS"
117     
118     CONFIGURE_libsigc="$COMMON_OPTIONS"
119     POSTCONFIGURE_libsigc="patch_libtool_dylib"
120     
121     CONFIGURE_glibmm="$COMMON_OPTIONS"
122     
123     CONFIGURE_cairomm="$COMMON_OPTIONS"
124     
125     CONFIGURE_gtkmm="$COMMON_OPTIONS --disable-examples --disable-demos"
126     POSTCONFIGURE_gtkmm="patch_libtool_dylib"
127     
128     CONFIGURE_libxslt="$COMMON_OPTIONS"
129     
130     CONFIGURE_popt="$COMMON_OPTIONS"
131     POSTCONFIGURE_popt="patch_libtool_dylib"
132 elif [ "x$STABLE_BUILD" = "xYes" ]; then
133     COMMON_OPTIONS="$COMMON_OPTIONS --disable-dependency-tracking"
135     CONFIGURE_pkg_config="--with-pc-path=$PREFIX/lib/pkgconfig:/usr/X11R6/lib/pkgconfig --enable-indirect-deps --disable-dependency-tracking"
137     CONFIGURE_libpng="--disable-dependency-tracking"
138     
139     CONFIGURE_tiff="--disable-dependency-tracking"
141     CONFIGURE_gc="--disable-dependency-tracking"
142     
143     CONFIGURE_fontconfig="--disable-dependency-tracking --disable-docs"
145     CONFIGURE_cairo="--disable-dependency-tracking --enable-shared --disable-quartz --disable-atsui --enable-glitz"
146     
147     CONFIGURE_glitz="--disable-dependency-tracking"
149     CONFIGURE_lcms="--disable-dependency-tracking"
150     
151     CONFIGURE_glib="$COMMON_OPTIONS"
152     
153     CONFIGURE_pango="$COMMON_OPTIONS"
154     POSTCONFIGURE_pango="eval perl -pi~ -e 's|SUBDIRS = pango modules examples docs tools tests|SUBDIRS = pango modules docs tools tests|g' Makefile && perl -pi~ -e 's|harfbuzz_dump_LDADD = |harfbuzz_dump_LDADD = -Xlinker -framework -Xlinker CoreServices -Xlinker -framework -Xlinker ApplicationServices|g' pango/opentype/Makefile"
155     
156     CONFIGURE_gtk="$COMMON_OPTIONS"
158     CONFIGURE_atk="$COMMON_OPTIONS"
159     
160     CONFIGURE_libxml2="$COMMON_OPTIONS"
161     
162     CONFIGURE_libsigc="$COMMON_OPTIONS"
163     
164     CONFIGURE_glibmm="$COMMON_OPTIONS"
165     
166     CONFIGURE_cairomm="$COMMON_OPTIONS"
167     
168     CONFIGURE_gtkmm="$COMMON_OPTIONS --disable-examples --disable-demos"
169     
170     CONFIGURE_libxslt="$COMMON_OPTIONS"
171     
172     CONFIGURE_popt="$COMMON_OPTIONS"
173 fi
176 # Support install-check from jhbuild to speed up compilation
177 if [ -x $PREFIX/bin/install-check ]; then
178     export INSTALL=$PREFIX/bin/install-check
179 fi
182 SOURCE=${SOURCE-$HOME/Source/gtk}
183 CAIROCVSROOT=${CAIROCVSROOT-:pserver:anoncvs@cvs.freedesktop.org:/cvs/cairo}
184 INKSCAPESVNURL="https://svn.sourceforge.net/svnroot/inkscape"
185 GNOMESVNURL=${GNOMESVNURL-https://svn.gnome.org/svn}
187 if [ x$1 = xrun ]; then
188     cmd="$2"
189     shift 2
190     exec $cmd $*
191 fi
193 if [ $# -eq 0 -o "x`echo "$*" | grep shell`" = xshell ]; then
194     # Can be used in .bashrc to set a fancy prompt...
195     export INSIDE_GTK_BUILD=1
196     bash
197     exit 0
198 fi
200 CORE_MODULES="glitz cairo gnome-common glib pango atk gtk+"
201 EXTRA_MODULES="libxml2 libxslt loudmouth libglade gossip gtk-engines"
202 PYGTK_MODULES=" pycairo pygobject pygtk"
203 INKSCAPE_MODULES="$CORE_MODULES libxml2 libxslt gc lcms libsigc++ doxygen glibmm cairomm gtkmm popt inkscape"
205 # Could add those (orbit requires popt though)
206 MORE_MODULES="libIDL ORBit2 gconf"
208 function print_usage
210     echo
211     echo "GTK+ on Mac OS X build script version $version."
212     echo 
213     echo "Usage:"
214     echo "`basename $0` [bootstrap|[shell]|run <cmd>|build [<modules>]], modules are:"
215     echo " Core: $CORE_MODULES"
216     echo " Extra: $EXTRA_MODULES"
217     echo " Python: $PYGTK_MODULES"
218     echo " Inkscape: $INKSCAPE_MODULES"
219     echo
220     echo "Setup: This script defaults to downloading source to ~/Source/gtk and"
221     echo "installing in /opt/gtk. Make sure your user has write access to the"
222     echo "latter directory. You can override those directories by setting the"
223     echo "SOURCE and PREFIX environment variables. Anoncvs is used by default"
224     echo "for access to GNOME SVN, if you wish to override, set the environment"
225     echo "variable GNOMESVNURL to your own account."
226     echo
227     echo "While in the shell that this script provides, the environment variable"
228     echo "INSIDE_GTK_BUILD is set, which makes it possible to put something like"
229     echo "the following in ~/.bashrc:"
230     echo
231     echo " if [ x\$INSIDE_GTK_BUILD != x ]; then"
232     echo "     PS1=\"[GTK] \u@\h \W $ \""
233     echo " fi"
234     echo
235     echo "Start by bootstrapping. This will install the necessary build tools."
236     echo "Then build GTK+ & co by using the \"build\" command. If no modules are"
237     echo "specified, only the ones needed for GTK+ will be built. The special"
238     echo "modules \"core\" and \"all\" can be used to build just the core or all"
239     echo "modules."
240     echo
241     echo "If you want to build something manually or run something, use the "
242     echo "\"shell\" command (or no command) to get a shell with the environment"
243     echo "properly setup."
244     echo 
245     echo "Tip: if you build and install \"install-check\" from jhbuild into your"
246     echo "PREFIX, recompiling when hacking on GTK+ & co will be a lot faster."
247     echo
250 function download
252     BASENAME=`basename $1`
254     if [ -s $BASENAME ]; then
255         echo "Already downloaded"
256         return 0
257     fi
259     curl $1 > $BASENAME || return 1
261     return 0
264 function should_build
266     if [ -f $1/BUILT ]; then
267         echo "Already built"
268         return 1
269     fi
271     return 0
274 function tarball_get_and_build
276     BASENAME=`basename $1`
277     DIRNAME=`echo $BASENAME | sed -e s,.src.,., | sed -e s,.tar.*,,`
278     INSTCMD="make install"
279     PREFIXARG="--prefix=$PREFIX"
280     COMMONOPTS="$COMMON_OPTIONS"
281    
282     SHORTNAME=`echo $DIRNAME | sed -e s,-*[0-9\.]*$,,`
283     if !(echo "$MODULES" | grep -w $SHORTNAME) >/dev/null; then
284         return 0
285     fi
286     
287     echo
288     echo "Building $DIRNAME"
289     echo -ne "\033]0;Building $DIRNAME\007"
290     
291     # Special case jpeg... :/
292     if [ x`echo $DIRNAME | grep jpeg` != x ]; then
293         INSTCMD="make install-lib"
294     fi
295     
296     if [ x`echo $BASENAME | grep bz2` != x ]; then
297         COMP="j"
298     else
299         COMP="z"
300     fi
301     
302     # Doxygen doesn't have a standard configure script.
303     if [ x`echo $BASENAME | grep doxygen` != x ]; then
304         PREFIXARG="--prefix $PREFIX"
305         COMMONOPTS="--shared"
306     fi
307     
308     # Modify specific configure options
309     UNDERSCORENAME=`echo $SHORTNAME | sed -e s,-,_, | tr -d '+'`
310     CONFIGURE_EXTRA=`eval echo '\$'{CONFIGURE_$UNDERSCORENAME}`
311     if [ "x$CONFIGURE_EXTRA" != "x" ]; then
312         COMMONOPTS="$COMMONOPTS $CONFIGURE_EXTRA"
313     fi
314     PRECONFIGURE=`eval echo '\$'{PRECONFIGURE_$UNDERSCORENAME}`
315     if [ "x$PRECONFIGURE" == "x" ]; then
316         PRECONFIGURE="true"
317     fi
318     POSTCONFIGURE=`eval echo '\$'{POSTCONFIGURE_$UNDERSCORENAME}`
319     if [ "x$POSTCONFIGURE" == "x" ]; then
320         POSTCONFIGURE="true"
321     fi
322     
323     cd $SOURCE || return 1
324     download $1 || return 1
325     should_build $DIRNAME || return 0
326     tar ${COMP}xf $BASENAME && \
327         cd $DIRNAME && \
328         $PRECONFIGURE && \
329         echo "./configure $PREFIXARG $COMMONOPTS $2" && \
330         ./configure $PREFIXARG $COMMONOPTS $2 && \
331         $POSTCONFIGURE && \
332         make && $INSTCMD && touch BUILT
336 function cpan_get_and_build
338     BASENAME=`basename $1`
339     DIRNAME=`echo $BASENAME | sed -e s,.tar.*,,`
340     
341     SHORTNAME=`echo $DIRNAME | sed -e s,-*[0-9\.]*$,,`
342     if !(echo "$MODULES" | grep -w $SHORTNAME) >/dev/null; then
343         return 0
344     fi
345     
346     echo
347     echo "Building $DIRNAME"
348     echo -ne "\033]0;Building $DIRNAME\007"
349     
350     if [ x`echo $BASENAME | grep bz2` != x ]; then
351         COMP="j"
352     else
353         COMP="z"
354     fi
355     
356     cd $SOURCE || return 1
357     download $1 || return 1
358     should_build $DIRNAME || return 0
359     tar ${COMP}xf $BASENAME && \
360         cd $DIRNAME && \
361         perl Makefile.PL $2 && \
362         make && \
363         (echo "Enter your password to istall $BASENAME"; make install) && \
364         touch BUILT
367 function git_get_and_build
369     if !(echo "$MODULES" | grep -w $2) >/dev/null; then
370         return 0
371     fi
372     
373     echo
374     echo "Building $2"
375     echo -ne "\033]0;Building $2\007"
376     
377     cd $SOURCE
378     if [ -d $2 ]; then
379         cd $2
380         cg-update || return
381     else
382         cg-clone $1/$2 || return
383         cd $2
384     fi
385     
386     echo "./autogen.sh $COMMON_OPTIONS $3"
387     (./autogen.sh $COMMON_OPTIONS $3 && make && make install)
390 function cvs_get_and_build
392     if !(echo "$MODULES" | grep -w $2) >/dev/null; then
393         return 0
394     fi
395     
396     echo
397     echo "Building $2"
398     echo -ne "\033]0;Building $2\007"
399     
400     cd $SOURCE
401     if [ -d $2 ]; then
402         cd $2
403         cvs up -dP || return
404     else
405         cvs -d $1 co -P $2 || return
406         cd $2
407     fi
408     
409     echo "./autogen.sh $COMMON_OPTIONS $3"
410     (./autogen.sh $COMMON_OPTIONS $3 && make && make install)
413 function svn_get_and_build
415     if !(echo "$MODULES" | grep -w $2) >/dev/null; then
416         return 0
417     fi
418     
419     echo
420     echo "Building $2"
421     echo -ne "\033]0;Building $2\007"
422     
423     cd $SOURCE
424     if [ -d $2 ]; then
425         cd $2
426         svn up || return
427     else
428         svn co $1/$2/trunk $2 || return
429         cd $2
430     fi
431     
432     echo "./autogen.sh $COMMON_OPTIONS $3"
433     #(./autogen.sh $COMMON_OPTIONS $3 && ./configure --prefix=$PREFIX $COMMON_OPTIONS $3 && make && make install)
434     (./autogen.sh $COMMON_OPTIONS $3 && make && make install)
437 function set_automake
439     old_AUTOMAKE=$AUTOMAKE
440     old_ACLOCAL=$ACLOCAL
442     export AUTOMAKE=automake-$1
443     export ACLOCAL=aclocal-$1
446 function restore_automake
448     if [ x$old_AUTOMAKE != x ]; then
449         export AUTOMAKE=$old_AUTOMAKE
450     else
451         unset AUTOMAKE
452     fi
454     if [ x$old_ACLOCAL != x ]; then
455         export ACLOCAL=$old_ACLOCAL
456     else
457         unset ACLOCAL
458     fi
461 function do_exit
463     echo -ne "\033]0;\007"
464     exit
467 # Make sure to restore the title when done.
468 trap do_exit EXIT SIGINT SIGTERM
471 # configure doesn't pass CFLAGS through to generated libtool 
472 function patch_libtool_dylib()
474     # Only do this for universal builds.
475     if [ "x$UNIVERSAL_BUILD" != "xYes" ]; then
476         return 0
477     fi
479     cp libtool libtool.old
480     perl -pi -e "s@-dynamiclib@$CFLAGS \$&@" libtool
481     if test "x$1" = "xwithbundle"; then
482         perl -pi -e "s@-bundle@$CFLAGS \$&@" libtool
483     fi
487 function process_modules()
489     # Bootstrap packages.
490     PACKAGES=" \
491         http://pkgconfig.freedesktop.org/releases/pkg-config-0.21.tar.gz \
492         http://ftp.gnu.org/gnu/libtool/libtool-1.5.22.tar.gz \
493         http://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.bz2 \
494         http://ftp.gnu.org/pub/gnu/automake/automake-1.7.9.tar.bz2 \
495         http://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.bz2 \
496         http://heanet.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.15.tar.bz2 \
497         ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz \
498         http://people.imendio.com/richard/gtk-osx/files/jpeg-6b.tar.gz \
499         http://ftp.gnu.org/gnu/gettext/gettext-0.16.tar.gz \
500         http://heanet.dl.sourceforge.net/sourceforge/expat/expat-2.0.0.tar.gz \
501         http://heanet.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.0.tar.bz2 \
502         http://fontconfig.org/release/fontconfig-2.4.2.tar.gz \
503         http://people.imendio.com/richard/gtk-osx/files/docbook-files-1.tar.gz \
504         http://www.cs.mu.oz.au/~mjwybrow/gtk-osx/gnome-doc-utils-fake-1.tar.gz \
505         "
507         #http://people.imendio.com/richard/gtk-osx/files/popt-1.7.tar.gz
508     
509     for PACKAGE in $PACKAGES; do
510         tarball_get_and_build $PACKAGE || exit 1
511     done
513     PACKAGE=http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/1.6/gtk-doc-1.6.tar.bz2
514     tarball_get_and_build $PACKAGE "--with-xml-catalog=$PREFIX/etc/xml/catalog" || exit 1
515     
516     PACKAGE=ftp://ftp4.freebsd.org/pub/FreeBSD/ports/distfiles/XML-Parser-2.34.tar.gz
517     cpan_get_and_build $PACKAGE "PREFIX=$PREFIX INSTALLDIRS=perl EXPATLIBPATH=$PREFIX/lib EXPATINCPATH=$PREFIX/include" || exit 1
519     PACKAGES=" \
520         http://ftp.gnome.org/pub/GNOME/sources/intltool/0.35/intltool-0.35.0.tar.bz2 \
521         http://icon-theme.freedesktop.org/releases/hicolor-icon-theme-0.9.tar.gz \
522         http://ftp.gnome.org/pub/GNOME/sources/gnome-icon-theme/2.14/gnome-icon-theme-2.14.2.tar.bz2 \
523         "
524     
525     for PACKAGE in $PACKAGES; do
526         tarball_get_and_build $PACKAGE || exit 1
527     done
530     # Other packages:
531     if [ "x$UNIVERSAL_BUILD" == "xYes" -o "x$STABLE_BUILD" = "xYes"  ];
532     then
533         tarball_get_and_build http://cairographics.org/snapshots/glitz-0.5.6.tar.gz || exit 1
534         tarball_get_and_build http://cairographics.org/releases/cairo-1.4.0.tar.gz || exit 1
535         tarball_get_and_build http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.8.tar.gz || exit 1
536         tarball_get_and_build http://www.littlecms.com/lcms-1.16.tar.gz || exit 1
537         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/glib/2.12/glib-2.12.11.tar.bz2 || exit 1
538         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/pango/1.14/pango-1.14.10.tar.bz2 || exit 1
539         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/atk/1.12/atk-1.12.4.tar.bz2 || exit 1
540         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/gtk+/2.10/gtk+-2.10.11.tar.bz2 || exit 1
541         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/libxml2/2.6/libxml2-2.6.27.tar.bz2 || exit 1
542         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/libsigc++/2.0/libsigc++-2.0.17.tar.bz2 || exit 1
543         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/glibmm/2.12/glibmm-2.12.7.tar.bz2 || exit 1
544         tarball_get_and_build http://cairographics.org/releases/cairomm-1.2.4.tar.gz || exit 1
545         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/gtkmm/2.10/gtkmm-2.10.8.tar.bz2 || exit 1
546         tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/libxslt/1.1/libxslt-1.1.20.tar.bz2 || exit 1
547         tarball_get_and_build ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/popt-1.7.tar.gz || exit 1
549         svn_get_and_build $INKSCAPESVNURL inkscape || exit 1
551         exit 0
552     else
553             git_get_and_build git://git.cairographics.org/git cairo "--enable-pdf --enable-atsui --enable-quartz --disable-xlib" || exit 1
555             tarball_get_and_build http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc6.7.tar.gz || exit 1
556             tarball_get_and_build ftp://ftp.gnome.org/mirror/gnome.org/sources/libsigc++/2.0/libsigc++-2.0.17.tar.gz || exit 1
557             tarball_get_and_build http://ftp.stack.nl/pub/users/dimitri/doxygen-1.5.1.src.tar.gz || exit 1
558             tarball_get_and_build ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.1.x/popt-1.7.tar.gz || exit 1
559     fi
561     svn_get_and_build $GNOMESVNURL libxml2 || exit 1
562     svn_get_and_build $GNOMESVNURL libxslt || exit 1
563     svn_get_and_build $GNOMESVNURL gnome-common || exit 1
564     svn_get_and_build $GNOMESVNURL glib || exit 1
565     svn_get_and_build $GNOMESVNURL atk || exit 1
566     svn_get_and_build $GNOMESVNURL pango "--without-x" || exit 1
567     svn_get_and_build $GNOMESVNURL gtk+ "--with-gdktarget=quartz" || exit 1
568     svn_get_and_build $GNOMESVNURL gtk-engines || exit 1
569     svn_get_and_build $GNOMESVNURL loudmouth "--with-ssl=openssl" || exit 1
570     svn_get_and_build $GNOMESVNURL libglade || exit 1
571     # gossip needs xml2po from gnome-doc-utils.
572     svn_get_and_build $GNOMESVNURL gossip "--with-backend=cocoa" || exit 1
573     svn_get_and_build $CAIROCVSROOT pycairo || exit 1
574     svn_get_and_build $GNOMESVNURL pygobject "--disable-docs" || exit 1
575     svn_get_and_build $GNOMESVNURL pygtk "--disable-docs" || exit 1
577     svn_get_and_build $GNOMESVNURL glibmm "--disable-docs --disable-fulldocs" || exit 1
578     cvs_get_and_build $CAIROCVSROOT cairomm || exit 1
579     svn_get_and_build $GNOMESVNURL gtkmm "--disable-docs --disable-examples --disable-demos" || exit 1
581     svn_get_and_build $INKSCAPESVNURL inkscape || exit 1
584     #svn_get_and_build $GNOMESVNURL gimp || exit 1
585     # For gimp:
586     # libart_lgpl, needs automake 1.4 and doesn't run libtoolize
587     # gtkhtml2 (optional)
588     # libpoppler (optional)
589     # ./autogen.sh --prefix=/opt/gimp --disable-gtk-doc 
592 if (echo "$*" | grep bootstrap) >/dev/null; then
593     if [ "x`cg-version 2>/dev/null`" == "x" ]; then
594         echo "You need the cogito to get cairo from git. It's available e.g. in Darwin ports."
595         exit 1
596     fi
597     if [ "x`which svn 2>/dev/null`" == "x" ]; then
598         echo "You need the svn client to get inkscape."
599         exit 1
600     fi
601     
602     mkdir -p $SOURCE 2>/dev/null || \
603         (echo "Error: Couldn't create source checkout dir $SOURCE"; exit 1)
604     mkdir -p $PREFIX/bin 2>/dev/null || \
605         (echo "Error: Couldn't create bin dir $PREFIX/bin"; exit 1)
606     
607     echo "Building bootstrap packages."
608  
609     MODULES="pkg-config libtool autoconf automake libpng tiff jpeg-6b gettext \
610              expat fontconfig docbook-files intltool \
611              "
612              # freetype
613              # XML-Parser hicolor-icon-theme gnome-icon-theme"
614              # gnome-doc-utils-fake gtk-doc \
615     process_modules
616     
617     # Setup glibtool* links since some stuff expects them to be named like 
618     # that on OSX
619     if [ -z $PREFIX/bin/glibtoolize ]; then
620         ln -s $PREFIX/bin/libtoolize $PREFIX/bin/glibtoolize
621         ln -s $PREFIX/bin/libtool $PREFIX/bin/glibtool
622     fi
624     echo
625     echo "Done bootstrapping. Continue with \"build\" or \"shell\"."
626     exit 0
627 fi
629 if [ "x$1" != xbuild ]; then
630     print_usage
631     exit 1
632 fi
634 shift
636 MODULES=$*
637 if [ $# -eq 0 ]; then
638     echo "Building core modules."
639     MODULES="$CORE_MODULES"
640 elif [ "x$1" = xcore ]; then
641     echo "Building core modules."
642     MODULES="$CORE_MODULES"
643 elif [ "x$1" = xpython ]; then
644     echo "Building python modules."
645     MODULES="$PYGTK_MODULES"
646 elif [ "x$1" = xall ]; then
647     echo "Building core+extra+python modules."
648     MODULES="$CORE_MODULES $EXTRA_MODULES $PYGTK_MODULES"
649 elif [ "x$1" = xinkscape ]; then
650     echo "Building inkscape modules."
651     MODULES="$INKSCAPE_MODULES"
652 fi
654 process_modules
655 echo "Done."