]> git.donarmstrong.com Git - lilypond.git/blob - buildscripts/guile-gnome.sh
72806075f9a9c616900ef55b77105c7c44b8feaf
[lilypond.git] / buildscripts / guile-gnome.sh
1 #!@BASH@
2 # guile-gnome.sh -- download, compile, install g-wrap, guile-gnome TLA and
3 # pango CVS
4
5 # LilyPond has an experimental gnome canvas output backend -- hackers
6 # only.  This depends on unreleased version of guile-gnome, which
7 # depends on an unreleased, forked version of g-wrap.  We also need
8 # pango CVS > 2004-06-12
9
10 # Note: this install information is volatile, you'll probably want to
11 # pull all from from guile-gnome-devel@gnu.org--2004 soon.
12
13 set -ex
14
15 # Where user built stuff will be installed
16 OPT=$HOME/usr/pkg
17
18 if [ -x /usr/bin/gcc34 ] ;then
19     export GCC=gcc34
20 fi
21
22 if [ -x /usr/bin/gcc-3.4 ] ;then
23     export GCC=gcc-3.4
24 fi
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 MY_LIBTOOL=$(dpkg -l libtool | tail -1 | awk '{ print $3 }')
32 PANGO_LIBTOOL=1.5.6-1
33
34 # Please state your love for the autotools today
35 if [ -z "$I_LOVE_AUTOTOOLS" ]; then
36     I_LOVE_AUTOTOOLS=no
37 else
38     I_LOVE_AUTOTOOLS=yes
39 fi
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 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
61 mkdir -p gnome/CVS
62 cd gnome
63 echo ":pserver:anonymous@anoncvs.gnome.org:/cvs/gnome" > CVS/Root
64 echo "." > CVS/Repository
65 cvs -z3 checkout -P pango
66 cd pango
67 rm -rf $OPT/pango
68 if [ "$I_LOVE_AUTOTOOLS" = "no" ]; then
69     sudo apt-get --yes --force-yes install libtool=$PANGO_LIBTOOL
70 fi    
71 ./autogen.sh --help
72 ./configure --prefix=$OPT/pango --enable-maintainer-mode --enable-gtk-doc
73 make XFT_LIBS="-L/usr/lib -lXft -L/usr/X11R6/lib -lfreetype -lz -lXrender -lX11 -lfontconfig" install
74 if [ "$I_LOVE_AUTOTOOLS" = "no" ]; then
75     sudo apt-get --yes --force-yes install libtool=$MY_LIBTOOL
76 fi    
77
78 cd ../..
79
80 export PKG_CONFIG_PATH=$OPT/pango/lib/pkgconfig:$PKG_CONFIG_PATH
81
82
83 ## 3.  *** NOTE: use guile-1.6 for g-wrap and guile-gnome ***
84 ## using GUILE CVS g-wrap/guile-gnome is experimental (read: segfaults)
85 ## Assuming that system has guile-1.6 installed in /usr/bin 
86 PATH=/usr/bin:$PATH
87
88 if [ -d $OPT/libffi/ ]; then
89     export LDFLAGS=-L$OPT/libffi/lib
90     export CPPFLAGS=-I$OPT/libffi/include
91 fi
92
93 ## 4.  get g-wrap 2.0
94 tla register-archive a.rottmann@gmx.at--2004-main \
95     http://people.debian.org/~rotty/arch/a.rottmann@gmx.at/2004-main || true
96
97 rm -rf g-wrap
98 if true; then
99     ## pull latest g-wrap from janneke -- this step is probably no longer
100     ## necessary when you read this
101     tla register-archive janneke@gnu.org--2004-gnome \
102         http://lilypond.org/~janneke/{arch}/2004-gnome || true
103     tla get janneke@gnu.org--2004-gnome/g-wrap--janneke g-wrap
104 else
105     ## tla get a.rottmann@gmx.at--2004-main/g-wrap--tng g-wrap
106     tla get a.rottmann@gmx.at--2004-main/g-wrap--mainline--1.9.0 g-wrap
107 fi
108 cd g-wrap
109
110 rm -rf $OPT/g-wrap
111 sh autogen.sh --noconfigure
112 mkdir =build
113 cd =build
114 ../configure --prefix=$OPT/g-wrap
115 make install
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 cd ../..
124
125 ## 5.  get guile-gnome
126 tla register-archive guile-gnome-devel@gnu.org--2004 \
127     http://people.debian.org/~rotty/arch/guile-gnome-devel@gnu.org/2004/ || true
128 rm -rf guile-gnome
129 tla get guile-gnome-devel@gnu.org--2004/dists--dev guile-gnome
130 cd guile-gnome
131 tla build-config -r configs/gnu.org/dev
132 cd src
133
134 ## 6.  get the gnome canvas module
135 tla get guile-gnome-devel@gnu.org--2004/libgnomecanvas--dev libgnomecanvas
136
137 rm -rf $OPT/guile-gnome
138 if false; then
139     libtoolize --copy --force
140     $AUTOHEADER
141     $ACLOCAL
142     $AUTOMAKE --copy --force
143     $AUTOCONF
144 fi
145 sh autogen.sh --noconfigure
146 mkdir ../=build
147 cd ../=build
148
149 export GUILE_LOAD_PATH=$OPT/g-wrap/share/guile/site:$GUILE_LOAD_PATH
150 export LD_LIBRARY_PATH=$OPT/g-wrap/lib:$LD_LIBRARY_PATH
151 PKG_CONFIG_PATH=$OPT/g-wrap/lib/pkgconfig:$PKG_CONFIG_PATH
152
153 ../src/configure --prefix=$OPT/guile-gnome
154
155 # Using libtool < 1.6.0 together with gcc-3.4 may trigger this problem:
156 #
157 #    If a tag has not been given, and we're using a compiler which is
158 #    not one of the ones with which libtool was built, attempt to
159 #    infer the compiler from the first word of the command line passed
160 #    to libtool.
161 #
162 # Use gcc-3.3 or libtool-1.6.0
163 make install CC=$GCC G_WRAP_MODULE_DIR=$OPT/g-wrap/share/guile/site
164
165 GUILE_LOAD_PATH=$OPT/guile-gnome/share/guile:$GUILE_LOAD_PATH
166 LD_LIBRARY_PATH=$OPT/guile-gnome/lib:$LD_LIBRARY_PATH
167
168 # simple test
169 guile -s ../src/libgnomecanvas/examples/canvas.scm