]> git.donarmstrong.com Git - lilypond.git/blob - cygwin/mknetrel
* lilypond.words, ly/engraver-init.ly, ly/params-init.ly: added
[lilypond.git] / cygwin / mknetrel
1 # -*- shell-script -*-
2
3 # stable LilyPond releases: lilypond-1.6
4 # archive=ftp://lilypond.org/pub/LilyPond/v1.6
5
6 # LilyPond development: lilypond-1.7
7 # archive=ftp://lilypond.org/pub/LilyPond/v1.7
8
9 # LilyPond mknetrel overrides
10 # To use this, do something like:
11 cat >/dev/null <<EOC
12
13    wget -P/var/tmp ftp://lilypond.org/pub/LilyPond/v1.7/lilypond-1.7.29.tar.gz
14    rm -rf /home/netrel/src/lilypond-*
15    mkdir -p /home/netrel/src && cd /home/netrel/src
16    ## TODO: look at pimport
17    tar xzf /var/tmp/lilypond-*
18    mv lilypond-* $(echo lilypond-*)-1
19    cd -
20    ./bin/mknetrel -xXC lilypond
21
22 EOC
23
24 # sover=14
25
26 patch=$mknetrel_root/patch
27 if iscygwin; then
28     true
29 else 
30     uploads=$here/uploads/$base && mkdir -p $uploads/
31     [ "$ABI" = "1.5" ] && uploads=$here/uploads-development/$base && mkdir -p $uploads/
32     tarstem=$uploads/$package
33 fi
34
35 sub_packages="doc"
36 old_path=$PATH
37
38
39
40 ##. $extra/jcn
41
42
43 # -*- shell-script -*-
44
45 # jcn -- unsorted stuff
46
47
48 #
49 # Patching and configuring
50 #
51
52 presplit () { true; }
53
54 # Maybe add to mknetrel or pimport.
55 dopatchsrc () {
56     cd $src
57     patch -p1 < $patch/$package.patch
58     [ -d cygwin -a ! -e CYGWIN-PATCHES ] && ln -s cygwin CYGWIN-PATCHES
59     [ -d CYGWIN-PATCHES -a ! -e cygwin ] && ln -s CYGWIN-PATCHES cygwin
60     [ -d CYGWIN-PATCHES ] || mkdir CYGWIN-PATCHES
61 }
62
63 # Maybe add to mknetrel or pimport.
64 patchsrc () {
65     [ -r $patch/$package.patch -a ! -r $src/CYGWIN-PATCHES -a ! -r $src/cygwin ] && dopatchsrc
66 }
67
68 autoupdate () {
69     for i in bootstrap autogen.sh; do
70         if [ -x ./$i ]; then
71             ./$i || exit 1
72             return 0
73         fi
74     done
75     
76     aclocal
77     rm -rf libltdl
78     libtoolize --force --copy --automake --ltdl
79     autoheader
80     autoconf
81     automake --add-missing
82 }
83
84 crosscache () {
85         cat <<EOF > config.cache
86
87 ac_cv_c_bigendian=${ac_cv_c_bigendian=no}
88 ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
89 ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4}
90 ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
91 ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
92 ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
93 ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
94 ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=12}
95 ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
96 ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
97 ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
98 ac_cv_c_long_size_t=${ac_cv_c_long_size_t=no}
99 ac_cv_c_long_time_t=${ac_cv_c_long_time_t=yes}
100 ac_16bit_type=${ac_16bit_type=short}
101 ac_32bit_type=${ac_32bit_type=int}
102 ac_64bit_type=${ac_64bit_type=none}
103 ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls=no}
104 ac_cv_sprintf_count=${ac_cv_sprintf_count=yes}
105 ac_cv_spinlocks=${ac_cv_spinlocks=no}
106 ac_cv_func_getpgrp_void=${ac_cv_func_getpgrp_void=yes}
107 ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
108 ac_cv_func_mkfifo=yes
109
110 # Try at preventing to break make rules while crosscompiling.  This
111 # used work, but nowadays ./configure thinks it knows better than me.
112
113 # But what ./configure doesn't know, is that automake and libtool are
114 # broken wrt cross-building, and wrt cc_for_build.  See new
115 # workarounds above.
116
117 ac_exeext=${ac_exeext=}
118 ac_cv_exeext=${ac_cv_exeext=}
119 EOF
120 }
121
122
123
124 #
125 # Subpackage stuff -- Maybe move to mknetrel
126 #
127
128 # Possibly, using file-lists globs is smarter than separate install
129 # prefixes.  We'll see what happens when packaging tetex-*.
130
131
132 lib_name () {
133     echo lib$base$sover
134 }
135
136 devel_name () {
137     echo $base-devel
138 }
139
140 doc_name () {
141     echo $base-doc
142 }
143
144 lib_split () {
145     mkdir -p ./$prefix/bin || exit 1
146     mv $inst/$prefix/bin/*.dll ./$prefix/bin
147     mkdir -p ./$prefix/share || exit 1
148     mv $inst/$prefix/share/$base ./$prefix/share
149     true
150 }
151    
152 devel_split () {
153     mkdir -p ./$prefix/bin || exit 1
154     mv $inst/$prefix/include ./$prefix/include
155     mkdir -p ./$prefix/lib || exit 1
156     mv $inst/$prefix/lib/*.a ./$prefix/lib
157     mkdir -p ./$prefix/lib || exit 1
158     mv $inst/$prefix/lib/*.la ./$prefix/lib
159     mkdir -p ./$prefix/share || exit 1
160     mv $inst/$prefix/share/aclocal ./$prefix/share
161     true
162 }
163
164 doc_split () {
165     mkdir -p ./$prefix || exit 1
166     mv $inst/$prefix/info ./$prefix
167     true
168 }
169
170 prebuild () {
171     for i in $sub_packages; do
172         rm -rf $inst-$i
173         mkdir -p $inst-$i || exit 1
174     done
175 }
176     
177 domkdist() {
178     #
179     # Fix up installation slightly
180     #
181     cd $inst || exit 1
182     chmod -R a+w .
183     cd usr 2>/dev/null && dousrstuff
184
185
186     # Split off any sub-packages.  The actual splitting is handled by
187     # a package's specific code in extra/.
188
189     # To package `foo' in foo, foo-doc and foo-devel, set
190     # sub_packages='doc devel'.
191
192     # Then provide functions doc_name and devel_name, that return the
193     # full name of the sub-package.  Also provide functions doc_split
194     # and devel_split, that mv part of foo's installation in $inst to
195     # the sub-packages' installation roots $inst-doc and $inst-devel.
196
197     cd $inst || exit 1
198     presplit
199
200     for i in $sub_packages; do
201         subname=$(${i}_name)
202         cd $inst-$i || exit 1
203         ${i}_split || exit 1
204     done
205     
206     #
207     # Make tar balls
208     #
209
210     cd $inst || exit 1
211     prepackage
212
213     # The base package
214     echo creating $tarstem.tar.bz2
215     cd $inst || exit 1
216
217     f=$src/cygwin/setup.hint && test -r $f && cp $f $uploads
218     f=$src/cygwin/$base.hint && test -r $f && cp $f $uploads/setup.hint
219     find * -print | sort | tar -T - --no-recursion -cjf $tarstem.tar.bz2
220
221     # Any sub-packages
222     for i in $sub_packages; do
223         subname=$(${i}_name)
224         subload=$uploads/$subname
225         subtarstem=$subload/$subname-$ver
226         mkdir -p $subload || exit 1
227         echo creating $subtarstem.tar.bz2
228         f=$src/cygwin/$subname.hint && test -r $f && cp $f $subload/setup.hint
229         cd $inst-$i
230         find * -print | sort | tar -T - --no-recursion -cjf $subtarstem.tar.bz2
231     done
232
233     # The source package
234     cd $src/.. || exit 1
235     echo creating "$tarstem"-src.tar.bz2
236     find $package_src/* -print -follow | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|~$|^.#|CVS|%redact|/tags$' | egrep -v "$src_exclude" | sort | tar -T - --no-recursion -cjf "$tarstem"-src.tar.bz2
237     postpackage
238 }
239
240
241 # end jcn
242
243
244
245
246 needdevoflags () {
247     return 1
248 }
249
250
251 preconfig () { # aka libtool_woes ()
252
253     # Add to mknetrel?
254     patchsrc 
255
256     ## autoupdate
257
258     cd $build || exit 1
259
260     GUILE=1.6.4
261     cat > guile-config <<EOF
262 [ "\$1" == "--version" ] && echo "guile-config - Guile version $GUILE"
263 [ "\$1" == "compile" ] && echo "-I$cygwin_prefix/include"
264 [ "\$1" == "link" ] && echo "-L$cygwin_prefix/lib -lguile"
265 exit 0
266 EOF
267     chmod 755 guile-config
268     PATH=$(pwd):$PATH
269
270     ##opt='-O2 -g' LDFLAGS='"$cygwin_prefix/bin/libpython2.2.dll"
271     rm -f config.cache
272 }
273
274 postconfig () {
275     # Configure for build, for generating doc
276     rm -f config.cache
277     export HOST_CC=gcc
278     export HOST_CXX=g++
279     if [ "$ABI" != "1.5" ]; then
280         HOST_CC=gcc-2.95
281         HOST_CXX=g++-2.95
282         (cd $src && ln -s GNUmakefile.in GNUmakefile)
283     fi
284     (PATH="$old_path" \
285         PATH="$HOME/usr/pkg/guile-1.6/bin:$PATH" \
286         CFLAGS="-O2 -g" \
287         CC=$HOST_CC \
288         CXX=$HOST_CXX \
289         $src/configure --prefix=/usr --enable-config=for-build)
290 }
291
292 prebuild () {
293     for i in $sub_packages; do
294         rm -rf $inst-$i
295         mkdir -p $inst-$i || exit 1
296     done
297     
298     # Build for build, generating doc
299     cd $build || exit 1
300     
301     #PATH=/bin:/usr/bin:$PATH make conf=for-build all doc html-doc || exit 1
302     PATH=/bin:/usr/bin:$PATH make conf=for-build all doc web || exit 1
303     for i in $(find . -path "out-for-build/*.1"); do
304         cp -pv $i $(dirname $(dirname $i))/$(basename $i)
305     done
306
307     mkdir -p mf/out
308     cp -pv mf/out-for-build/* mf/out
309     
310     addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.2.dll" ' ' 'target=i686-pc-cygwin'
311 }
312
313 preinstall () {
314     cd $build || exit 1
315     cp -v scripts/out-for-build/midi2ly.1 scripts/out
316     cp -v lily/out-for-build/lilypond.1 lily/out
317     
318     addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.2.dll" ' ' 'target=i686-pc-cygwin'
319 }
320
321 postinstall () {
322     mkdir -p $inst-doc/$prefix
323     cd $build || exit 1
324     docdir=$prefix/share/doc/$base-$ver
325     
326     #make conf=for-build docdir=$inst-doc/$docdir install-html-doc
327     make conf=for-build webdir=$inst-doc/$docdir web-install
328
329
330     ## copy READMEs etc
331
332     cd $src || exit 1
333     install -d -m755 $inst/$docdir
334
335     ## Generic READMEs
336     find . -maxdepth 1 -type f -exec cp -pv \{\} $inst/$docdir \;
337
338     ## Cygwin readmes
339     cygwin=cygwin
340     cd $src || exit 1
341     #install -m644 $cygwin/README $inst/$docdir/README.Cygwin
342     install -m644 $cygwin/changelog $inst/$docdir/changelog.Cygwin
343     install -d -m755 $inst/$prefix/doc/Cygwin
344     #install -m644 $cygwin/README $inst/$prefix/doc/Cygwin/$package.README
345
346     cd $build || exit 1
347     install -m644 $cygwin/out/README $inst/$docdir/README.Cygwin
348     install -m644 $cygwin/out/README $inst/$prefix/doc/Cygwin/$package.README
349
350     ## copy examples
351     cd $src || exit 1
352     cp -prv input $inst/$docdir
353
354     cd $inst-doc/$prefix/share/doc/$base-$ver &&
355     ln -s $(find html/Documentation -name '*.ps.gz') .
356
357     ## Cygwin doesn't adhere to FHS (and why should they?)
358     cd $inst/$prefix/share && tar cf - doc | (cd ..; tar xf -) && rm -rf doc
359     cd $inst-doc/$prefix/share && tar cf - doc | (cd ..; tar xf -) && rm -rf doc
360 }
361
362 #presplit () {
363 #    docdir=$prefix/share/doc/$base-$ver
364 #    mkdir -p $inst-doc/$docdir || exit 1
365 #}
366
367 doc_split () {
368     mkdir -p ./$prefix || exit 1
369     mv $inst/$prefix/info ./$prefix
370     true
371 }
372
373
374 #prepackage () {
375 #  mv $inst/$prefix/bin/guile-* $inst-devel/$prefix/bin
376 #}