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