# See http://lilypond.org/web/devel/packaging.html for more information,
# report bugs to bug-lilypond@gnu.org.
#
-#
-# Get mknetrel from here:
-#
-# cvs -d:pserver:anoncvs@sources.redhat.com:/cvs/cygwin-apps co mknetrel
-#
-# To build the package do:
+# To build the package, do:
cat >/dev/null <<EOC
- wget -P/var/tmp ftp://lilypond.org/pub/LilyPond/v1.9/lilypond-1.9.8.tar.gz
+ cd /
+ cvs -d:pserver:anoncvs@sources.redhat.com:/cvs/cygwin-apps co -d netrel mknetrel
+ wget -P/var/tmp ftp://lilypond.org/pub/LilyPond/v1.9/lilypond-1.9.9.tar.gz
+ mkdir -p /netrel/src && cd /netrel/src
rm -rf /netrel/src/lilypond-*
- mkdir -p /netrel/src && cd /home/netrel/src
tar xzf /var/tmp/lilypond-*
- mv lilypond-1.9.8 lilypond-1.9.8-1
- cd -
- export ABI=1.5
- ./bin/mknetrel -xX lilypond
+ mv lilypond-1.9.9 lilypond-1.9.9-1
+ cp lilypond-1.9.9-1/cygwin/mknetrel /netrel/extra/lilypond
+ /netrel/bin/mknetrel -xX lilypond
EOC
patch=$mknetrel_root/patch
# for cross-compiling LilyPond:
-if !iscygwin; then
+if ! iscygwin; then
uploads=$here/uploads/$base && mkdir -p $uploads/
tarstem=$uploads/$package
fi
-# the files mknetrel.doc, mknetrel.patch, etc. can be had from the
-# latest cygwin source, currently:
-#
-# http://lilypond.org/cygwin/uploads/lilypond/lilyond-1.8.2-1-src.tar.bz2
-#
-
# copy and include extra mknetrel stuff
extras="doc patch auto cross split"
for i in $extras; do
needdevoflags () {
- return 1
+ false
+}
+
+fix_libtool_script () {
+ cd $build || exit 1
+
+ # Fix libtool's -rpath detection
+ export CC="${build_cc}"
+ export CXX="${build_cxx}"
+ export DLLTOOL=${build_dlltool}
+ export OBJDUMP=${build_objdump}
+ export AS="${build_as}"
+ export HOST_CC=/usr/bin/gcc
+ export allow_undefined="yes"
+ export allow_undefined_flag=""
+
+ # fix libtool's dlltool usage
+ mv libtool libtool.orig
+ sed -e 's/^DLLTOOL="dlltool"/DLLTOOL="i686-cygwin-dlltool"/' \
+ -e 's/^DLLTOOL=/HOST_CC=gcc\nDLLTOOL=/' \
+ -e 's/^HOST_CC=/SED=sed\nHOST_CC=/' < libtool.orig > libtool
+ chmod +x libtool
+}
+
+fix_libtool_la () {
+ # fix libtool's .la dependency_libs output for dlopen
+ for i in $inst/lib $inst/$prefix/lib ]; do
+ if [ -d $i ]; then
+ cd $i || exit 1
+ for j in $(ls -1 *la); do
+ mv $j .libtool-$j
+ sed -e 's/ *-L *[^ ][^ ]*//g' .libtool-$j > $j
+ chmod +x $j
+ done
+ fi
+ done
}
preconfig () {
patchsrc
rm -f config.cache
- # for cross-compiling LilyPond:
- if !iscygwin; then
+ cd $src
+ if [ ! -x ./configure ]; then
+ ./autogen.sh --noconfigure
+ fi
+
+ cd $build
+ # for cross-compiling LilyPond, fake a guile-config
+ if ! iscygwin; then
cd $build || exit 1
- GUILE=1.6.4
- cat > guile-config <<EOF
-[ "\$1" == "--version" ] && echo "guile-config - Guile version $GUILE"
-[ "\$1" == "compile" ] && echo "-I$cygwin_prefix/include"
-[ "\$1" == "link" ] && echo "-L$cygwin_prefix/lib -lguile"
+ GUILE=1.6.5
+ cat > i686-cygwin-guile-config <<EOF
+[ "\$1" == "--version" ] && echo "i686-cygwin-guile-config - Guile version $GUILE"
+[ "\$1" == "compile" ] && echo "-I$cygwin_root/usr/include"
+[ "\$1" == "link" ] && echo "-L$cygwin_root/usr/lib -lguile"
exit 0
EOF
- chmod 755 guile-config
+ chmod 755 i686-cygwin-guile-config
PATH=$(pwd):$PATH
+ export PKG_CONFIG_PATH=$cygwin_prefix/lib/pkgconfig
+ export PKG_CONFIG="pkg-config \
+--define-variable prefix=$cygwin_prefix \
+--define-variable includedir=$cygwin_prefix/include \
+--define-variable libdir=$cygwin_prefix/lib"
fi
+ export CFLAGS="-DKPSE_DLL"
}
postconfig () {
+ # fix_libtool_script
+
# cross-compiling: configure for build-host
- if !iscygwin; then
+ if ! iscygwin; then
rm -f config.cache
- export HOST_CC=gcc
- export HOST_CXX=g++
- if [ "$ABI" != "1.5" ]; then
- HOST_CC=gcc-2.95
- HOST_CXX=g++-2.95
- (cd $src && ln -s GNUmakefile.in GNUmakefile)
- fi
+ export HOST_CC=${HOST_CC:-gcc}
+ export HOST_CXX=${HOST_CXX:-g++}
+ export HOST_PKG_CONFIG=${HOST_PKG_CONFIG:-pkg-config}
+ export HOST_PKG_CONFIG_PATH=${HOST_PKG_CONFIG_PATH:-}
(PATH="$old_path" \
- PATH="$HOME/usr/pkg/guile-1.6/bin:$PATH" \
+ PATH="$HOME/usr/pkg/guile/bin:$PATH" \
CFLAGS="-O2 -g" \
CC=$HOST_CC \
CXX=$HOST_CXX \
+ PKG_CONFIG=$HOST_PKG_CONFIG \
+ PKG_CONFIG_PATH=$HOST_PKG_CONFIG_PATH \
$src/configure --prefix=/usr --enable-config=for-build)
fi
}
done
# cross-compiling: build for build-host, generate doc
- if !iscygwin; then
+ if ! iscygwin; then
cd $build || exit 1
PATH=/bin:/usr/bin:$PATH \
- PYTHONPATH=$build/python/out-for-build:$PYTHONPATH \
make conf=for-build all doc web || exit 1
- # as of 1.9.9, this should no longer be necessary:
- for i in $(find . -path ".*out-for-build/*.1"); do
- o=$(dirname $(dirname $i))/out
- mkdir -p $o
- cp -pv $i $o/$(basename $i)
- done
-
mkdir -p mf/out
cp -pv mf/out-for-build/* mf/out
+
+ mkdir -p Documentation/user/out
+ cp -pv Documentation/user/out-for-build/*{tely,texi} Documentation/user/out
+ fi
+
+ # set LDFLAGS to find the python library
+ # EXTRABUILDARGS="LDFLAGS=$cygwin_root/usr/bin/libpython2.3.dll"
+
+ addmakeflags LDFLAGS="$cygwin_root/usr/bin/libpython2.4.dll" ' ' "target=i686-pc-cygwin" ' '
+
+ if iscygwin; then
+ # EXTRABUILDARGS="$EXTRABUILDARGS all doc web"
+ addmakeflags all ' ' doc ' ' web ' '
fi
-
- addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.3.dll" ' ' 'target=i686-pc-cygwin'
}
preinstall () {
- # cross-compiling: fix manual pages
- if !iscygwin; then
- # as of 1.9.9, this should no longer be necessary:
- cd $build || exit 1
- cp -v scripts/out-for-build/midi2ly.1 scripts/out
- cp -v lily/out-for-build/lilypond.1 lily/out
+ # set LDFLAGS to find the python library
+ # addmakeflags LDFLAGS="$cygwin_root/usr/bin/libpython2.3.dll" ' ' "target=i686-pc-cygwin"
+# if ! iscygwin; then
+# EXTRAINSTALLARGS="target=i686-pc-cygwin"
+# else
+ if iscygwin; then
+ #EXTRAINSTALLARGS="web-install target=i686-pc-cygwin"
+ addmakeflags webdir="$inst-doc/$packagedocdir" ' ' web-install
fi
-
- addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.3.dll" ' ' 'target=i686-pc-cygwin'
}
postinstall () {
fixdoc
+ fix_libtool_la
mkdir -p $inst-doc/$docprefix
cd $build || exit 1
- make conf=for-build webdir=$inst-doc/$packagedocdir web-install
+ if ! iscygwin; then
+ make conf=for-build webdir=$inst-doc/$packagedocdir web-install
+ fi
## copy READMEs etc
cd $src || exit 1
install -d -m755 $inst/$packagedocdir
- ## Generic READMEs
- find . -maxdepth 1 -type f -exec cp -pv \{\} $inst/$packagedocdir \;
+ install -m644 COPYING ChangeLog DEDICATION THANKS VERSION $inst/$packagedocdir
+
+ # txt files reside elsewhere
+ cd $build/Documentation/topdocs/out
+ install -m644 AUTHORS.txt INSTALL.txt NEWS.txt README.txt $inst/$packagedocdir
## Cygwin readmes
cygwin=cygwin
cd $src || exit 1
install -d -m755 $inst/$cygdocdir
- install -m644 $cygwin/changelog $inst/$cygdocdir/changelog.Cygwin
+ install -m644 $cygwin/changelog $inst/$packagedocdir/changelog.Cygwin
cd $build || exit 1
install -m644 $cygwin/out/README $inst/$packagedocdir/README.Cygwin
## copy examples
cd $src || exit 1
cp -prv input $inst/$packagedocdir
+ cd $inst/$packagedocdir
+ rm -rf $(find -name 'CVS')
+
+ #cd $inst-doc/$packagedocdir &&
+ #ln -s $(find html/Documentation -name '*.ps.gz') .
- cd $inst-doc/$packagedocdir &&
- ln -s $(find html/Documentation -name '*.ps.gz') .
+ install -d -m755 $inst-doc/$infodir/lilypond
+ cd $inst-doc/$infodir/lilypond && ln -sf ../../doc/$base-$ver/Documentation/user/out-www/*png .
}