ardour/tools/build-gtk-stack

517 lines
22 KiB
Bash
Executable File

#!/bin/bash
#
# THIS SCRIPT EXISTS FOR THE PURPOSE OF BUILDING THE ENTIRE GTK STACK UP UPON WHICH ARDOUR DEPENDS
#
# Its use is not documented, and it is not intended to be used or useful to anyone attempting to build
# Ardour.
#
# The requirements for building Ardour are made clear in the documentation on building available
# via http://ardour.org/development. Once your system satisfies those requirements, you can build ardour
# using the instructions documented online. This script happens to be usable to satisfy those requirements,
# but there are other approaches that you can and probably should use to do so.
#
clean=
makespace=
parallel=2
patch_gtk_osx=
PREFIX=$HOME/gtk/inst
unpatch=
this_script_dir="`/usr/bin/dirname \"$0\"`"
target_mods=
function die () {
echo $*
exit 1
}
function fetch_as () {
if [ -f $1 ] ; then
return
fi
if uname -a | grep --silent arwin ; then
curl -L -o $1 $2
else
wget --no-check-certificate -O $1 $2
fi
}
function defmod {
if [ $# -ne 4 -a $# -ne 6 -a $# -ne 5 ] ; then
echo "Incorrect number of arguments ($#) passed to defmod (5, 6 or 7) for $1"
exit 1
fi
name=$1 ; shift
if [ x$target_mods != x ] ; then
if echo $target_mods | grep --silent $name ; then
:
else
echo "Skipping $name ..."
return
fi
fi
need_unpacked=1
if [ $# -eq 3 ] ; then
eval "MOD_${name}_name=\"$name\""
eval "MOD_${name}_version=\"$1\"" ; shift
eval "MOD_${name}_source=\"$1\"" ; shift
eval "MOD_${name}_compression=\"$1\"" ; shift
elif [ $# -eq 4 ] ; then
eval "MOD_${name}_name=\"$1\"" ; shift
eval "MOD_${name}_version=\"$1\"" ; shift
eval "MOD_${name}_source=\"$1\"" ; shift
eval "MOD_${name}_compression=\"$1\"" ; shift
elif [ $# -eq 5 ] ; then
eval "MOD_${name}_name=\"$1\"" ; shift
eval "MOD_${name}_version=\"$1\"" ; shift
eval "MOD_${name}_source=\"$1\"" ; shift
eval "MOD_${name}_compression=\"$1\"" ; shift
eval "MOD_${name}_unpacked=\"$1\""; shift
need_unpacked=0
fi
eval "if [ x\"\$MOD_${name}_version\" = x ] ; then \
MOD_${name}_wholename=\"\$MOD_${name}_name\" ; \
else \
MOD_${name}_wholename=\"\$MOD_${name}_name-\$MOD_${name}_version\"; \
fi"
if [ $need_unpacked = 1 ] ; then
eval "MOD_${name}_unpacked=\$MOD_${name}_wholename"
fi
eval "MOD_${name}_url=\$MOD_${name}_source\$MOD_${name}_wholename.tar.\$MOD_${name}_compression"
eval "MOD_${name}_local_tarball=\`basename \$MOD_${name}_url\`"
MODS="$MODS $name"
}
function built() {
m=$1
built=1 # false in shell terms
# if it already unpacked, assume it is built
eval "if [ -d \$MOD_${m}_unpacked ] ; then \
built=0 ;
fi"
return $built
}
function basic_builder() {
m=$1
if built $m ; then
return
fi
# get busy ...
eval "tar xf \$MOD_${m}_local_tarball && (cd \$MOD_${m}_unpacked && CFLAGS=\"$GLOBAL_CFLAGS\" LDFLAGS=\"$GLOBAL_LDFLAGS\" ./configure $GLOBAL_CONF && PATH=/usr/bin:$PATH make && make install) || die $m build failed"
}
while [ $# -gt 0 ] ; do
case $1 in
--clean*) clean=1 ; shift ;;
--space*) makespace=1 ; shift ;;
--prefix*) PREFIX=`echo $1 | sed 's/--prefix=//'` ; shift ;;
--patch*) patch=1 ; shift ;;
--unpatch*) patch=1 ; unpatch=-R; shift ;;
--target) target_mods="$target_mods $1"; shift ;;
-j*) parallel=`echo $1 | sed 's/-j//'` ; shift ;;
*) echo "Unknown argument $1" ; exit 1 ;;
esac
done
# DEFINING MODULES
#
# 3 possible formats
#
# NAME VERSION URL_FOR_DOWNLOAD_DIR COMPRESSION_TYPE
# NAME PACKAGE_NAME VERSION URL_FOR_DOWNLOAD_DIR COMPRESSION_TYPE
# NAME PACKAGE_NAME VERSION URL_FOR_DOWNLOAD_DIR COMPRESSION_TYPE UNPACKED_NAME
#
# the first form is the most common
# the second form is required where the package name includes characters not allowed
# in shell variables. here, the first NAME should define a legal shell variable name
# the third form is required for libjpeg whose packaging and naming is totally inconsistent
# with normal practice
#
defmod 'xz' '5.0.3' "http://tukaani.org/xz/" 'bz2'
defmod 'tar' '1.26' "http://ftp.gnu.org/gnu/tar/" 'bz2'
defmod 'm4' '1.4.16' "http://ftp.gnu.org/gnu/m4/" 'bz2'
defmod 'autoconf' '2.68' "http://ftp.gnu.org/gnu/autoconf/" 'bz2'
defmod 'automake' '1.11.3' "http://ftp.gnu.org/gnu/automake/" 'gz'
defmod 'libtool' '2.4.2' 'http://ftp.gnu.org/gnu/libtool/' 'gz'
defmod 'make' '3.82' 'http://ftp.gnu.org/gnu/make/' 'bz2'
defmod 'flex' '2.5.35' 'http://prdownloads.sourceforge.net/flex/' 'gz'
defmod 'bison' '2.5' 'ftp://ftp.gnu.org/gnu/bison/' 'bz2'
defmod 'glib' '2.32.2' 'http://ftp.gnome.org/pub/gnome/sources/glib/2.32/' 'xz'
defmod 'pkgconfig' 'pkg-config' '0.26' 'http://pkgconfig.freedesktop.org/releases/' 'gz'
defmod 'readline' '6.2' 'ftp://ftp.cwru.edu/pub/bash/' 'gz'
defmod 'zlib' '1.2.7' 'ftp://ftp.simplesystems.org/pub/libpng/png/src/history/zlib/' 'bz2'
defmod 'libiconv' '1.14' 'ftp://ftp.gnu.org/gnu/libiconv/' 'gz'
defmod 'gettext' '0.18.1.1' 'http://ftp.gnu.org/pub/gnu/gettext/' 'gz'
defmod 'expat' '2.1.0' 'http://prdownloads.sourceforge.net/expat/' 'gz'
defmod 'libxml2' '2.7.8' 'ftp://xmlsoft.org/libxslt/' 'gz'
defmod 'libxslt' '1.1.28' 'ftp://xmlsoft.org/libxslt/' 'gz'
defmod 'tiff' '4.0.1' 'ftp://ftp.remotesensing.org/pub/libtiff/' 'gz'
defmod 'libpng' '1.6.0' 'ftp://ftp.simplesystems.org/pub/libpng/png/src/history/libpng16/' 'xz'
defmod 'jpeg' 'jpegsrc.v8d' '' 'http://www.ijg.org/files/' 'gz' 'jpeg-8d'
defmod 'makemaker' 'ExtUtils-MakeMaker' '6.64' 'http://search.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/' 'gz'
defmod 'xmlparser' 'XML-Parser' '2.41' 'http://search.cpan.org/CPAN/authors/id/T/TO/TODDR/' 'gz'
defmod 'xmlsimple' 'XML-Simple' '2.20' 'http://search.cpan.org/CPAN/authors/id/G/GR/GRANTM/' 'gz'
defmod 'atk' '2.2.0' 'http://ftp.gnome.org/pub/GNOME/sources/atk/2.2/' 'bz2'
defmod 'gnomecommon' 'gnome-common' '2.34.0' 'http://ftp.acc.umu.se/pub/gnome/sources/gnome-common/2.34/' 'bz2'
defmod 'gtkdoc' 'gtk-doc' '1.18' 'http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/1.18/' 'bz2'
defmod 'gnomedocutils' 'gnome-doc-utils' '0.20.6' 'http://ftp.acc.umu.se/pub/gnome/sources/gnome-doc-utils/0.20/' 'bz2'
defmod 'pixman' '0.28.2' 'http://cgit.freedesktop.org/pixman/snapshot/' 'gz'
defmod 'libffi' '3.0.10' 'ftp://sourceware.org/pub/libffi/' 'gz'
defmod 'freetype' '2.4.9' 'http://downloads.sourceforge.net/project/freetype/freetype2/2.4.9/' 'bz2'
defmod 'fontconfig' '2.8.0' 'http://www.freedesktop.org/software/fontconfig/release/' 'gz'
defmod 'cairo' '1.12.8' 'http://cairographics.org/releases/' 'xz'
defmod 'pango' '1.29.5' 'http://ftp.gnome.org/pub/GNOME/sources/pango/1.29/' 'bz2'
defmod 'gdkpixbuf' 'gdk-pixbuf' '2.25.0' 'http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.25/' 'xz'
defmod 'intltool' '0.50.2' 'http://launchpad.net/intltool/trunk/0.50.2/+download/' 'gz'
defmod 'gtkosxdocbook' 'gtk-osx-docbook' '1.0' 'http://downloads.sourceforge.net/project/gtk-osx/GTK-OSX%20Build/' 'gz'
defmod 'gobjectintrospection' 'gobject-introspection' '1.31.10' 'http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/1.31/' 'xz'
defmod 'gtkengines' 'gtk-engines' '2.21.0' 'http://ardour.org/files/' 'gz'
# modified source : fetch tarballs from ardour.org
if uname -a | grep --silent arwin ; then
defmod gtk gtk+ '2.24.18-quartz' http://ardour.org/files/deps/ bz2 "gtk+-2.24.18"
else
defmod gtk gtk+ '2.24.18-x11' http://ardour.org/files/deps/ bz2 "gtk+-2.24.18"
fi
if [ x$clean != x -o x$makespace != x ] ; then
#
# bison 2.5 is just used here because its unlikely to occur in
# a random non-source directory
#
if [ ! -d bison-2.5 ] ; then
echo "This doesn't appear to be your source directory. Don't run --clean or --space here."
exit 1
fi
rm -rf `find . -maxdepth 1 -type d | grep -v -e "^.$"`
if [ $clean ] ; then
rm -rf $PREFIX
fi
exit 0
fi
mkdir -p $PREFIX
export MAKEFLAGS=-j$parallel
PATH=$PREFIX/bin:$PATH
#
# Check Perl
#
PERLVERSION=`perl -e 'printf "%vd\n", $^V;'`
#
# Check Python presence
#
PYVERS=`python --version 2>&1 | cut -d ' ' -f 2 | cut -b 1-3`
export PYTHONPATH=$PREFIX/lib/python${PYVERS}/site-packages/:${PYTHONPATH:+:$PYTHONPATH}
if python --version 2>&1 | egrep --silent '(2\.7|2\.6)' ; then
:
else
echo "You need at least Python 2.6 to run this script"
exit 1
fi
pythondir=`dirname $(which python)`
if [ $pythondir != "/usr/bin" ] ; then
PYTHONPREFIX=`dirname $pythondir`
fi
OSX=
if uname -a | grep --silent arwin ; then
# its OS X! run for the hills !!
OSX=1
# tell perl to look in our $PREFIX tree for additional perl modules
export PERL5LIB=$PREFIX/System/Library/Perl/$PERLVERSION
export DYLD_FALLBACK_LIBRARY_PATH=$PREFIX/lib${DYLD_FALLBACK_LIBRARY_PATH:+:$DYLD_FALLBACK_LIBRARY_PATH}
# force compilation to use 10.4 APIs only. could be overkill, but better safe than sorry
GLOBAL_CFLAGS="-DMAC_OSX_VERSION_MAX_ALLOWED=1040 -mmacosx-version-min=10.4 -O3"
# for 10.5 and above, add to CFLAGS
# -sysroot=/Developer/SDKs/MacOSX10.4u.sdk"
GLOBAL_LDFLAGS="-headerpad_max_install_names"
# for 10.5 and above, add to LDFLAGS
# "-syslibroot /Developer/SDKs/MacOSX10.4u.sdk"
export MACOSX_DEPLOYMENT_TARGET=10.4
CAIRO_CONF="--enable-xlib=no --enable-quartz=yes --enable-xcb=no"
PANGO_CONF="--without-x"
GTK_BACKEND=quartz
AVOID_ICONV=
explicit_intl=yes
else
# tell perl to look in our $PREFIX tree for additional perl modules
# Some idiotic Perl modules install into MAJOR.MINOR rather than MAJOR.MINOR.MICRO
PERL_STUPIDVERSION=`echo $PERLVERSION | sed 's/\.[0-9][0-9]*$//'`
export PERL5LIB=$PREFIX/lib/perl/$PERLVERSION:$PREFIX/lib/perl/$PERL_STUPIDVERSION:$PREFIX/share/perl/$PERLVERSION:$PREFIX/share/perl/$PERL_STUPIDVERSION
export LD_LIBRARY_PATH=$PREFIX/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
GLOBAL_CFLAGS=
GLOBAL_LDFLAGS=
CAIRO_CONF=
PANGO_CONF=
GTK_BACKEND=x11
AVOID_ICONV="--with-libiconv=no"
# normal linux platforms won't need this
explicit_intl=
# this is very crude versioning test
python --version >/dev/null 2>&1
if [ $? -ne 0 ] ; then
echo "There's a problem with your Python installation"x
exit 1
fi
if python --version | grep --silent '2\.7' ; then
echo "You do not have a new enough version of Python"
exit 1
fi
fi
set -e
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
GLOBAL_CONF="--prefix=$PREFIX"
for m in $MODS ; do
eval "fetch_as \$MOD_${m}_local_tarball \$MOD_${m}_url || die \"downloading $m failed\""
done
if [ x$patch != x ] ; then
cd gtk+
echo "Testing ($unpatch) patches ... "
# if uname -a | grep --silent arwin ; then
patches=`ls $this_script_dir/current-gtk-patches/*.patch`
# else
# patches="$this_script_dir/current-gtk-patches/gtkrelocation.patch"
# fi
for patch in $patches ; do
if patch $unpatch --dry-run -p1 < "$patch" ; then
:
else
echo "$? : Patch $patch no longer applies ($unpatch) cleanly."
exit 1
fi
done
echo "Applying ($unpatch) patches ..."
for patch in $patches ; do
patch $unpatch -p1 < "$patch"
done
exit 0
fi
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
#
# until we've got a new version of tar, we need to specify the compression type, which is a PITA
#
tar jxf $MOD_xz_local_tarball && (cd $MOD_xz_unpacked && LDFLAGS="-L$PREFIX/lib" CFLAGS="-I$PREFIX/include" ./configure $GLOBAL_CONF && make && make install) || die "xz build failed"
tar jxf $MOD_tar_local_tarball && (cd $MOD_tar_unpacked && LDFLAGS="-L$PREFIX/lib" CFLAGS="-I$PREFIX/include" ./configure $GLOBAL_CONF && make && make install) || die "tar build failed"
# make sure we pick up the new version of tar that we just installed into $PREFIX
hash tar
basic_builder m4
basic_builder make
tar xf $MOD_zlib_local_tarball && (cd $MOD_zlib_unpacked && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" ./configure $GLOBAL_CONF && PATH=/usr/bin:$PATH make && make install) || die "zlib build failed"
basic_builder autoconf
basic_builder automake
basic_builder libtool
basic_builder make
basic_builder flex
basic_builder bison
basic_builder expat
#
# libxml2 will fail to build python modules if Python is not a system install, so we need to supply --with-python in that case
#
if [ x$PYTHONPREFIX != x ] ; then
WITHPYTHON=--with-python=$PYTHONPREFIX
fi
tar xf $MOD_libxml2_local_tarball && (cd $MOD_libxml2_unpacked && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" ./configure $GLOBAL_CONF $WITHPYTHON --with-zlib=$PREFIX && make && make install) || die "libxml2 build failed"
basic_builder libxslt
# hackety-frakkin-hack ....
# we need to force xsltproc to never rely on network access during this build, so we have to hack up
# a script to do this
if ! file $PREFIX/bin/xsltproc | grep --silent "POSIX shell script"; then
mv $PREFIX/bin/xsltproc $PREFIX/bin/xsltproc.bin
cat <<EOF >$PREFIX/bin/xsltproc
#!/bin/sh
exec xsltproc.bin --nonet "\$@"
EOF
chmod a+x $PREFIX/bin/xsltproc
fi
#
# now returning you to some semblance of sanity ...
#
basic_builder readline
#
# Only build i18n libs on OS X
# This really needs to be a test for glibc with libintl builtin
#
if [ x$explicit_intl != x ] ; then
basic_builder libiconv
tar xf $MOD_gettext_local_tarball && (cd $MOD_gettext_unpacked && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" ./configure --with-included-gettext --with-libiconv-prefix=$PREFIX --enable-shared $GLOBAL_CONF && make && make install) || die "gettext build failed"
fi
basic_builder intltool
if [ x$OSX != x ] ; then
tar xf $MOD_tiff_local_tarball && (cd $MOD_tiff_unpacked && CFLAGS="$GLOBAL_CFLAGS -DHAVE_APPLE_OPENGL_FRAMEWORK" LDFLAGS="$GLOBAL_LDFLAGS" ./configure $GLOBAL_CONF && make && make install) || die "tiff build failed"
else
basic_builder tiff
fi
basic_builder libpng
basic_builder jpeg
#tar xf $MOD_makemaker_local_tarball && (cd $MOD_makemaker_unpacked && unset MACOSX_DEPLOYMENT_TARGET && perl Makefile.PL PREFIX=$PREFIX && make && make install) || die "ExtUtils::MakeMaker build failed"
#tar xf $MOD_xmlparser_local_tarball && (cd $MOD_xmlparser_unpacked && unset MACOSX_DEPLOYMENT_TARGET && perl Makefile.PL EXPATINCPATH=$PREFIX/include EXPATLIBPATH=$PREFIX/lib PREFIX=$PREFIX && make && make install) || die "XML-Parser build failed"
#tar xf $MOD_xmlsimple_local_tarball && (cd $MOD_xmlsimple_unpacked && unset MACOSX_DEPLOYMENT_TARGET && perl Makefile.PL PREFIX=$PREFIX && make && make install) || die "XML-Simple build failed"
if uname -a | grep --silent arwin ; then
#
# libffi has a bug that is caused by it depending on the output format of GNU wc(1)
# it can be avoided by changing into the target build directory, re-running configure and then running make from there.
# the target dir gets built by the first invocation of configure, and is the newest dir, so we find its name with ls and awk.
#
tar xf $MOD_libffi_local_tarball && (cd $MOD_libffi_unpacked && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" ./configure $GLOBAL_CONF && cd `ls -ltd * | awk '/^d/ {print $9; exit}'` && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" ../configure $GLOBAL_CONF && make && make install) || die "libffi build failed"
else
basic_builder libffi
fi
# time to bootstrap the circular dependency between pkg-config and glib.
#
# step one: build glib with everything specified so that pkg-config is not used or required
#
tar xf $MOD_glib_local_tarball \
&& (cd $MOD_glib_unpacked && LDFLAGS=-L$PREFIX/lib CFLAGS=-I$PREFIX/include ZLIB_CFLAGS=-I$PREFIX/include ZLIB_LIBS="-L$PREFIX/lib -lz" LIBFFI_CFLAGS=-I$PREFIX/lib/libffi-3.0.10/include LIBFFI_LIBS="-L$PREFIX/lib -lffi" ./configure $GLOBAL_CONF --with-pcre=internal $AVOID_ICONV --disable-silent-rules && make && make install) && rm -rf glib-2.32.2 || die "glib build1 failed"
#
# step two: build pkg-config with glib flags specified so that pkg-config is not used or required
#
if [ x$explicit_intl != x ] ; then
tar xf $MOD_pkgconfig_local_tarball && (cd $MOD_pkgconfig_unpacked && GLIB_CFLAGS="-I$PREFIX/include/glib-2.0 -I$PREFIX/lib/glib-2.0/include" GLIB_LIBS="-L$PREFIX/lib -lglib-2.0 -lintl" ./configure --prefix=$PREFIX && make && make install) && rm -rf $MOD_pkgconfig_unpacked || die "pkg-config build1 failed"
else
tar xf $MOD_pkgconfig_local_tarball && (cd $MOD_pkgconfig_unpacked && GLIB_CFLAGS="-I$PREFIX/include/glib-2.0 -I$PREFIX/lib/glib-2.0/include" GLIB_LIBS="-L$PREFIX/lib -lglib-2.0" ./configure --prefix=$PREFIX && make && make install) && rm -rf $MOD_pkgconfig_unpacked || die "pkg-config build1 failed"
fi
#
# step three: rebuild glib
#
if [ x$explicit_intl != x ] ; then
# still need LDFLAGS in order to find libintl
tar xf $MOD_glib_local_tarball && (cd $MOD_glib_unpacked && LDFLAGS="$GLOBAL_LDFLAGS -L$PREFIX/lib -lintl" CFLAGS="$GLOBAL_CFLAGS -I$PREFIX/include" ./configure --prefix=$PREFIX && make && make install) || die "glib build failed"
else
tar xf $MOD_glib_local_tarball && (cd $MOD_glib_unpacked && LDFLAGS="$GLOBAL_LDFLAGS" CFLAGS="$GLOBAL_CFLAGS" ./configure --prefix=$PREFIX && make V=1 && make install) || die "glib build failed"
fi
#
# step four: rebuilding pkg-config now that glib is all set
#
basic_builder pkgconfig
#
# now we can start on the GTK stack itself
#
basic_builder atk
tar xf $MOD_gnomecommon_local_tarball && (cd $MOD_gnomecommon_unpacked && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" ./configure $GLOBAL_CONF && export MAKEFLAGS= make && MAKEFLAGS= make install) || die "gnome-common build failed"
tar xf $MOD_gtkosxdocbook_local_tarball && (cd $MOD_gtkosxdocbook_unpacked && JHBUILD_PREFIX=$PREFIX make install) || die "gtk build failed"
# gnome-doc-utils is not parallel-build safe so turn off make -j2
tar xf $MOD_gnomedocutils_local_tarball && (cd $MOD_gnomedocutils_unpacked && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" ./configure $GLOBAL_CONF --disable-scrollkeeper && MAKEFLAGS= make && MAKEFLAGS= make install) || die "gnome-doc-utils build failed"
tar xf $MOD_gtkdoc_local_tarball && (cd $MOD_gtkdoc_unpacked && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" ./configure --disable-scrollkeeper --with-xml-catalog=$PREFIX/etc/xml/catalog --prefix=$PREFIX && make && make install) || die "gtk build failed"
tar xf $MOD_pixman_local_tarball && (cd $MOD_pixman_unpacked && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" sh ./autogen.sh --prefix=$PREFIX && make && make install) || die "pixman build failed"
if [ x$OSX = x ] ; then
freetype_bytecode_patch=$this_script_dir/misc-patches/freetype-bytecode.patch
tar xf $MOD_freetype_local_tarball && (cd $MOD_freetype_unpacked && patch -p0 < $freetype_bytecode_patch && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" ./configure $GLOBAL_CONF && make && make install) || die "freetype build failed"
else
basic_builder freetype
fi
basic_builder fontconfig
if [ x$OSX = x ] ; then
#
# some linux nvidia drivers have buggy support for gradients. this patch
# lets the user set an environment variable that will force a Cairo workaround
# to the issue.
#
# --enable-gtk-doc is required so that make dist will work, which we need to be able to run for GPL compliance
#
cairo_gradient_patch=$this_script_dir/misc-patches/cairo-gradients.patch
tar xf $MOD_cairo_local_tarball && (cd $MOD_cairo_unpacked && patch -p4 < $cairo_gradient_patch && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" ./configure $GLOBAL_CONF $CAIRO_CONF --enable-gtk-doc && make && make install) || die "cairo build failed"
else
tar xf $MOD_cairo_local_tarball && (cd $MOD_cairo_unpacked && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" ./configure $GLOBAL_CONF $CAIRO_CONF && make && make install) || die "cairo build failed"
fi
tar xf $MOD_pango_local_tarball && (cd $MOD_pango_unpacked && CFLAGS=$GLOBAL_CFLAGS LDFLAGS="$GLOBAL_LDFLAGS" ./configure $GLOBAL_CONF $PANGO_CONF && make && make install) || die "pango build failed"
tar xf $MOD_gdkpixbuf_local_tarball && (cd $MOD_gdkpixbuf_unpacked && LDFLAGS="$GLOBAL_LDFLAGS -L$PREFIX/lib" CFLAGS="-I$PREFIX/include $GLOBAL_CFLAGS" ./configure $GLOBAL_CONF && make && make install) || die "gdk-pixbuf build failed"
# gobject-introspection uses #include <libintl.h> and there's no way to force the "scanner" to look outside the system tree
if [ x$explicit_intl != x ] ; then
#
# g-ir-scanner will go looking for <libintl.h> which means we need to inject -I$PREFIX/include into it
#
tar xf $MOD_gobjectintrospection_local_tarball && (cd $MOD_gobjectintrospection_unpacked && \
./configure $GLOBAL_CONF CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS -L$PREFIX/lib -lintl" && make INTROSPECTION_SCANNER_ARGS="-I$PREFIX/include" && make install) || die "gobject-introspection build failed"
else
basic_builder gobjectintrospection
fi
#
# now gtk itself
#
# --enable-gtk-doc is required so that make dist will work, which we need to be able to run for GPL compliance
#
(tar xf $MOD_gtk_local_tarball &&
cd $MOD_gtk_unpacked && CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" \
./configure --enable-maintainer-mode --prefix=$PREFIX --libdir=$PREFIX/lib \
--disable-cups --disable-papi --disable-introspection --enable-relocation --enable-gtk-doc \
--with-gdktarget=$GTK_BACKEND && make && make install) || die "GTK build failed"
#
# now gtk-engines
#
#
(tar xf $MOD_gtkengines_local_tarball && cd $MOD_gtkengines_unpacked && CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX/lib --libdir=$PREFIX/lib && make && make install) || die "GTK-engines build failed"