]> git.donarmstrong.com Git - lilypond.git/blob - cygwin/mknetrel
Bugfix: copy aclocal.m4, autogen.sh also if
[lilypond.git] / cygwin / mknetrel
1 # -*- shell-script -*-
2
3 # ancient LilyPond releases: lilypond-1.6
4 # archive=ftp://lilypond.org/pub/LilyPond/v1.6
5
6 # stable LilyPond releases: lilypond-1.8
7 # archive=ftp://lilypond.org/pub/LilyPond/v1.8
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.8/lilypond-1.8.0.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 # copy and include extra mknetrel stuff
40 extras="doc patch auto cross split"
41 for i in $extras; do
42     f=mknetrel.$i
43     [ -r $extra/$f ] && cp -pv $extra/$f $src/cygwin/$f
44     . $src/cygwin/$f
45 done
46
47
48 needdevoflags () {
49     return 1
50 }
51
52
53 preconfig () { # aka libtool_woes ()
54
55     # Add to mknetrel?
56     patchsrc 
57
58     ## autoupdate
59
60     cd $build || exit 1
61
62     GUILE=1.6.4
63     cat > guile-config <<EOF
64 [ "\$1" == "--version" ] && echo "guile-config - Guile version $GUILE"
65 [ "\$1" == "compile" ] && echo "-I$cygwin_prefix/include"
66 [ "\$1" == "link" ] && echo "-L$cygwin_prefix/lib -lguile"
67 exit 0
68 EOF
69     chmod 755 guile-config
70     PATH=$(pwd):$PATH
71
72     export CFLAGS="-fpermissive"
73     if [ "$ABI" != "1.5" ];then
74         export LDFLAGS="$cygwin_prefix/bin/cygkpathsea-3abi13.dll"
75     fi
76     ##opt='-O2 -g' LDFLAGS='"$cygwin_prefix/bin/libpython2.2.dll"
77     rm -f config.cache
78 }
79
80 postconfig () {
81     # Configure for build, for generating doc
82     rm -f config.cache
83     export HOST_CC=gcc
84     export HOST_CXX=g++
85     if [ "$ABI" != "1.5" ]; then
86         HOST_CC=gcc-2.95
87         HOST_CXX=g++-2.95
88         (cd $src && ln -s GNUmakefile.in GNUmakefile)
89     fi
90     (PATH="$old_path" \
91         PATH="$HOME/usr/pkg/guile-1.6/bin:$PATH" \
92         CFLAGS="-O2 -g" \
93         CC=$HOST_CC \
94         CXX=$HOST_CXX \
95         $src/configure --prefix=/usr --enable-config=for-build)
96 }
97
98 prebuild () {
99     for i in $sub_packages; do
100         rm -rf $inst-$i
101         mkdir -p $inst-$i || exit 1
102     done
103     
104     # Build for build, generating doc
105     cd $build || exit 1
106     
107     #PATH=/bin:/usr/bin:$PATH make conf=for-build all doc html-doc || exit 1
108     PATH=/bin:/usr/bin:$PATH make conf=for-build all doc web || exit 1
109     for i in $(find . -path "out-for-build/*.1"); do
110         cp -pv $i $(dirname $(dirname $i))/$(basename $i)
111     done
112
113     mkdir -p mf/out
114     cp -pv mf/out-for-build/* mf/out
115     
116     if false; then #[ "$ABI" != "1.5" ]; then
117         addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.2.dll" ' ' 'target=i686-pc-cygwin'
118     else
119         addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.3.dll" ' ' 'target=i686-pc-cygwin'
120     fi
121 }
122
123 preinstall () {
124     cd $build || exit 1
125     cp -v scripts/out-for-build/midi2ly.1 scripts/out
126     cp -v lily/out-for-build/lilypond.1 lily/out
127     
128     if false; then # [ "$ABI" != "1.5" ]; then
129         addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.2.dll" ' ' 'target=i686-pc-cygwin'
130     else
131         addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.3.dll" ' ' 'target=i686-pc-cygwin'
132     fi
133 }
134
135 postinstall () {
136     fixdoc
137     
138     mkdir -p $inst-doc/$docprefix
139     cd $build || exit 1
140     
141     make conf=for-build webdir=$inst-doc/$packagedocdir web-install
142
143     ## copy READMEs etc
144
145     cd $src || exit 1
146     install -d -m755 $inst/$packagedocdir
147
148     ## Generic READMEs
149     find . -maxdepth 1 -type f -exec cp -pv \{\} $inst/$packagedocdir \;
150
151     ## Cygwin readmes
152     cygwin=cygwin
153     cd $src || exit 1
154     install -m644 $cygwin/changelog $inst/$cygdocdir/changelog.Cygwin
155     install -d -m755 $inst/$prefix/doc/Cygwin
156     #install -m644 $cygwin/README $inst/$cygdocdir/Cygwin/$package.README
157
158     cd $build || exit 1
159     install -m644 $cygwin/out/README $inst/$packagedocdir/README.Cygwin
160     install -m644 $cygwin/out/README $inst/$cygdocdir/$package.README
161
162     ## copy examples
163     cd $src || exit 1
164     cp -prv input $inst/$packagedocdir
165
166     cd $inst-doc/$packagedocdir &&
167     ln -s $(find html/Documentation -name '*.ps.gz') .
168 }
169