2005-05-30 Jan Nieuwenhuizen <janneke@gnu.org>
+ * cygwin: Update from mingw patches.
+
* scm/editor.scm (editor-command-template-alist): Use jedit
-reuseview (Bertalan), add uedit (Patrick Huberts).
# -*- shell-script -*-
-# 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
-
- 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-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
sub_packages="doc"
-old_path=$PATH
-patch=$mknetrel_root/patch
+[ "$cygwin" == "mingw" ] && sub_packages="doc extra"
-# for cross-compiling LilyPond:
-if ! iscygwin; then
- uploads=$here/uploads/$base && mkdir -p $uploads/
- tarstem=$uploads/$package
-fi
-
-# 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
+depends="libfontconfig1 libfreetype6 libguile16 libintl3 libpango1"
+build_depends="mingw-devel gettext-devel guile-devel pango-devel"
+v=$(expr "$ver" : "\(.*\)-[0-9]*")
-needdevoflags () {
- false
-}
+save_PATH="$PATH"
-fix_libtool_script () {
- cd $build || exit 1
+# copy and include extra mknetrel stuff
+. $src/$cygwin/mknetrel.extras || . $mknetrel/extras
- # 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
+doc () {
+ # doc works, but take too long to build each time
+ [ "$cygwin" == "mingw" ] && return 1
+ return 0
}
preconfig () {
+ extras_preconfig
- patchsrc
- rm -f config.cache
-
- 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.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 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"
+ [ "$cygwin" == "mingw" ] && if grep 'PYTHON_DEVEL(REQUIRED)' $src/configure.in; then
+ sed -i~ -e 's/PYTHON_DEVEL(REQUIRED)/PYTHON_DEVEL(OPTIONAL)/' \
+ $src/configure.in
fi
- export CFLAGS="-DKPSE_DLL"
-}
-
-postconfig () {
- # fix_libtool_script
-
+ [ "$cygwin" == "mingw" ] && cd $src && ./autogen.sh --noconfigure
+
+ cd $build || exit 1
# cross-compiling: configure for build-host
if ! iscygwin; then
rm -f config.cache
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/bin:$PATH" \
+ export HOST_FREETYPE_CONFIG=${HOST_FREETYPE_CONFIG:-freetype-config}
+ (PATH="$build:$save_PATH" \
CFLAGS="-O2 -g" \
+ CPPFLAGS="" \
CC=$HOST_CC \
CXX=$HOST_CXX \
+ LDFLAGS="" \
PKG_CONFIG=$HOST_PKG_CONFIG \
PKG_CONFIG_PATH=$HOST_PKG_CONFIG_PATH \
- $src/configure --prefix=/usr --enable-config=for-build)
+ FREETYPE_CONFIG=$HOST_FREETYPE_CONFIG \
+ $src/configure --prefix=$prefix --enable-config=for-build)
+ fi
+
+ if [ "$cygwin" == "mingw" ]; then
+ cp /usr/include/FlexLexer.h .
+ mkdir python2.3
+ cp /usr/include/python2.3/Python.h python2.3
+ fi
+
+ GUILE=$($cygwin_prefix/bin/guile-config --version 2>&1 | awk '{print $NF}')
+ cat > $target-guile-config <<EOF
+[ "\$1" == "--version" ] && echo "$target-guile-config - Guile version $GUILE"
+[ "\$1" == "compile" ] && echo "-I$cygwin_prefix/include"
+[ "\$1" == "link" ] && echo "-L$cygwin_prefix/lib -lguile -lgmp"
+exit 0
+EOF
+ chmod 755 $target-guile-config
+ export PATH=.:$PATH
+ build_cxx="$build_cxx -I$(pwd)"
+ if [ "$cygwin" == "mingw" ]; then
+ CONFIGOPTS="--without-kpathsea $CONFIGOPTS"
+ CPPFLAGS="-DARGV0_RELOCATION=1 $CPPFLAGS"
+ # There's a problem with inlining the string utils.
+ # The -O2 flag is still passed by default through opt.
+ CONFIGOPTS="--disable-optimising $CONFIGOPTS"
+ ## debugging
+ ##opt='-g'
fi
+ :
}
prebuild () {
- for i in $sub_packages; do
- rm -rf $inst-$i
- mkdir -p $inst-$i || exit 1
- done
-
+ extras_prebuild
+
+ # shortcircuit python for mingw
+ if [ "$cygwin" == "mingw" ]; then
+ mkdir -p python/out
+ touch python/out/midi.lo python/out/midi.so python/out/midi.dll
+ fi
+
# 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
+ if doc; then
+ args="all doc web"
+ else
+ args="all"
+ fi
+ (PATH="$build:$save_PATH" \
+ CFLAGS="-O2 -g" \
+ CPPFLAGS="" \
+ CC=$HOST_CC \
+ CXX=$HOST_CXX \
+ LDFLAGS="" \
+ eval make conf=for-build $args) || exit 1
mkdir -p mf/out
cp -pv mf/out-for-build/* mf/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" ' '
+ addmakeflags "target=$target" ' '
+ if [ -f "$cygwin_prefix/bin/libpython2.4.dll" ]; then
+ addmakeflags LDFLAGS="$cygwin_prefix/bin/libpython2.4.dll" ' '
+ fi
- if iscygwin; then
- # EXTRABUILDARGS="$EXTRABUILDARGS all doc web"
+ if iscygwin && doc; then
addmakeflags all ' ' doc ' ' web ' '
fi
}
preinstall () {
-
- # 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"
+ extras_preinstall
+ if iscygwin && doc; then
addmakeflags webdir="$inst-doc/$packagedocdir" ' ' web-install
fi
}
postinstall () {
- fixdoc
- fix_libtool_la
-
- mkdir -p $inst-doc/$docprefix
+ extras_postinstall
+
cd $build || exit 1
-
- if ! iscygwin; then
+ if ! iscygwin && doc; then
make conf=for-build webdir=$inst-doc/$packagedocdir web-install
fi
- ## copy READMEs etc
-
- cd $src || exit 1
- install -d -m755 $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/$packagedocdir/changelog.Cygwin
-
- cd $build || exit 1
- 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/$packagedocdir
- cd $inst/$packagedocdir
- rm -rf $(find -name 'CVS')
+ rm -rf $(find $inst/$packagedocdir -name 'CVS')
+ rm -f $(find $inst/$packagedocdir -name 'SCons*')
+ rm -f $(find $inst/$packagedocdir -name 'GNUmakefile*')
+
+ rm -rf $(find $inst/usr/share/lilypond -name '*.pyc')
+ rm -f $inst/usr/share/lilypond/$v/tex/texinfo.tex
- #cd $inst-doc/$packagedocdir &&
- #ln -s $(find html/Documentation -name '*.ps.gz') .
+ if [ "$cygwin" == "mingw" ]; then
+ find $inst -name '*ly' | xargs unix2dos
+ fi
install -d -m755 $inst-doc/$infodir/lilypond
- cd $inst-doc/$infodir/lilypond && ln -sf ../../doc/$base-$ver/Documentation/user/out-www/*png .
+ if doc; then
+ cd $inst-doc/$infodir/lilypond && ln -sf ../../doc/$base-$ver/Documentation/user/out-www/*png .
+ fi
+}
+
+doc_split () {
+ extras_doc_split
+ mkdir -p ./$packagedocdir/input
+ mv $inst/$packagedocdir/input/{no-notation,regression,test,tutorial} ./$packagedocdir/input
+ mkdir -p ./$prefix/share/lilypond/$v/fonts
+ mv $inst/$prefix/share/lilypond/$v/fonts/source ./$prefix/share/lilypond/$v/fonts
+}
+
+extra_name () {
+ echo lilypond-extra
+}
+
+extra_split () {
+ mkdir -p
+ # should be in devel...
+ mkdir -p ./$prefix/share/lilypond/$v
+ for i in make python tex vim; do
+ mv $inst/$prefix/share/lilypond/$v/$i ./$prefix/share/lilypond/
+ done
+ mkdir -p ./$prefix/share/lilypond/$v/fonts
+ for i in source svg tfm; do
+ mv $inst/$prefix/share/lilypond/$v/fonts/$i ./$prefix/share/lilypond/fonts
+ done
+
+ mkdir -p ./$prefix/share
+ for i in locale omf; do
+ mv $inst/$prefix/share/$i ./$prefix/share
+ done
}
#
autoupdate () {
- for i in bootstrap autogen.sh; do
- if [ -x ./$i ]; then
- ./$i || exit 1
- return 0
+ if [ "$base" != "libtool" ]; then
+ if [ -d libltdl ]; then
+ rm -rf libltdl
+ libtoolize --force --copy --automake --ltdl
+ else
+ libtoolize --force --copy --automake
fi
- done
-
- aclocal
- rm -rf libltdl
- libtoolize --force --copy --automake --ltdl
- autoheader
- autoconf
- automake --add-missing
+ fi
+
+ chmod +x ./bootstrap ./autogen.sh || :
+ if [ -x ./bootstrap ]; then
+ ./bootstrap --noconfigure
+ elif [ -x ./autogen.sh ]; then
+ ./autogen.sh --noconfigure
+ else
+ aclocal
+ autoheader
+ autoconf
+ automake --add-missing
+ fi
+ sed -i~ -e 's/ x$PKG_CONFIG / "$x$PKG_CONFIG" /' $src/configure
}
# mknetrel.cross -- set cross.cache for configure
#
+# for cross-compiling
+if ! iscygwin; then
+ uploads=$here/uploads/$base && mkdir -p $uploads/
+ tarstem=$uploads/$package
+fi
+
crosscache () {
cat <<EOF > config.cache
ac_cv_c_bigendian=\${ac_cv_c_bigendian=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
+# but in mingw only if winsock2.h
+ac_cv_func_select=\${ac_cv_func_select=yes}
ac_cv_search_dlopen=\${ac_cv_search_dlopen="none required"}
ac_exeext=\${ac_exeext=}
ac_cv_exeext=\${ac_cv_exeext=}
# sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
lt_cv_dlopen=\${lt_cv_dlopen="dlopen"}
lt_cv_dlopen_libs=\${lt_cv_dlopen_libs="none required"}
-## -- will this work?
+## trying to get .la's in /usr/lib, will this work? -- jcn
##libltdl_cv_sys_search_path=\${libltdl_cv_sys_search_path="'"/lib /usr/lib"'"}
+##libltdl_cv_sys_search_path=\${libltdl_cv_sys_search_path="'"$cygwin_prefix/lib"'"}
libltdl_cv_sys_search_path=\${libltdl_cv_sys_search_path="'"$cygwin_prefix/lib"'"}
-lt_cv_sys_max_cmd_len=${lt_cv_sys_max_cmd_len=8192}
-##ac_cv_header_strings_h=${ac_cv_header_strings_h=yes}
+lt_cv_sys_max_cmd_len=\${lt_cv_sys_max_cmd_len=8192}
+##ac_cv_header_strings_h=\${ac_cv_header_strings_h=yes}
ac_cv_lib_dld_shl_load=\${ac_cv_lib_dld_shl_load=no}
ac_cv_lib_dl_dlopen=\${ac_cv_lib_dl_dlopen=no}
+ac_cv_c_stack_direction=\${ac_cv_c_stack_direction=-1}
EOF
}
+needdevoflags () {
+ return 1
+}
+
+extras_preconfig () {
+ cd $src || exit 1
+ patchsrc
+ if [ ! -x ./configure ]; then
+ autoupdate
+ fi
+ for i in $(find $src -name configure | xargs grep -l PKG_CONFIG); do
+ sed -i~ -e 's/ x$PKG_CONFIG / "$x$PKG_CONFIG" /' $i
+ done
+ cd $build || exit 1
+ CONFIGOPTS="--config-cache --enable-shared --disable-static $CONFIGOPTS"
+ ##[ "$cygwin" == "mingw" ] && CONFIGOPTS="'LDFLAGS=-mwindows -mms-bitfields' $CONFIGOPTS"
+ iscygwin || crosscache
+}
+
+preconfig () {
+ extras_preconfig
+}
+
+extras_postconfig () {
+ fix_libtool_script
+}
+
+postconfig () {
+ extras_postconfig
+}
docprefix=$prefix/share
docdir=$docprefix/doc
-cygdocdir=$docdir/Cygwin
+cygdocdir=$docdir/$Cygwin
infodir=$docprefix/info
mandir=$docprefix/man
packagedocdir=$docdir/$base-$ver
rm -rf $inst/$prefix/$i
fi
done
- if [-f $inst/$docprefix/$base ]; then
+ if [ -f $inst/$docprefix/$base ]; then
mkdir -p $packagedocdir
tar -C $inst/$docprefix/$base -cf - . | tar -C $inst/$packagedocdir -xf -
fi
--- /dev/null
+# -*- shell-script -*-
+
+# copy and include extra mknetrel stuff
+extras=${extras-"auto cross doc libtool patch split"}
+[ ! -d $src/$cygwin ] && mkdir -p $src/$cygwin
+i=extras
+cp -pv $mknetrel/$i $src/$cygwin/mknetrel.$i
+for i in $extras; do
+ [ -r $mknetrel/$i ] && cp -pv $mknetrel/$i $src/$cygwin/mknetrel.$i
+ . $src/$cygwin/mknetrel.$i
+done
+cp -pv $extra/$base $src/$cygwin/mknetrel
--- /dev/null
+# -*- shell-script -*-
+# mknetrel.libtool -- libtool fixups
+
+fix_libtool_dltool () {
+ sed -i~ \
+ -e "s/^DLLTOOL=.*/DLLTOOL='$target-dlltool'/" \
+ -e "s/^DLLTOOL=/HOST_CC=gcc\nDLLTOOL=/" \
+ -e "s/^HOST_CC=/SED=sed\nHOST_CC=/" \
+ -e "s/^allow_undefined_flag=.*/allow_undefined_flag=/" \
+ $1
+## -e "s@^sys_lib_dlsearch_path_spec=.*@sys_lib_dlsearch_path_spec='$cygwin_prefix/lib'@"
+}
+
+fix_libtool_dlopen_undefined () {
+ for i in $(find $build -name libtool); do
+ sed -i~ -e 's/\(allow_undefined_flag=.*\)unsupported/\1/' $i
+ done
+}
+
+fix_libtool_script () {
+ [ $base != "libtool" ] || return 0
+ for i in $mknetrel_root/bin/$target-libtool \
+ $cygwin_prefix/bin/$target-libtool; do
+ [ -x "$i" ] && fixtool=$i
+ done
+ for i in $(find $build -name libtool); do
+ [ -n "$fixtool" ] || exit 1
+ cp --backup $fixtool $i
+ done
+}
+
+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
+ sed -i~ \
+ -e 's/ *-L *[^"'"'"' ][^"'"'"' ]*//g'\
+ -e "s@\( \|=\)\(/usr/lib/lib\)@\1$cygwin_root\2@g"\
+ $j
+ done
+ fi
+ done
+
+ # fix some libtool's .dll name
+ mv $inst/$prefix/lib/$dll_prefix$base-$sover $inst/$prefix/bin/$dll_prefix$base-$sover.dll
+
+ # more libtool fixups. I love libtool.
+ sed -i~ \
+ -e "s@^dlname=.*@dlname='../bin/$dll_prefix$base-$sover.dll'@" \
+ -e "s@^library_names=.*@library_names='$dll_prefix$base.dll.a'@" \
+ -e "s@^old_library=.*@old_library='$dll_prefix$base.a'@" \
+ $inst/$prefix/lib/lib$base.la
+}
# mknetrel.patch -- patch sources
#
-dopatchsrc () {
+dopatch () {
cd $src
- cp -p $patch/$package.patch $src/cygwin/
- 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
+ patch -Np1 < $patch/$package.patch
+ cp -p $patch/$package.patch $src/$cygwin/
}
+dodiff () {
+ [ -r $cygwin/.cvsignore ] || cat > $cygwin/.cvsignore <<EOF
+#*
+*.orig
+*.rej
+*~
+.#*
+.bash_mknetrel
+*.patch
+CYGWIN-PATCHES
+MINGW-PATCHES
+Makefile
+GNUmakefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+config.guess
+config.sub
+configure
+libltdl
+ltmain.sh
+CVS
+*[0-9].patch
+EOF
+ diff -purNX$cygwin/.cvsignore $netrel_root/src/$upstream . > $patch/$package.patch-
+ if [ -s $patch/$package.patch- ]; then
+ cp --backup -pv $patch/$package.patch- $patch/$package.patch
+ cp --backup -pv $patch/$package.patch- $src/$cygwin/$package.patch
+ fi
+ rm $patch/$package.patch-
+}
+
patchsrc () {
- [ -r $patch/$package.patch -a ! -r $src/CYGWIN-PATCHES -a ! -r $src/cygwin ] && dopatchsrc
+ [ -r $patch/$package.patch -a ! -r $src/$cygwin/$package.patch ] && dopatch
+ cd $src
+ upstream=$(expr "$package" : '\(.*-[-.0-9]*.*\)-[0-9]*')
+ [ -r $netrel_root/src/$upstream -a -r $patch/$package.patch -a $src/$cygwin/mknetrel -nt $patch/$package.patch ] && dodiff
}
# -*- shell-script -*-
-
-#
# mknetrel.split -- split subpackages
-#
-presplit () { true; }
+extras_preinstall () {
+ :;
+}
-lib_name () {
- echo lib$base$sover
+extras_presplit () {
+ :;
+}
+
+presplit () {
+ :;
}
devel_name () {
- echo $base-devel
+ if ! libdev 2> /dev/null ; then
+ echo $base-devel
+ else
+ if expr "$base" : "\(lib\)" > /dev/null 2>&1; then
+ echo $base-dev
+ else
+ echo lib$base-dev
+ fi
+ fi
}
doc_name () {
echo $base-doc
}
-lib_split () {
+lib_name () {
+ if expr "$base" : "\(lib\)" > /dev/null 2>&1; then
+ echo $base$sover
+ else
+ echo lib$base$sover
+ fi
+}
+
+extras_lib_split () {
mkdir -p ./$prefix/bin || exit 1
mv $inst/$prefix/bin/*.dll ./$prefix/bin
- # dlopen-able .la files go in BIN dir, BIN OR LIB package
- mkdir -p ./$prefix/bin || exit 1
- mv $inst/$prefix/lib/lib*[0-9]*.la ./$prefix/bin
+ # better move dlls to bin, see gmp
+ mkdir -p ./$prefix/lib || exit 1
+ mv $inst/$prefix/lib/*.dll ./$prefix/lib
+ mkdir -p ./$prefix/lib || exit 1
+ mv $inst/$prefix/lib/lib*.la ./$prefix/lib
mkdir -p ./$prefix/share || exit 1
mv $inst/$prefix/share/$base ./$prefix/share
- rmdir $inst/prefix/bin || true
- rmdir $inst/prefix/lib || true
- rmdir $inst/prefix/share || true
+ rmdir $inst/$prefix/bin || true
+ rmdir $inst/$prefix/lib || true
+ rmdir $inst/$prefix/share || true
true
}
-devel_split () {
+extras_devel_split () {
mkdir -p ./$prefix/bin || exit 1
+ mv $inst/bin/*-config ./$prefix/bin
tar -C $inst -cf - ./$prefix/include | tar -xf -
rm -rf $inst/$prefix/include
# Only static .a libs in devel, load time .la files go in LIB or
# BIN package.
mkdir -p ./$prefix/lib || exit 1
mv $inst/$prefix/lib/*.a ./$prefix/lib
+ mv $inst/$prefix/lib/pkgconfig ./$prefix/lib
mkdir -p ./$prefix/share || exit 1
tar -C $inst -cf - ./$prefix/share/aclocal | tar -xf -
rm -rf $inst/$prefix/share/aclocal
- rmdir $inst/prefix/lib || true
- rmdir $inst/prefix/share || true
+ tar -C $inst -cf - ./$prefix/share/libtool | tar -xf -
+ rm -rf $inst/$prefix/share/libtool
+ rmdir $inst/$prefix/lib || true
+ rmdir $inst/$prefix/share || true
true
}
-doc_split () {
+extras_doc_split () {
mkdir -p ./$docprefix || exit 1
mkdir -p ./$infodir || exit 1
tar -C $inst -cf - ./$infodir | tar -xf -
rm -rf $inst/$infodir
+ if [ "$cygwin" == "mingw" ]; then
+ mkdir -p ./$mandir || exit 1
+ tar -C $inst -cf - ./$mandir | tar -xf -
+ rm -rf $inst/$mandir
+ fi
true
}
-prebuild () {
+extras_prebuild () {
for i in $sub_packages; do
rm -rf $inst-$i
mkdir -p $inst-$i || exit 1
done
}
+
+extras_postinstall () {
+ fixdoc
+ fix_libtool_la
-domkdist() {
+ mkdir -p $inst-doc/$docprefix
+ cd $build || exit 1
+
+ cd $src || exit 1
+ install -d -m755 $inst/$packagedocdir
+
+ readmes="$(find . -maxdepth 1 -type f -a -name '[A-Z]*' | egrep -v 'Makefile|GNUmakefile')"
+ install -m644 $readmes $inst/$packagedocdir
+
+ ## Cygwin readmes
+ cd $src || exit 1
+ install -d -m755 $inst/$cygdocdir
+ install -m644 $cygwin/changelog $inst/$cygdocdir/changelog.$Cygwin
+
+ cd $src || exit 1
+ install -m644 $cygwin/README $inst/$packagedocdir/README.$Cygwin
+ install -m644 $cygwin/README $inst/$cygdocdir/$package.README
+ cd $build || exit 1
+ install -m644 $cygwin/out/README $inst/$packagedocdir/README.$Cygwin
+ install -m644 $cygwin/out/README $inst/$cygdocdir/$package.README
+}
+
+hint () {
+ if [ -r $shint ]; then
+ cp $shint $hint
+ else
+ cat > $hint <<EOF
+sdesc: "$subname"
+ldesc: "$subname - no description (missing $package/$(dirname $shint) file)"
+EOF
+ fi
+ grep ^requires: $hint || echo "requires: $depends" >> $hint
+ grep ^build-requires: $hint || echo "build-requires: $build_depends" >> $hint
+}
+
+domkdist () {
#
# Fix up installation slightly
#
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 --owner=0 --group=0 -cjf $tarstem.tar.bz2
+ shint=$src/$cygwin/setup.hint
+ hint=$uploads/setup.hint
+ hint
+ find * -print | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|\.rej$|~$|^.#|CVS|/tags$' | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf $tarstem.tar.bz2
# Any sub-packages
for i in $sub_packages; do
subname=$(${i}_name)
subload=$uploads/$subname
subtarstem=$subload/$subname-$ver
+ shint=$src/$cygwin/$subname.hint
+ hint=$subload/setup.hint
+ depends=$(eval echo '$'${i}_depends)
mkdir -p $subload || exit 1
echo creating $subtarstem.tar.bz2
- f=$src/cygwin/$subname.hint && test -r $f && cp $f $subload/setup.hint
+ hint
+ grep ^external-source: $hint || echo "external-source: $base" >> $hint
cd $inst-$i
hard2soft
- find * -print | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf $subtarstem.tar.bz2
+ find * -print | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|\.rej$|~$|^.#|CVS|/tags$' | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf $subtarstem.tar.bz2
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 --owner=0 --group=0 -cjf "$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 --owner=0 --group=0 -cjf "$tarstem"-src.tar.bz2
+ find $package_src/* -print | egrep -v '\.cvsignore|\.bak$|\.orig$|\.o$|\.rej$|~$|^.#|CVS|%redact|/tags$' | egrep -v "$src_exclude" | sort | tar -T - --no-recursion --owner=0 --group=0 -cjf "$tarstem"-src.tar.bz2
+ ##cd $package_src && tar -cj --exclude='\.cvsignore' --exclude='\.bak$' --exclude='\.orig$' --exclude='\.o$' --exclude='~$' --exclude='^.#' --exclude='CVS' --exclude='%redact' --exclude='/tags$' --owner=0 --group=0 -f "$tarstem"-src.tar.bz2 .
postpackage
}
+devel_split () {
+ extras_devel_split
+}
+doc_split () {
+ extras_doc_split
+}
+lib_split () {
+ extras_lib_split
+}
+
+prebuild () {
+ extras_prebuild
+}
+
+postinstall () {
+ extras_postinstall
+}