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