wok-next annotate mingw32-runtime/receipt @ rev 20847

mingw32-runtime: repeat the trick
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Jun 23 14:21:02 2018 +0300 (2018-06-23)
parents da5256dcf31a
children d5aab818505e
rev   line source
al@20847 1 # SliTaz package receipt v2.
pascal@12905 2
pascal@12905 3 PACKAGE="mingw32-runtime"
pascal@12905 4 VERSION="3.15.2-mingw32"
pascal@12905 5 CATEGORY="development"
pascal@12905 6 SHORT_DESC="MinGW32 runtime."
pascal@12905 7 MAINTAINER="rcx@zoominternet.net"
pascal@15583 8 LICENSE="PublicDomain"
pascal@12905 9 WEB_SITE="http://www.mingw.org/"
al@20847 10
al@20847 11 TARBALL="mingwrt-$VERSION-src.tar.gz"
pascal@12905 12 WGET_URL="$SF_MIRROR/mingw/$TARBALL"
al@20847 13
pascal@12905 14 MINGW32_ID="i586-pc-mingw32"
pascal@12905 15
al@20847 16 BUILD_DEPENDS="slitaz-toolchain mingw32-binutils mingw32-runtime-headers \
al@20847 17 mingw32-w32api-headers mingw32-gcc-c mingw32-w32api"
pascal@15583 18
al@20847 19 compile_rules() {
al@20847 20 export CFLAGS="${CFLAGS/-mindirect-branch=thunk/}"
al@20847 21 export CXXFLAGS="$CFLAGS"
al@20847 22 echo "CFLAGS=CXXFLAGS='$CFLAGS'"
pascal@12905 23
al@20847 24 # Configuration only needs included if we're in the build/wok environment
al@20847 25 if [ -e $WOK/mingw32-toolchain/stuff/mingw32.conf ] ; then
al@20847 26 . $WOK/mingw32-toolchain/stuff/mingw32.conf
al@20847 27 fi
al@20847 28
pascal@19292 29 sed -i 's|/doc/|/share&|' configure */configure Makefile.in
pascal@12905 30 if [ "$MINGW32_ID" != "$MINGW32_TARGET" ] ; then
pascal@12905 31 echo "ERROR: Conf 'TARGET' string differs from Receipt 'ID' string"
pascal@12905 32 return 1
pascal@12905 33 fi
pascal@12905 34
pascal@12905 35 find $src -name 'Makefile*' | xargs sed -i "s|^inst_.*:= *|&$DESTDIR/|"
pascal@12905 36 mkdir -p $DESTDIR/usr/bin
pascal@12905 37 rm -f -r $src/binutils
al@20847 38
al@20847 39 mkdir -p mingwrt-$VERSION-build
al@20847 40 cd mingwrt-$VERSION-build
al@20847 41
pascal@12905 42 $src/configure \
pascal@12905 43 --prefix=/usr/$MINGW32_TARGET \
pascal@12905 44 --host=$MINGW32_TARGET \
pascal@12905 45 --build=$BUILD_HOST &&
al@20847 46 make \
al@20847 47 CFLAGS="-O2 -mms-bitfields -march=${TARGET_CPU-i386} -I$MINGW32_ROOT/include" \
al@20847 48 LDFLAGS="-s" &&
pascal@12905 49 make install
pascal@12905 50 }
pascal@12905 51
al@20847 52 genpkg_rules() {
al@20847 53 # Configuration only needs included if we're in the build/wok environment
al@20847 54 if [ -e $WOK/mingw32-toolchain/stuff/mingw32.conf ] ; then
al@20847 55 . $WOK/mingw32-toolchain/stuff/mingw32.conf
al@20847 56 fi
al@20847 57
pascal@12905 58 mkdir -p $fs$MINGW32_ROOT
pascal@15583 59 cp -a $install/usr/bin $fs$MINGW32_ROOT
pascal@15583 60 cp -a $install/usr/lib $fs$MINGW32_ROOT
al@20847 61 DEPENDS="mingw32-w32api"
pascal@12905 62 }
pascal@12905 63
al@20847 64 post_install() {
pascal@20248 65 MINGW32_ID="i586-pc-mingw32"
pascal@12905 66 # Archives get stripped during packaging; need to run ranlib
pascal@18732 67 chroot "$1/" find "/usr/$MINGW32_ID/lib/" -name *.a -exec $MINGW32_ID-ranlib {} \;
pascal@12905 68 }
pascal@12905 69
al@20847 70 clean_wok() {
al@20847 71 rm -r mingwrt-$VERSION-build
pascal@12905 72 }