]> git.donarmstrong.com Git - lilypond.git/blobdiff - cygwin/mknetrel
(Lilypond_snippet.is_outdated): fix
[lilypond.git] / cygwin / mknetrel
index aee68a7e928e1424a4833ad14521fa62b376f703..a782c521a8198cc11fe7448c3d163228f04c8c47 100644 (file)
@@ -1,41 +1,38 @@
 # -*- shell-script -*-
-
-# ancient LilyPond releases: lilypond-1.6
-# archive=ftp://lilypond.org/pub/LilyPond/v1.6
-
-# stable LilyPond releases: lilypond-1.8
-# archive=ftp://lilypond.org/pub/LilyPond/v1.8
-
-# LilyPond mknetrel overrides
-# To use this, do something like:
+# cygwin/mknetrel - LilyPond mknetrel overrides
+
+# 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.8/lilypond-1.8.0.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
 
-# sover=14
+sub_packages="doc"
+old_path=$PATH
 
 patch=$mknetrel_root/patch
-if iscygwin; then
-    true
-else 
+
+# for cross-compiling LilyPond:
+if ! iscygwin; then
     uploads=$here/uploads/$base && mkdir -p $uploads/
-    [ "$ABI" = "1.5" ] && uploads=$here/uploads-development/$base && mkdir -p $uploads/
     tarstem=$uploads/$package
 fi
 
-sub_packages="doc"
-old_path=$PATH
-
-
 # copy and include extra mknetrel stuff
 extras="doc patch auto cross split"
 for i in $extras; do
@@ -49,50 +46,44 @@ needdevoflags () {
     return 1
 }
 
+preconfig () {
 
-preconfig () { # aka libtool_woes ()
-
-    # Add to mknetrel?
     patchsrc 
+    rm -f config.cache
 
-    ## autoupdate
-
-    cd $build || exit 1
-
-    GUILE=1.6.4
-    cat > guile-config <<EOF
+    # 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"
+[ "\$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
-
-    export CFLAGS="-fpermissive"
-    if [ "$ABI" != "1.5" ];then
-       export LDFLAGS="$cygwin_prefix/bin/cygkpathsea-3abi13.dll"
+       chmod 755 guile-config
+       PATH=$(pwd):$PATH
     fi
-    ##opt='-O2 -g' LDFLAGS='"$cygwin_prefix/bin/libpython2.2.dll"
-    rm -f config.cache
 }
 
 postconfig () {
-    # Configure for build, for generating doc
-    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)
+    # cross-compiling: configure for build-host
+    if ! iscygwin; then
+       rm -f config.cache
+       export HOST_CC=gcc
+       export HOST_CXX=g++
+       if [ "$ABI" = "1.3" ]; then
+           HOST_CC=gcc-2.95
+           HOST_CXX=g++-2.95
+           (cd $src && ln -s GNUmakefile.in GNUmakefile)
+       fi
+       (PATH="$old_path" \
+           PATH="$HOME/usr/pkg/guile-1.6/bin:$PATH" \
+           CFLAGS="-O2 -g" \
+           CC=$HOST_CC \
+           CXX=$HOST_CXX \
+           $src/configure --prefix=/usr --enable-config=for-build)
     fi
-    (PATH="$old_path" \
-       PATH="$HOME/usr/pkg/guile-1.6/bin:$PATH" \
-       CFLAGS="-O2 -g" \
-       CC=$HOST_CC \
-       CXX=$HOST_CXX \
-       $src/configure --prefix=/usr --enable-config=for-build)
 }
 
 prebuild () {
@@ -101,34 +92,38 @@ prebuild () {
        mkdir -p $inst-$i || exit 1
     done
     
-    # Build for build, generating doc
-    cd $build || exit 1
-    
-    #PATH=/bin:/usr/bin:$PATH make conf=for-build all doc html-doc || exit 1
-    PATH=/bin:/usr/bin:$PATH make conf=for-build all doc web || exit 1
-    for i in $(find . -path "out-for-build/*.1"); do
-       cp -pv $i $(dirname $(dirname $i))/$(basename $i)
-    done
+    # cross-compiling: build for build-host, generate doc
+    if ! iscygwin; then
+       cd $build || exit 1
+
+       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
+    fi
 
-    mkdir -p mf/out
-    cp -pv mf/out-for-build/* mf/out
-    
-    if false; then #[ "$ABI" != "1.5" ]; then
-       addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.2.dll" ' ' 'target=i686-pc-cygwin'
-    else
-       addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.3.dll" ' ' 'target=i686-pc-cygwin'
+    # set LDFLAGS to find the python library
+    # EXTRABUILDARGS="LDFLAGS=$cygwin_root/usr/bin/libpython2.3.dll"
+
+    addmakeflags LDFLAGS="$cygwin_root/usr/bin/libpython2.3.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
-    
-    if false; then # [ "$ABI" != "1.5" ]; then
-       addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.2.dll" ' ' 'target=i686-pc-cygwin'
-    else
-       addmakeflags MAKE_PFA_FILES=1 ' ' LDFLAGS="$cygwin_prefix/bin/libpython2.3.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
 }
 
@@ -138,22 +133,26 @@ postinstall () {
     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 -d -m755 $inst/$prefix/doc/Cygwin
-    #install -m644 $cygwin/README $inst/$cygdocdir/Cygwin/$package.README
 
     cd $build || exit 1
     install -m644 $cygwin/out/README $inst/$packagedocdir/README.Cygwin
@@ -162,8 +161,12 @@ postinstall () {
     ## 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 .
+}