2 # cygwin/mknetrel - LilyPond mknetrel overrides
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.
7 # See http://lilypond.org/web/devel/packaging.html for more information,
8 # report bugs to bug-lilypond@gnu.org.
10 # To build the package, do:
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
28 patch=$mknetrel_root/patch
30 # for cross-compiling LilyPond:
32 uploads=$here/uploads/$base && mkdir -p $uploads/
33 tarstem=$uploads/$package
36 # copy and include extra mknetrel stuff
37 extras="doc patch auto cross split"
40 [ -r $extra/$f ] && cp -pv $extra/$f $src/cygwin/$f
49 fix_libtool_script () {
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=""
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
71 # fix libtool's .la dependency_libs output for dlopen
72 for i in $inst/lib $inst/$prefix/lib ]; do
75 for j in $(ls -1 *la); do
77 sed -e 's/ *-L *[^ ][^ ]*//g' .libtool-$j > $j
90 if [ ! -x ./configure ]; then
91 ./autogen.sh --noconfigure
95 # for cross-compiling LilyPond, fake a guile-config
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"
105 chmod 755 i686-cygwin-guile-config
107 export PKG_CONFIG_PATH=$cygwin_root/usr/lib/pkgconfig
108 export PKG_CONFIG="pkg-config \
109 --define-variable prefix=$cygwin_root \
110 --define-variable includedir=$cygwin_root/usr/include"
112 export CFLAGS="-DKPSE_DLL"
118 # cross-compiling: configure for build-host
121 export HOST_CC=${HOST_CC:-gcc}
122 export HOST_CXX=${HOST_CXX:-g++}
123 export HOST_PKG_CONFIG=${HOST_PKG_CONFIG:-pkg-config}
124 export HOST_PKG_CONFIG_PATH=${HOST_PKG_CONFIG_PATH:-}
126 PATH="$HOME/usr/pkg/guile/bin:$PATH" \
130 PKG_CONFIG=$HOST_PKG_CONFIG \
131 PKG_CONFIG_PATH=$HOST_PKG_CONFIG_PATH \
132 $src/configure --prefix=/usr --enable-config=for-build)
137 for i in $sub_packages; do
139 mkdir -p $inst-$i || exit 1
142 # cross-compiling: build for build-host, generate doc
146 PATH=/bin:/usr/bin:$PATH \
147 make conf=for-build all doc web || exit 1
150 cp -pv mf/out-for-build/* mf/out
152 mkdir -p Documentation/user/out
153 cp -pv Documentation/user/out-for-build/*{tely,texi} Documentation/user/out
156 # set LDFLAGS to find the python library
157 # EXTRABUILDARGS="LDFLAGS=$cygwin_root/usr/bin/libpython2.3.dll"
159 addmakeflags LDFLAGS="$cygwin_root/usr/bin/libpython2.4.dll" ' ' "target=i686-pc-cygwin" ' '
162 # EXTRABUILDARGS="$EXTRABUILDARGS all doc web"
163 addmakeflags all ' ' doc ' ' web ' '
169 # set LDFLAGS to find the python library
170 # addmakeflags LDFLAGS="$cygwin_root/usr/bin/libpython2.3.dll" ' ' "target=i686-pc-cygwin"
171 # if ! iscygwin; then
172 # EXTRAINSTALLARGS="target=i686-pc-cygwin"
175 #EXTRAINSTALLARGS="web-install target=i686-pc-cygwin"
176 addmakeflags webdir="$inst-doc/$packagedocdir" ' ' web-install
184 mkdir -p $inst-doc/$docprefix
188 make conf=for-build webdir=$inst-doc/$packagedocdir web-install
194 install -d -m755 $inst/$packagedocdir
196 install -m644 COPYING ChangeLog DEDICATION THANKS VERSION $inst/$packagedocdir
198 # txt files reside elsewhere
199 cd $build/Documentation/topdocs/out
200 install -m644 AUTHORS.txt INSTALL.txt NEWS.txt README.txt $inst/$packagedocdir
205 install -d -m755 $inst/$cygdocdir
206 install -m644 $cygwin/changelog $inst/$packagedocdir/changelog.Cygwin
209 install -m644 $cygwin/out/README $inst/$packagedocdir/README.Cygwin
210 install -m644 $cygwin/out/README $inst/$cygdocdir/$package.README
214 cp -prv input $inst/$packagedocdir
215 cd $inst/$packagedocdir
216 rm -rf $(find -name 'CVS')
218 #cd $inst-doc/$packagedocdir &&
219 #ln -s $(find html/Documentation -name '*.ps.gz') .
221 install -d -m755 $inst-doc/$infodir/lilypond
222 cd $inst-doc/$infodir/lilypond && ln -sf ../../doc/$base-$ver/Documentation/user/out-www/*png .