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