]> git.donarmstrong.com Git - lilypond.git/blob - cygwin/mknetrel
Remove duplicate cindex entries.
[lilypond.git] / cygwin / mknetrel
1 # -*- shell-script -*-
2 # cygwin/mknetrel - LilyPond mknetrel overrides
3
4 # This script should be used to package LilyPond for Cygwin.
5 # It can be used to build LilyPond on Cygwin, but also on GNU/Linux.
6 #
7 # See http://lilypond.org/web/devel/packaging.html for more information,
8 # report bugs to bug-lilypond@gnu.org.
9 #
10 # To build the package, do:
11 cat >/dev/null <<EOC
12
13    cd /
14    cvs -d:pserver:anoncvs@sources.redhat.com:/cvs/cygwin-apps co -d netrel mknetrel
15    wget -P/var/tmp ftp://lilypond.org/pub/LilyPond/v1.9/lilypond-1.9.9.tar.gz
16    mkdir -p /netrel/src && cd /netrel/src
17    rm -rf /netrel/src/lilypond-*
18    tar xzf /var/tmp/lilypond-*
19    mv lilypond-1.9.9 lilypond-1.9.9-1
20    cp lilypond-1.9.9-1/cygwin/mknetrel /netrel/extra/lilypond
21    /netrel/bin/mknetrel -xX lilypond
22
23 EOC
24
25 sub_packages="doc"
26 old_path=$PATH
27
28 patch=$mknetrel_root/patch
29
30 # for cross-compiling LilyPond:
31 if ! iscygwin; then
32     uploads=$here/uploads/$base && mkdir -p $uploads/
33     tarstem=$uploads/$package
34 fi
35
36 # copy and include extra mknetrel stuff
37 extras="doc patch auto cross split"
38 for i in $extras; do
39     f=mknetrel.$i
40     [ -r $extra/$f ] && cp -pv $extra/$f $src/cygwin/$f
41     . $src/cygwin/$f
42 done
43
44
45 needdevoflags () {
46     false
47 }
48
49 fix_libtool_script () {
50     cd $build || exit 1
51
52     # Fix libtool's -rpath detection
53     export CC="${build_cc}"
54     export CXX="${build_cxx}"
55     export DLLTOOL=${build_dlltool}
56     export OBJDUMP=${build_objdump}
57     export AS="${build_as}"
58     export HOST_CC=/usr/bin/gcc
59     export allow_undefined="yes"
60     export allow_undefined_flag=""
61     
62     # fix libtool's dlltool usage
63     mv libtool libtool.orig
64     sed -e 's/^DLLTOOL="dlltool"/DLLTOOL="i686-cygwin-dlltool"/' \
65         -e 's/^DLLTOOL=/HOST_CC=gcc\nDLLTOOL=/' \
66         -e 's/^HOST_CC=/SED=sed\nHOST_CC=/' < libtool.orig > libtool
67     chmod +x libtool
68 }
69
70 fix_libtool_la () {
71     # fix libtool's .la dependency_libs output for dlopen
72     for i in $inst/lib $inst/$prefix/lib ]; do
73         if [ -d $i ]; then
74             cd $i || exit 1
75             for j in $(ls -1 *la); do
76                 mv $j .libtool-$j
77                 sed -e 's/ *-L *[^ ][^ ]*//g' .libtool-$j > $j
78                 chmod +x $j
79             done
80         fi
81     done
82 }
83
84 preconfig () {
85
86     patchsrc 
87     rm -f config.cache
88
89     cd $src
90     if [ ! -x ./configure ]; then
91         ./autogen.sh --noconfigure
92     fi
93
94     cd $build
95     # for cross-compiling LilyPond, fake a guile-config
96     if ! iscygwin; then
97         cd $build || exit 1
98         GUILE=1.6.5
99         cat > i686-cygwin-guile-config <<EOF
100 [ "\$1" == "--version" ] && echo "i686-cygwin-guile-config - Guile version $GUILE"
101 [ "\$1" == "compile" ] && echo "-I$cygwin_root/usr/include"
102 [ "\$1" == "link" ] && echo "-L$cygwin_root/usr/lib -lguile"
103 exit 0
104 EOF
105         chmod 755 i686-cygwin-guile-config
106         PATH=$(pwd):$PATH
107         export PKG_CONFIG_PATH=$cygwin_prefix/lib/pkgconfig
108         export PKG_CONFIG="pkg-config \
109 --define-variable prefix=$cygwin_prefix \
110 --define-variable includedir=$cygwin_prefix/include \
111 --define-variable libdir=$cygwin_prefix/lib"
112     fi
113     export CFLAGS="-DKPSE_DLL"
114 }
115
116 postconfig () {
117     # fix_libtool_script
118
119     # cross-compiling: configure for build-host
120     if ! iscygwin; then
121         rm -f config.cache
122         export HOST_CC=${HOST_CC:-gcc}
123         export HOST_CXX=${HOST_CXX:-g++}
124         export HOST_PKG_CONFIG=${HOST_PKG_CONFIG:-pkg-config}
125         export HOST_PKG_CONFIG_PATH=${HOST_PKG_CONFIG_PATH:-}
126         (PATH="$old_path" \
127             PATH="$HOME/usr/pkg/guile/bin:$PATH" \
128             CFLAGS="-O2 -g" \
129             CC=$HOST_CC \
130             CXX=$HOST_CXX \
131             PKG_CONFIG=$HOST_PKG_CONFIG \
132             PKG_CONFIG_PATH=$HOST_PKG_CONFIG_PATH \
133             $src/configure --prefix=/usr --enable-config=for-build)
134     fi
135 }
136
137 prebuild () {
138     for i in $sub_packages; do
139         rm -rf $inst-$i
140         mkdir -p $inst-$i || exit 1
141     done
142     
143     # cross-compiling: build for build-host, generate doc
144     if ! iscygwin; then
145         cd $build || exit 1
146
147         PATH=/bin:/usr/bin:$PATH \
148             make conf=for-build all doc web || exit 1
149         
150         mkdir -p mf/out
151         cp -pv mf/out-for-build/* mf/out
152
153         mkdir -p Documentation/user/out
154         cp -pv Documentation/user/out-for-build/*{tely,texi} Documentation/user/out
155     fi
156
157     # set LDFLAGS to find the python library
158     # EXTRABUILDARGS="LDFLAGS=$cygwin_root/usr/bin/libpython2.3.dll"
159
160     addmakeflags LDFLAGS="$cygwin_root/usr/bin/libpython2.4.dll" ' ' "target=i686-pc-cygwin" ' '
161
162     if iscygwin; then
163         # EXTRABUILDARGS="$EXTRABUILDARGS all doc web"
164         addmakeflags all ' ' doc ' ' web ' '
165     fi
166 }
167
168 preinstall () {
169
170     # set LDFLAGS to find the python library
171     # addmakeflags LDFLAGS="$cygwin_root/usr/bin/libpython2.3.dll" ' ' "target=i686-pc-cygwin"
172 #    if ! iscygwin; then
173 #       EXTRAINSTALLARGS="target=i686-pc-cygwin"
174 #    else
175     if iscygwin; then
176         #EXTRAINSTALLARGS="web-install target=i686-pc-cygwin"
177         addmakeflags webdir="$inst-doc/$packagedocdir" ' ' web-install
178     fi
179 }
180
181 postinstall () {
182     fixdoc
183     fix_libtool_la
184     
185     mkdir -p $inst-doc/$docprefix
186     cd $build || exit 1
187     
188     if ! iscygwin; then
189         make conf=for-build webdir=$inst-doc/$packagedocdir web-install
190     fi
191
192     ## copy READMEs etc
193
194     cd $src || exit 1
195     install -d -m755 $inst/$packagedocdir
196
197     install -m644  COPYING ChangeLog DEDICATION THANKS VERSION $inst/$packagedocdir
198
199     # txt files reside elsewhere
200     cd $build/Documentation/topdocs/out
201     install -m644 AUTHORS.txt INSTALL.txt NEWS.txt README.txt $inst/$packagedocdir
202
203     ## Cygwin readmes
204     cygwin=cygwin
205     cd $src || exit 1
206     install -d -m755 $inst/$cygdocdir
207     install -m644 $cygwin/changelog $inst/$packagedocdir/changelog.Cygwin
208
209     cd $build || exit 1
210     install -m644 $cygwin/out/README $inst/$packagedocdir/README.Cygwin
211     install -m644 $cygwin/out/README $inst/$cygdocdir/$package.README
212
213     ## copy examples
214     cd $src || exit 1
215     cp -prv input $inst/$packagedocdir
216        cd $inst/$packagedocdir
217        rm -rf $(find -name 'CVS')
218
219     #cd $inst-doc/$packagedocdir &&
220     #ln -s $(find html/Documentation -name '*.ps.gz') .
221
222     install -d -m755 $inst-doc/$infodir/lilypond
223     cd $inst-doc/$infodir/lilypond && ln -sf ../../doc/$base-$ver/Documentation/user/out-www/*png .
224 }