]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/guile-gnome.sh
* scm/output-svg.scm:
[lilypond.git] / buildscripts / guile-gnome.sh
1 #!@BASH@
2
3 # guile-gnome.sh -- download, compile, install g-wrap, guile-gnome,
4 # pango
5
6 # LilyPond has an experimental gnome canvas output backend -- hackers
7 # only.  This depends on rather new versions of guile-gnome, g-wrap
8 # and pango.
9
10 set -ex
11
12 # Where user built stuff will be installed
13 OPT=$HOME/usr/pkg
14 # When using GUILE CVS, make a slib/require like so
15 cat > /dev/null <<EOF
16 cd ~/usr/pkg/guile/share/guile/1.7 && ln -s /usr/share/guile/1.6/slib .
17 cd && guile -c "(use-modules (ice-9 slib)) (require 'new-catalog)"
18 EOF
19 # otherwise, this may fix it...
20 SLIB_PATH=`locate slib/require.scm | head -1 | sed -s 's/require.scm//g'`
21
22 # What extra modules to pull (eg: EXTRA="libgnomecanvas libwnck")
23 EXTRA=${EXTRA-libgnomecanvas}
24 PANGOVERSION=1.6.0
25 GGVERSION=2.7.97
26 GWRAPVERSION=1.9.3
27
28 download=$HOME/usr/src/releases
29 [ -d $download ] || mkdir -p $download
30 WGET="wget -N -P $download"
31
32 export AUTOMAKE=automake-1.8
33 export ACLOCAL=aclocal-1.8
34 export AUTOCONF=$(which autoconf2.50)
35 export AUTOHEADER=$(which autoheader2.50)
36
37 export PKG_CONFIG_PATH
38 export LD_LIBRARY_PATH
39 export GUILE_LOAD_PATH
40
41 if [ -z "$AUTOCONF" ]; then
42     unset AUTOCONF
43 fi
44 if [ -z "$AUTOHEADER" ]; then
45     unset AUTOHEADER
46 fi
47
48
49 # test: the name of our download and build directory
50 rm -rf test
51 mkdir -p test
52 cd test
53
54 ## 1.  install gnome-devel
55 ##     - Debian/unstable: apt-get install gnome-devel
56 ##     - ...
57
58 ## 2.  get pango CVS
59
60 PKG_CONFIG_PATH=$OPT/pango/lib/pkgconfig:$PKG_CONFIG_PATH
61 LD_LIBRARY_PATH=$OPT/pango/lib:$LD_LIBRARY_PATH
62
63 mkdir -p gnome/CVS
64 if ! pkg-config --atleast-version=1.5.1 pango; then
65     cd gnome
66     if [ -n "$BLOEDIGE_RAND" ]; then
67         echo ":pserver:anonymous@anoncvs.gnome.org:/cvs/gnome" > CVS/Root
68         echo "." > CVS/Repository
69         cvs -z3 checkout -P pango
70     else
71         $WGET ftp://ftp.gtk.org/pub/gtk/v2.6/pango-$PANGOVERSION.tar.gz
72         tar -xzf $download/pango-$PANGOVERSION.tar.gz
73         ln -s pango-$PANGOVERSION pango
74     fi
75     cd pango
76     rm -rf $OPT/pango
77     if [ ! -f configure ]; then
78         ./autogen.sh --help
79     fi
80     ./configure --prefix=$OPT/pango --enable-maintainer-mode --enable-gtk-doc
81     make XFT_LIBS="-L/usr/lib -lXft -L/usr/X11R6/lib -lfreetype -lz -lXrender -lX11 -lfontconfig" all install
82     cd ../..
83 fi
84
85 ## 3. Currently (2004-9-15) GUILE CVS works somewhat
86 ##    But there's a guile/g-wrap problem with integer parameters
87 unset GUILE_LOAD_PATH
88 PATH=/usr/bin:$PATH
89
90 if [ -d $OPT/libffi/ ]; then
91     export LDFLAGS=-L$OPT/libffi/lib
92     export CPPFLAGS=-I$OPT/libffi/include
93 fi
94
95 PKG_CONFIG_PATH=$OPT/g-wrap/lib/pkgconfig:$PKG_CONFIG_PATH
96 LD_LIBRARY_PATH=$OPT/g-wrap/lib:$LD_LIBRARY_PATH
97 GUILE_LOAD_PATH=$OPT/g-wrap/share/guile/site:$GUILE_LOAD_PATH:$SLIB_PATH
98
99
100 ## 4.  get g-wrap 2.0
101 ## note that bleeding edge (2004-9-13) g-wrap breaks guile-gnome.
102 if ! pkg-config --atleast-version=$GWRAPVERSION g-wrap-2.0-guile; then
103     if [ -n "$BLOEDIGE_RAND" ]; then
104         tla register-archive a.rottmann@gmx.at--2004-main \
105             http://people.debian.org/~rotty/arch/a.rottmann@gmx.at/2004-main || true
106
107         ## tla get a.rottmann@gmx.at--2004-main/g-wrap--tng g-wrap
108         ## tla get a.rottmann@gmx.at--2004-main/g-wrap--mainline--1.9.0 g-wrap
109         tla get a.rottmann@gmx.at--2004-main/g-wrap--dev--0 g-wrap
110         ## ughr:
111         mkdir -p g-wrap/libffi
112     else
113         $WGET http://savannah.nongnu.org/download/g-wrap/g-wrap-$GWRAPVERSION.tar.gz
114         tar xzf $download/g-wrap-$GWRAPVERSION.tar.gz
115         ln -s g-wrap-$GWRAPVERSION g-wrap
116     fi
117     cd g-wrap
118     
119     rm -rf $OPT/g-wrap
120     if [ ! -f configure ]; then
121         sh autogen.sh --noconfigure
122     fi    
123     mkdir =build
124     cd =build
125     ../configure --prefix=$OPT/g-wrap --enable-maintainer-mode
126     make install
127     cd ../..
128 fi    
129
130
131 # not a good idea
132 ## cp srfi-34.scm from CVS head ?  --hwn
133 #(cd $OPT/g-wrap/share/guile/site
134 # mv srfi-34.scm srfi-34.scm-g-wrap
135 # cp $OPT/guile/share/guile-1.7/srfi/srfi-34.scm .)
136
137 PKG_CONFIG_PATH=$OPT/guile-gnome/lib/pkgconfig:$PKG_CONFIG_PATH
138 LD_LIBRARY_PATH=$OPT/guile-gnome/lib:$LD_LIBRARY_PATH
139 GUILE_LOAD_PATH=$OPT/guile-gnome/share/guile:$GUILE_LOAD_PATH
140 ## 5.  get guile-gnome
141 if ! pkg-config --atleast-version=$GGVERSION guile-gnome-glib; then
142     if [ -n "$BLOEDIGE_RAND" ]; then
143
144         if false; then # rotty
145             tla register-archive guile-gnome-devel@gnu.org--2004 \
146                 http://people.debian.org/~rotty/arch/guile-gnome-devel@gnu.org/2004/ || true
147             tla get guile-gnome-devel@gnu.org--2004/dists--dev guile-gnome
148             cd guile-gnome
149             tla build-config -r configs/gnu.org/dev
150             cd src
151
152             # 5a.  get extra modules (gnome canvas)
153             for i in $EXTRA; do
154                 tla get guile-gnome-devel@gnu.org--2004/$i--dev $i
155             done
156         else # andy
157             tla register-archive wingo@pobox.com--2004-main \
158                 http://ambient.2y.net/wingo/arch/wingo@pobox.com--2004-main || true
159             
160             tla get wingo@pobox.com--2004-main/guile-gnome-dists--release guile-gnome
161             cd guile-gnome
162             tla build-config -r configs/gnu.org/guile-gnome-platform-$GGVERSION
163             cd src
164             EXTRA="pkg atk defs glib gstreamer gtk gtksourceview libgda libglade libgnome libgnomeui pango libgnomecanvas"
165             EXTRA=
166
167             # 5a.  get extra modules (gnome canvas)
168             for i in $EXTRA; do
169                 tla get wingo@pobox.com--2004-main/guile-gnome-$i--release $i
170             done
171
172             cd libgnomecanvas
173             cd ..
174         fi
175
176         if [ ! -f configure ]; then
177             sh autogen.sh --noconfigure
178         fi
179         cd ..
180         srcdir="../src"
181     else
182         $WGET http://download.gna.org/guile-gnome/releases/guile-gnome-platform-$GGVERSION.tar.gz
183         tar xzf $download/guile-gnome-platform-$GGVERSION.tar.gz
184         ln -s guile-gnome-platform-$GGVERSION guile-gnome
185         cd guile-gnome
186         srcdir="../"
187     fi
188     
189     rm -rf $OPT/guile-gnome
190     mkdir =build
191     cd =build
192
193 # Using libtool < 1.6.0 together with gcc-3.4 may trigger this problem:
194 #
195 #    If a tag has not been given, and we're using a compiler which is
196 #    not one of the ones with which libtool was built, attempt to
197 #    infer the compiler from the first word of the command line passed
198 #    to libtool.
199 #
200     if [ -z "$GCC34" ]; then
201     # Use libtool-1.5.6, gcc-3.{2,3} without -O2,
202         CFLAGS='-O -g' $srcdir/configure --prefix=$OPT/guile-gnome --enable-maintainer-mode
203     else
204     # or use gcc-3.4 with libtool-1.6.0
205         CC=$GCC34 $srcdir/configure --prefix=$OPT/guile-gnome --enable-maintainer-mode
206     fi
207     make all install G_WRAP_MODULE_DIR=$OPT/g-wrap/share/guile/site
208 fi
209
210 cat <<EOF
211 ***********************************************************************
212 Before using with Lily, do
213
214     export LD_LIBRARY_PATH=$LD_LIBRARY_PATH
215     export GUILE_LOAD_PATH=$GUILE_LOAD_PATH
216 EOF
217
218 # simple test -- fails atm
219 # guile -s ../src/libgnomecanvas/examples/canvas.scm
220