summaryrefslogtreecommitdiff
path: root/tools/build-ardour-stack
blob: be5f581e4307548bdb51e967841f38befee1bf68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
#!/bin/bash

function die () {
    echo $*
    exit 1
}

function fetch_as_is() {
    if uname -a | grep --silent arwin ; then
        curl -LO $1
    else
        wget --no-check-certificate $1
    fi
}

function fetch_as () {
    if uname -a | grep --silent arwin ; then
        curl -L -o $1 $2
    else
        wget --no-check-certificate -O $1 $2
    fi
}

clean=
makespace=
parallel=2
PREFIX=$HOME/a3/inst
this_script_dir="`/usr/bin/dirname \"$0\"`"

while [ $# -gt 0 ] ; do
   case $1 in
    --clean*) clean=1 ; shift ;;
    --prefix*) PREFIX=`echo $1 | sed 's/--prefix=//'` ; shift ;;
    --space*) makespace=1 ; shift ;;
    -j*) parallel=`echo $1 | sed 's/-j//'` ; shift ;;
   esac
done


if [ x$clean != x -o x$makespace != x ] ; then
    if [ ! -d LRDF ] ; then 
        echo "This doesn't appear to be your source directory. Don't run --clean or --space here."
        exit 1
    fi
    # sudo required because of sudo while installing some python/perl stuff
    sudo rm -rf `find . -maxdepth 1 -type d | grep -v "^.$"`
    # sudo required because of its use during the python install step
    if [ $clean ] ; then
        sudo rm -rf $PREFIX
    fi
    exit 0
fi

mkdir -p $PREFIX

export MAKEFLAGS=-j$parallel
PATH=$PREFIX/bin:$PATH

OSX=

if uname -a | grep --silent arwin ; then

    OSX=y
    
    # its OS X! run for the hills !!

    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
    # If the default python is not new enough, set PYTHON to point to a 
    # suitably new (2.7 or later) version of Python's framework
    PYTHON=
    #PYTHON=/Library/Frameworks/Python.framework/Versions/2.7
else 
    export LD_LIBRARY_PATH=$PREFIX/lib{$LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
    GLOBAL_CFLAGS=
    GLOBAL_LDFLAGS=
fi

set -e

export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

if [ ! -f boost_1_49_0.tar.bz2 ] ; then 
    echo boost
    fetch_as boost_1_49_0.tar.bz2 http://sourceforge.net/projects/boost/files/boost/1.49.0/boost_1_49_0.tar.bz2/download
fi
if [ ! -f fftw-3.3.1.tar.gz ] ; then
    echo fftw
    fetch_as_is http://www.fftw.org/fftw-3.3.1.tar.gz
fi
if [ ! -f libsigc++-2.2.10.tar.xz ] ; then 
    echo sigc++
    fetch_as_is http://ftp.gnome.org/pub/GNOME/sources/libsigc++/2.2/libsigc++-2.2.10.tar.xz
fi
if [ ! -f glibmm-2.32.0.tar.xz ] ; then
    echo glibmm
    fetch_as_is http://ftp.gnome.org/pub/GNOME/sources/glibmm/2.32/glibmm-2.32.0.tar.xz
fi
if [ ! -f cairomm-1.10.0.tar.gz ] ; then
    echo cairomm
    fetch_as_is http://cairographics.org/releases/cairomm-1.10.0.tar.gz
fi
if [ ! -f pangomm-2.28.4.tar.xz ] ; then 
    echo pangomm
    fetch_as_is http://ftp.acc.umu.se/pub/gnome/sources/pangomm/2.28/pangomm-2.28.4.tar.xz    
fi
if [ ! -f atkmm-2.22.6.tar.xz ] ; then 
    echo atkmm
    fetch_as_is http://ftp.gnome.org/pub/GNOME/sources/atkmm/2.22/atkmm-2.22.6.tar.xz
fi
if [ ! -f gtkmm-2.24.2.tar.xz ] ; then
    echo gtkmm
    fetch_as_is http://ftp.acc.umu.se/pub/GNOME/sources/gtkmm/2.24/gtkmm-2.24.2.tar.xz
fi
if [ ! -f libart_lgpl-2.3.21.tar.bz2 ] ; then 
    echo libart_lgpl
    fetch_as_is http://ftp.gnome.org/pub/gnome/sources/libart_lgpl/2.3/libart_lgpl-2.3.21.tar.bz2
fi
if [ ! -f libgnomecanvas-2.30.3.tar.bz2 ] ; then 
    echo libgnomecanvas
    fetch_as_is http://ftp.gnome.org/pub/gnome/sources/libgnomecanvas/2.30/libgnomecanvas-2.30.3.tar.bz2
fi
if [ ! -f libgnomecanvasmm-2.26.0.tar.bz2 ] ; then
    echo libgnomecanvasmm
    fetch_as_is http://ftp.acc.umu.se/pub/GNOME/sources/libgnomecanvasmm/2.26/libgnomecanvasmm-2.26.0.tar.bz2
fi

if [ ! -f liblo-0.26.tar.gz ] ; then 
    echo liblo
    fetch_as_is http://downloads.sourceforge.net/liblo/liblo-0.26.tar.gz
fi
if [ ! -f raptor2-2.0.6.tar.gz ] ; then 
    echo raptor
    fetch_as_is http://download.librdf.org/source/raptor2-2.0.6.tar.gz
fi
if [ ! -f rasqal-0.9.28.tar.gz ] ; then 
    echo rasqal 
    fetch_as_is http://download.librdf.org/source/rasqal-0.9.28.tar.gz
fi
if [ ! -f  redland-1.0.15.tar.gz ] ; then 
    echo librdf
    fetch_as_is http://download.librdf.org/source/redland-1.0.15.tar.gz
fi
if [ ! -f libogg-1.3.0.tar.xz ] ; then
    echo libogg
    fetch_as_is http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.xz
fi
if [ ! -f flac-1.2.1.tar.gz ] ; then
    echo flac
    fetch_as_is http://downloads.xiph.org/releases/flac/flac-1.2.1.tar.gz
fi
if [ ! -f libvorbis-1.3.2.tar.bz2 ] ; then
    echo libvorbis
    fetch_as_is http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.2.tar.bz2
fi
if [ ! -f libsamplerate-0.1.8.tar.gz  ] ; then
    echo libsamplerate
    fetch_as_is http://www.mega-nerd.com/SRC/libsamplerate-0.1.8.tar.gz
fi
if [ ! -f libsndfile-1.0.25.tar.gz ] ; then 
    echo libsndfile
    fetch_as_is http://www.mega-nerd.com/libsndfile/files/libsndfile-1.0.25.tar.gz
fi
if [ ! -f aubio-0.3.2.tar.gz ] ; then
    echo aubio
    fetch_as_is http://aubio.org/pub/aubio-0.3.2.tar.gz
fi
if [ ! -f rdflib-3.2.0.tar.gz ] ; then
    echo python rdflib
    fetch_as_is http://rdflib.googlecode.com/files/rdflib-3.2.0.tar.gz
fi
if [ ! -f setuptools-0.6c11.tar.gz ] ; then
    echo python setuptools
    curl -L -o setuptools-0.6c11.tar.gz http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
fi    
if [ ! -f isodate-0.4.0.tar.gz ] ; then
    echo python isodate
    curl -L -o isodate-0.4.0.tar.gz  http://pypi.python.org/packages/source/i/isodate/isodate-0.4.0.tar.gz#md5=74eb2ffca6ab3318d6627f25f88e24e5
fi
if [ ! -d LRDF ] ; then
    echo LRDF
    git clone git://github.com/swh/LRDF.git
fi

if [ ! -f lv2-1.0.0.tar.bz2 ] ; then
    echo LV2
    fetch_as_is http://lv2plug.in/spec/lv2-1.0.0.tar.bz2
fi
if [ ! -f serd-0.14.0.tar.bz2 ] ; then
    echo Serd
    fetch_as_is http://download.drobilla.net/serd-0.14.0.tar.bz2
fi
if [ ! -f sord-0.8.0.tar.bz2 ] ; then
    echo Sord
    fetch_as_is http://download.drobilla.net/sord-0.8.0.tar.bz2
fi
if [ ! -f sratom-0.2.0.tar.bz2 ] ; then
    echo Sratom
    fetch_as_is http://download.drobilla.net/sratom-0.2.0.tar.bz2
fi
if [ ! -f lilv-0.14.2.tar.bz2 ] ; then
    echo Lilv
    fetch_as_is http://download.drobilla.net/lilv-0.14.2.tar.bz2
fi
if [ ! -f suil-0.6.0.tar.bz2 ] ; then
    echo Suil
    fetch_as_is http://download.drobilla.net/suil-0.6.0.tar.bz2
fi
if [ ! -f curl-7.25.0.tar.bz2 ] ; then
    echo Suil
    fetch_as_is http://curl.haxx.se/download/curl-7.25.0.tar.bz2
fi

if [ x$OSX = x ] ; then 
    if [ ! -f  util-linux-2.21.tar.xz ] ; then
        echo util-linux/uuid
        fetch_as_is http://www.kernel.org/pub/linux/utils/util-linux/v2.21/util-linux-2.21.tar.xz
    fi
    
    tar xf util-linux-2.21.tar.xz && \
        (set -e && cd util-linux-2.21 && ./configure --prefix=$PREFIX --enable-shared --disable-most-builds --without-ncurses --enable-libuuid && cd libuuid && make && make install) || die "uuid build failed"
fi

tar xf boost_1_49_0.tar.bz2 && \
  (set -e && cd boost_1_49_0 && ./bootstrap.sh --prefix=$PREFIX --with-libraries=exception && ./b2 && ./b2 install) || die "boost build failed"

tar xf curl-7.25.0.tar.bz2 && \
    (set -e && cd curl-7.25.0 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "curl build failed"

tar xf fftw-3.3.1.tar.gz && \
   (set -e && cd fftw-3.3.1 && ./configure --prefix=$PREFIX --enable-shared && make && make install && make clean && ./configure --prefix=$PREFIX --enable-shared --enable-single && make && make install) || die "fftw build failed"

tar xf libsigc++-2.2.10.tar.xz && \
    (set -e && cd libsigc++-2.2.10 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "sigc++ build failed"
tar xf glibmm-2.32.0.tar.xz && \
    (set -e && cd glibmm-2.32.0 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "glibmm build failed"
tar xf cairomm-1.10.0.tar.gz && \
    (set -e && cd cairomm-1.10.0 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "cairomm build failed"
tar xf pangomm-2.28.4.tar.xz && \
    (set -e && cd pangomm-2.28.4 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "pangomm build failed"
tar xf atkmm-2.22.6.tar.xz && \
    (set -e && cd atkmm-2.22.6 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "atkmm build failed"

tar xf gtkmm-2.24.2.tar.xz && \
   (set -e && cd gtkmm-2.24.2 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX --disable-documentation && make && make install) || die "gtkmm build failed"
tar xf libart_lgpl-2.3.21.tar.bz2 && \
    (set -e && cd libart_lgpl-2.3.21 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "libart build failed"
tar xf libgnomecanvas-2.30.3.tar.bz2 && \
    (set -e && cd libgnomecanvas-2.30.3 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "gnomecanvas build failed"
tar xf libgnomecanvasmm-2.26.0.tar.bz2 && \
    (set -e && cd libgnomecanvasmm-2.26.0 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "gnomecanvasmm build failed"


tar xf liblo-0.26.tar.gz && \
    (set -e && cd liblo-0.26 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "liblo build failed"

tar xf raptor2-2.0.6.tar.gz && \
    (set -e && cd raptor2-2.0.6 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "raptor build failed"

tar xf rasqal-0.9.28.tar.gz && \
    (set -e && cd rasqal-0.9.28 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "rasqal build failed"

tar xf redland-1.0.15.tar.gz && \
    (set -e && cd redland-1.0.15 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "redland build failed"

tar xf libogg-1.3.0.tar.xz && \
    (set -e && cd libogg-1.3.0 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "ogg build failed"

# FLAC will not build correctly on OS X Lion with asm optimization enabled, so lets at least force SSE
if [ x$OSX != x ] ; then
    tar xf flac-1.2.1.tar.gz && \
        (set -e && cd flac-1.2.1 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX --disable-cpplibs --disable-asm-optimizations --enable-sse --disable-debug && make && make install) || die "flac build failed"
else
    tar xf flac-1.2.1.tar.gz && \
        (set -e && cd flac-1.2.1 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX --disable-cpplibs --disable-debug && make && make install) || die "flac build failed"
fi

tar xf libvorbis-1.3.2.tar.bz2 && \
    (set -e && cd libvorbis-1.3.2 && CXXFLAGS="$GLOBAL_CFLAGS" CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "vorbis build failed"

sndfile_patch=`ls $this_script_dir/misc-patches/libsndfile-1.0.25.patch`

if [ x$OSX != x ] ; then
    # sndfile-play incorrectly includes <Carbon.h> which no longer works on Lion
    tar xf libsndfile-1.0.25.tar.gz && \
        (set -e && cd libsndfile-1.0.25 && patch -p0 < $sndfile_patch && CFLAGS="$GLOBAL_CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX --disable-silent-rules && make && make install) || die "sndfile build failed"
    # samplerate incorrectly includes <Carbon.h> which no longer works on Lion
tar xf libsamplerate-0.1.8.tar.gz && \
    (set -e && cd libsamplerate-0.1.8 && CFLAGS="$GLOBAL_CFLAGS -I/System/Library/Frameworks/Carbon.framework/Headers" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "samplerate build failed"
else 
    tar xf libsndfile-1.0.25.tar.gz && \
        (set -e && cd libsndfile-1.0.25 && patch -p0 < $sndfile_patch && CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX --disable-silent-rules && make && make install) || die "sndfile build failed"
    tar xf libsamplerate-0.1.8.tar.gz && \
        (set -e && cd libsamplerate-0.1.8 && CFLAGS="$GLOBAL_CFLAGS" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && make install) || die "samplerate build failed"
fi

# aubio has an old version of install.sh which can exit with an error during parallel make install
# it also doesn't use pkg-config to test for FFTW3, sigh.
remove_fftw3_h=
if [ ! -f /usr/include/fftw3.h ] ; then
    remove_fftw3_h=y
    sudo ln -s $PREFIX/include/fftw3.h /usr/include
fi
tar xf aubio-0.3.2.tar.gz 
   (set -e && cd aubio-0.3.2 && sed '/no-long-double/d' < ./configure > ./configure.XXX && mv ./configure.XXX ./configure && chmod +x ./configure && \
       CFLAGS="$GLOBAL_CFLAGS -I$PREFIX" LDFLAGS="$GLOBAL_LDFLAGS" ./configure --prefix=$PREFIX && make && MAKEFLAGS=-j1 make install) || die "aubio build failed"
if [ x$remove_fftw3_h != x ] ; then
    sudo rm /usr/include/fftw3.h
fi

# these python lib wants to install to a system-wide location
tar xf rdflib-3.2.0.tar.gz && \
    (set -e && cd rdflib-3.2.0 && unset MACOSX_DEPLOYMENT_TARGET && python ./setup.py build && sudo python ./setup.py install)
tar xf setuptools-0.6c11.tar.gz && \
    (set -e && cd setuptools-0.6c11 && unset MACOSX_DEPLOYMENT_TARGET && python ./setup.py build && sudo python ./setup.py install)
tar xf isodate-0.4.0.tar.gz && \
    (set -e && cd isodate-0.4.0 && unset MACOSX_DEPLOYMENT_TARGET && python ./setup.py build && sudo python ./setup.py install)

(set -e && cd LRDF && \
  sed 's/glibtoolize/libtoolize/g' < autogen.sh > ag.sh && mv ag.sh autogen.sh && \
  CFLAGS="$GLOBAL_CFLAGS -I$PREFIX/include" LDFLAGS="$GLOBAL_LDFLAGS" sh ./autogen.sh --prefix=$PREFIX && make && make install) || die "LRDF build failed"

tar xf lv2-1.0.0.tar.bz2 && \
    (set -e && cd lv2-1.0.0 && unset MACOSX_DEPLOYMENT_TARGET && ./waf configure --prefix=$PREFIX --copy-headers && ./waf build && sudo ./waf install) || die "LV2 build failed"
tar xf serd-0.14.0.tar.bz2 && \
    (set -e && cd serd-0.14.0 && ./waf configure --prefix=$PREFIX && ./waf build && ./waf install) || die "serd build failed"
tar xf sord-0.8.0.tar.bz2 && \
    (set -e && cd sord-0.8.0 && ./waf configure --prefix=$PREFIX  && ./waf build && ./waf install) || die "sord build failed"
tar xf sratom-0.2.0.tar.bz2 && \
    (set -e && cd sratom-0.2.0 && ./waf configure --prefix=$PREFIX && ./waf build && ./waf install) || die "sratom build failed"
tar xf lilv-0.14.2.tar.bz2 && \
    (set -e && cd lilv-0.14.2 && ./waf configure --prefix=$PREFIX && ./waf build && ./waf install) || die "lilv build failed"
tar xf suil-0.6.0.tar.bz2 && \
    (set -e && cd suil-0.6.0 && CFLAGS="-I$PREFIX/include" ./waf configure --prefix=$PREFIX && ./waf && ./waf install) || die "suil build failed"

# two post-install hacks

if uname -a | grep --silent arwin ; then
    #
    # this is only needed on OS X where some Carbon headers define nil
    #
    cat <<EOFA | patch -d $PREFIX -p1
--- ../include/sigc++-2.0/sigc++/functors/functor_trait.h~
+++ ../include/sigc++-2.0/sigc++/functors/functor_trait.h
@@ -24,6 +24,9 @@
 #define _SIGC_FUNCTORS_MACROS_FUNCTOR_TRAITHM4_
 #include <sigc++/type_traits.h>
 
+#ifdef nil
+#undef nil
+#endif
 
 namespace sigc {
 
EOFA
fi

#
# libgnomecanvas has an incorrect pkg-config file. it has an implicit dependency on pangoft2.
#

cat <<EOFB | patch -d $PREFIX -p1
--- ../lib/pkgconfig/libgnomecanvas-2.0.pc~
+++ ../lib/pkgconfig/libgnomecanvas-2.0.pc
@@ -5,8 +5,8 @@
 
 Name: libgnomecanvas-2.0
 Description: libgnomecanvas
-Requires: libart-2.0 gtk+-2.0
-Requires.private: pango pangoft2 gail
+Requires: libart-2.0 gtk+-2.0 pangoft2
+Requires.private: pango gail
 Version: 2.30.3
 Libs: -L${libdir} -lgnomecanvas-2
 Cflags: -I${includedir}/libgnomecanvas-2.0

EOFB