# -*- shell-script -*-
+# cygwin/mknetrel - LilyPond mknetrel overrides
-# stable LilyPond releases: lilypond-1.6
-# archive=ftp://lilypond.org/pub/LilyPond/v1.6
-
-# LilyPond development: lilypond-1.7
-# archive=ftp://lilypond.org/pub/LilyPond/v1.7
-
-# Guile specific mknetrel overrides
-# To use this, do something like:
+# This script should be used to package LilyPond for Cygwin.
+# It can be used to build LilyPond on Cygwin, but also on GNU/Linux.
+#
+# See http://lilypond.org/web/devel/packaging.html for more information,
+# report bugs to bug-lilypond@gnu.org.
+#
+# To build the package, do:
cat >/dev/null <<EOC
- wget -P/var/tmp ftp://lilypond.org/pub/LilyPond/v1.7/lilypond-1.7.13.tar.gz
- rm -rf /home/netrel/src/lilypond-*
- mkdir -p /home/netrel/src && cd /home/netrel/src
- ## TODO: look at pimport
+ 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-*
tar xzf /var/tmp/lilypond-*
- mv lilypond-* $(echo lilypond-*)-1
- cd -
- ./bin/mknetrel -xXC 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
-
-BUILD=1
-# sover=14
-
-patch=$mknetrel_root/patch
-if iscygwin; then
- true
-else
- ##uploads=$here/uploads/$base && mkdir -p $uploads
- uploads=$here/uploads-development/$base && mkdir -p $uploads
- tarstem=$uploads/$package
-fi
-
sub_packages="doc"
old_path=$PATH
+patch=$mknetrel_root/patch
+# for cross-compiling LilyPond:
+if ! iscygwin; then
+ uploads=$here/uploads/$base && mkdir -p $uploads/
+ tarstem=$uploads/$package
+fi
-##. $extra/jcn
-
-
-# -*- shell-script -*-
-
-# jcn -- unsorted stuff
-
-
-#
-# Patching and configuring
-#
-
-presplit () { true; }
-
-# Maybe add to mknetrel or pimport.
-dopatchsrc () {
- cd $src
- patch -p1 < $patch/$package.patch
- [ -d cygwin -a ! -e CYGWIN-PATCHES ] && ln -s cygwin CYGWIN-PATCHES
- [ -d CYGWIN-PATCHES -a ! -e cygwin ] && ln -s CYGWIN-PATCHES cygwin
- [ -d CYGWIN-PATCHES ] || mkdir CYGWIN-PATCHES
-}
-
-# Maybe add to mknetrel or pimport.
-patchsrc () {
- [ -r $patch/$package.patch -a ! -r $src/CYGWIN-PATCHES -a ! -r $src/cygwin ] && dopatchsrc
-}
-
-autoupdate () {
- for i in bootstrap autogen.sh; do
- if [ -x ./$i ]; then
- ./$i || exit 1
- return 0
- fi
- done
-
- aclocal
- rm -rf libltdl
- libtoolize --force --copy --automake --ltdl
- autoheader
- autoconf
- automake --add-missing
-}
-
-crosscache () {
- cat <<EOF > config.cache
-
-ac_cv_c_bigendian=${ac_cv_c_bigendian=no}
-ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
-ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4}
-ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
-ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
-ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
-ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
-ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=12}
-ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
-ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
-ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
-ac_cv_c_long_size_t=${ac_cv_c_long_size_t=no}
-ac_cv_c_long_time_t=${ac_cv_c_long_time_t=yes}
-ac_16bit_type=${ac_16bit_type=short}
-ac_32bit_type=${ac_32bit_type=int}
-ac_64bit_type=${ac_64bit_type=none}
-ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls=no}
-ac_cv_sprintf_count=${ac_cv_sprintf_count=yes}
-ac_cv_spinlocks=${ac_cv_spinlocks=no}
-ac_cv_func_getpgrp_void=${ac_cv_func_getpgrp_void=yes}
-ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
-ac_cv_func_mkfifo=yes
-
-# Try at preventing to break make rules while crosscompiling. This
-# used work, but nowadays ./configure thinks it knows better than me.
-
-# But what ./configure doesn't know, is that automake and libtool are
-# broken wrt cross-building, and wrt cc_for_build. See new
-# workarounds above.
-
-ac_exeext=${ac_exeext=}
-ac_cv_exeext=${ac_cv_exeext=}
-EOF
-}
-
-
-
-#
-# Subpackage stuff -- Maybe move to mknetrel
-#
-
-# Possibly, using file-lists globs is smarter than separate install
-# prefixes. We'll see what happens when packaging tetex-*.
-
-
-lib_name () {
- echo lib$base$sover
-}
-
-devel_name () {
- echo $base-devel
-}
-
-doc_name () {
- echo $base-doc
-}
+# copy and include extra mknetrel stuff
+extras="doc patch auto cross split"
+for i in $extras; do
+ f=mknetrel.$i
+ [ -r $extra/$f ] && cp -pv $extra/$f $src/cygwin/$f
+ . $src/cygwin/$f
+done
-lib_split () {
- mkdir -p ./$prefix/bin || exit 1
- mv $inst/$prefix/bin/*.dll ./$prefix/bin
- mkdir -p ./$prefix/share || exit 1
- mv $inst/$prefix/share/$base ./$prefix/share
- true
-}
-
-devel_split () {
- mkdir -p ./$prefix/bin || exit 1
- mv $inst/$prefix/include ./$prefix/include
- mkdir -p ./$prefix/lib || exit 1
- mv $inst/$prefix/lib/*.a ./$prefix/lib
- mv $inst/$prefix/lib/*.la ./$prefix/lib
- mkdir -p ./$prefix/share || exit 1
- mv $inst/$prefix/share/aclocal ./$prefix/share
- true
-}
-
-doc_split () {
- mkdir -p ./$prefix || exit 1
- mv $inst/$prefix/info ./$prefix
- true
-}
-prebuild () {
- for i in $sub_packages; do
- rm -rf $inst-$i
- mkdir -p $inst-$i || exit 1
- done
+needdevoflags () {
+ false
}
-
-domkdist() {
- #
- # Fix up installation slightly
- #
- cd $inst || exit 1
- chmod -R a+w .
- cd usr 2>/dev/null && dousrstuff
-
-
- # Split off any sub-packages. The actual splitting is handled by
- # a package's specific code in extra/.
-
- # To package `foo' in foo, foo-doc and foo-devel, set
- # sub_packages='doc devel'.
- # Then provide functions doc_name and devel_name, that return the
- # full name of the sub-package. Also provide functions doc_split
- # and devel_split, that mv part of foo's installation in $inst to
- # the sub-packages' installation roots $inst-doc and $inst-devel.
-
- cd $inst || exit 1
- presplit
+fix_libtool_script () {
+ cd $build || exit 1
- for i in $sub_packages; do
- subname=$(${i}_name)
- cd $inst-$i || exit 1
- ${i}_split || exit 1
- done
+ # 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=""
- #
- # Make tar balls
- #
-
- cd $inst || exit 1
- prepackage
-
- # The base package
- echo creating $tarstem.tar.bz2
- cd $inst || exit 1
-
- f=$src/cygwin/setup.hint && test -r $f && cp $f $uploads
- f=$src/cygwin/$base.hint && test -r $f && cp $f $uploads/setup.hint
- find * -print | sort | tar -T - --no-recursion -cjf $tarstem.tar.bz2
-
- # Any sub-packages
- for i in $sub_packages; do
- subname=$(${i}_name)
- subload=$uploads/$subname
- subtarstem=$subload/$subname-$ver
- mkdir -p $subload || exit 1
- echo creating $subtarstem.tar.bz2
- f=$src/cygwin/$subname.hint && test -r $f && cp $f $subload/setup.hint
- cd $inst-$i
- find * -print | sort | tar -T - --no-recursion -cjf $subtarstem.tar.bz2
+ # 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
-
- # The source package
- cd $src/.. || exit 1
- echo creating "$tarstem"-src.tar.bz2
- 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
- postpackage
}
+preconfig () {
-# end jcn
-
-
-
-
-needdevoflags () {
- return 1
-}
-
-
-preconfig () { # aka libtool_woes ()
-
- # Add to mknetrel?
patchsrc
+ rm -f config.cache
- ## autoupdate
-
- cd $build || exit 1
-
- GUILE=1.6.0
- cat > guile-config <<EOF
-#!/bin/sh
-[ "\$1" == "--version" ] && echo "guile-config - Guile version $GUILE"
-[ "\$1" == "compile" ] && echo "-I$cygwin_prefix/include"
-[ "\$1" == "link" ] && echo "-L$cygwin_prefix/lib -lguile"
+ # for cross-compiling LilyPond, fake a guile-config
+ if ! iscygwin; then
+ cd $build || exit 1
+ 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
- PATH=$(pwd):$PATH
-
- ##opt='-O2 -g' LDFLAGS='"$cygwin_prefix/bin/libpython2.2.dll"
- rm -f config.cache
+ chmod 755 i686-cygwin-guile-config
+ PATH=$(pwd):$PATH
+ export PKG_CONFIG_PATH=$cygwin_root/usr/lib/pkgconfig
+ export PKG_CONFIG="pkg-config \
+--define-variable prefix=$cygwin_root \
+--define-variable includedir=$cygwin_root/usr/include"
+ fi
}
postconfig () {
- # Configure for build, for generating doc
- rm -f config.cache
- (PATH="$old_path" \
- PATH="$HOME/usr/pkg/guile-1.6.0/bin:$PATH" \
- CFLAGS="-O2 -g" \
- $src/configure --prefix=/usr --enable-config=for-build)
+ # fix_libtool_script
+
+ # cross-compiling: configure for build-host
+ if ! iscygwin; then
+ rm -f config.cache
+ export HOST_CC=gcc
+ export HOST_CXX=g++
+ (PATH="$old_path" \
+ PATH="$HOME/usr/pkg/guile/bin:$PATH" \
+ CFLAGS="-O2 -g" \
+ CC=$HOST_CC \
+ CXX=$HOST_CXX \
+ $src/configure --prefix=/usr --enable-config=for-build)
+ fi
}
prebuild () {
mkdir -p $inst-$i || exit 1
done
- # Build for build, generating doc
- cd $build || exit 1
-
- # ugh, footify fix
- cd $src && ln -s GNUmakefile.in GNUmakefile
+ # cross-compiling: build for build-host, generate doc
+ if ! iscygwin; then
+ cd $build || exit 1
- cd $build || exit 1
- # Ugh. Fixed in 1.6.8CVS and 1.7.13CVS.
- # PATH=/bin:/usr/bin:$PATH make DO_O_DEP="echo NO DEPS;" conf=for-build all doc html-doc || exit 1
- PATH=/bin:/usr/bin:$PATH make conf=for-build all doc html-doc || exit 1
- for i in $(find . -path "out-for-build/*.1"); do
- cp -pv $i $(dirname $(dirname $i))/$(basename $i)
- done
+ PATH=/bin:/usr/bin:$PATH \
+ make conf=for-build all doc web || exit 1
+
+ mkdir -p mf/out
+ cp -pv mf/out-for-build/* mf/out
- mkdir -p mf/out
- cp -pv mf/out-for-build/* mf/out
-
- addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.2.dll" ' ' 'target=i686-pc-cygwin'
+ 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
}
preinstall () {
- cd $build || exit 1
- cp -v scripts/out-for-build/midi2ly.1 scripts/out
- cp -v lily/out-for-build/lilypond.1 lily/out
-
- addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.2.dll" ' ' 'target=i686-pc-cygwin'
+
+ # 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
}
postinstall () {
- mkdir -p $inst-doc/$prefix
+ fixdoc
+ fix_libtool_la
+
+ mkdir -p $inst-doc/$docprefix
cd $build || exit 1
- docdir=$prefix/share/doc/$base-$ver
- make conf=for-build docdir=$inst-doc/$docdir install-html-doc
-
+ 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/$docdir
+ install -d -m755 $inst/$packagedocdir
- ## Generic READMEs
- find . -maxdepth 1 -type f -exec cp -pv \{\} $inst/$docdir \;
+ 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 -m644 $cygwin/README $inst/$docdir/README.Cygwin
- install -m644 $cygwin/changelog $inst/$docdir/changelog.Cygwin
- install -d -m755 $inst/$prefix/doc/Cygwin
- #install -m644 $cygwin/README $inst/$prefix/doc/Cygwin/$package.README
+ install -d -m755 $inst/$cygdocdir
+ install -m644 $cygwin/changelog $inst/$packagedocdir/changelog.Cygwin
cd $build || exit 1
- install -m644 $cygwin/out/README $inst/$docdir/README.Cygwin
- install -m644 $cygwin/out/README $inst/$prefix/doc/Cygwin/$package.README
+ install -m644 $cygwin/out/README $inst/$packagedocdir/README.Cygwin
+ install -m644 $cygwin/out/README $inst/$cygdocdir/$package.README
## copy examples
cd $src || exit 1
- cp -prv input $inst/$docdir
-
- cd $inst-doc/$prefix/share/doc/$base-$ver &&
- ln -s $(find html/Documentation -name '*.ps.gz') .
-
- ## Cygwin doesn't adhere to FHS (and why should they?)
- cd $inst/$prefix/share && tar cf - doc | (cd ..; tar xf -) && rm -rf doc
- cd $inst-doc/$prefix/share && tar cf - doc | (cd ..; tar xf -) && rm -rf doc
-}
+ cp -prv input $inst/$packagedocdir
+ cd $inst/$packagedocdir
+ rm -rf $(find -name 'CVS')
-#presplit () {
-# docdir=$prefix/share/doc/$base-$ver
-# mkdir -p $inst-doc/$docdir || exit 1
-#}
+ #cd $inst-doc/$packagedocdir &&
+ #ln -s $(find html/Documentation -name '*.ps.gz') .
-doc_split () {
- mkdir -p ./$prefix || exit 1
- mv $inst/$prefix/info ./$prefix
- true
+ install -d -m755 $inst-doc/$infodir/lilypond
+ cd $inst-doc/$infodir/lilypond && ln -sf ../../doc/$base-$ver/Documentation/user/out-www/*png .
}
-
-
-#prepackage () {
-# mv $inst/$prefix/bin/guile-* $inst-devel/$prefix/bin
-#}