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