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