wok-next annotate mingw32-gcc/receipt @ rev 21165

Update proot
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Mar 23 12:48:28 2019 +0200 (2019-03-23)
parents d5aab818505e
children
rev   line source
al@20846 1 # SliTaz package receipt v2.
pascal@12905 2
pascal@12905 3 PACKAGE="mingw32-gcc"
pascal@12905 4 VERSION="3.4.5-20060117-2"
pascal@12905 5 CATEGORY="development"
al@20846 6 SHORT_DESC="MinGW32 gcc, for C, C++, and Ada"
al@21020 7 MAINTAINER="devel@slitaz.org"
pascal@15000 8 LICENSE="GPL2"
al@20846 9 WEB_SITE="http://www.mingw.org/"
al@20846 10
al@20846 11 TARBALL="gcc-core-$VERSION-src.tar.gz"
al@20846 12 WGET_URL="$SF_MIRROR/mingw/$TARBALL"
al@20846 13
pascal@14337 14 EXTRA_SOURCE_FILES="gcc-g++-$VERSION-src.tar.gz gcc-ada-$VERSION-src.tar.gz"
pascal@12905 15 MINGW32_ID="i586-pc-mingw32"
pascal@12905 16
pascal@15000 17 BUILD_DEPENDS="slitaz-toolchain bison flex mingw32-binutils \
pascal@15000 18 mingw32-runtime-headers mingw32-w32api-headers mingw32-gcc-c \
al@20846 19 mingw32-w32api mingw32-runtime perl"
pascal@15000 20
al@20846 21 compile_rules() {
al@20846 22 export CFLAGS="${CFLAGS/-mindirect-branch=thunk/}"
al@20846 23 export CXXFLAGS="$CFLAGS"
al@20846 24 echo "CFLAGS=CXXFLAGS='$CFLAGS'"
pascal@12905 25
al@20846 26 # Configuration only needs included if we're in the build/wok environment
al@21020 27 if [ -e $WOK/mingw32-toolchain/stuff/mingw32.conf ]; then
al@20846 28 . $WOK/mingw32-toolchain/stuff/mingw32.conf
al@20846 29 fi
al@20846 30
al@21020 31 mkdir -p $install/usr/share/man/man1 $install/usr/share/man/man7
al@21020 32 if [ "$MINGW32_ID" != "$MINGW32_TARGET" ]; then
pascal@12905 33 echo "ERROR: Conf 'TARGET' string differs from Receipt 'ID' string"
pascal@12905 34 return 1
pascal@12905 35 fi
pascal@12905 36
pascal@12905 37 ln -s . gcc-$VERSION
pascal@14337 38 for tgz in $EXTRA_SOURCE_FILES; do
al@20846 39 [ -s $SRC/$tgz ] || wget -P $SRC $SF_MIRROR/mingw/$tgz
al@20846 40 [ -s $SRC/$tgz ] && tar xzf $SRC/$tgz && continue
al@20846 41 echo "Can't download $SF_MIRROR/mingw/$tgz abort."
pascal@12905 42 return 1
pascal@12905 43 done
pascal@12905 44
al@20846 45 rm -rf $src/binutils
al@20846 46
al@20846 47 mkdir -p gcc-core-$VERSION-build
al@20846 48 cd gcc-core-$VERSION-build
al@20846 49
pascal@12905 50 $src/configure \
pascal@12905 51 --prefix=/usr \
pascal@12905 52 --libexecdir=/usr/lib \
pascal@12905 53 --infodir=/usr/share/info \
pascal@12905 54 --mandir=/usr/share/man \
pascal@12905 55 --with-sysroot=$MINGW32_ROOT \
pascal@12905 56 --disable-shared \
pascal@12905 57 --disable-debug \
pascal@12905 58 --target=$MINGW32_TARGET \
pascal@12905 59 --enable-languages=c,c++,ada \
pascal@12905 60 --enable-threads=win32 \
pascal@12905 61 --disable-win32-registry \
pascal@12905 62 --enable-sjlj-exceptions \
pascal@12905 63 $CONFIGURE_ARGS &&
al@21020 64 make \
al@20846 65 CFLAGS="-O2 -fomit-frame-pointer" \
al@20846 66 LDFLAGS="-s" &&
al@21020 67 make DESTDIR=$install install
pascal@12905 68 }
pascal@12905 69
al@20846 70 genpkg_rules() {
al@20846 71 # Configuration only needs included if we're in the build/wok environment
al@21020 72 if [ -e $WOK/mingw32-toolchain/stuff/mingw32.conf ]; then
al@20846 73 . $WOK/mingw32-toolchain/stuff/mingw32.conf
al@20846 74 fi
al@20846 75
pascal@12905 76 mkdir -p $fs/usr/lib $fs$MINGW32_ROOT
pascal@15000 77 cp -a $install$MINGW32_ROOT/* $fs$MINGW32_ROOT
pascal@12905 78 rm $fs$MINGW32_ROOT/lib/*.la
al@20846 79 cp -a $install/usr/bin $fs/usr
pascal@15000 80 cp -a $install/usr/include $fs/usr
pascal@12905 81 # do not need to copy lib/libiberty.a
pascal@12905 82 mkdir -p $fs/usr/lib
pascal@15000 83 cp -a $install/usr/lib/gcc $fs/usr/lib
al@20846 84 DEPENDS="glibc-base mingw32-binutils mingw32-w32api-headers \
al@20846 85 mingw32-runtime-headers mingw32-w32api mingw32-runtime"
al@20846 86 PROVIDE="mingw32-gcc-c"
al@21044 87 TAGS="compiler C C++ Ada"
pascal@12905 88 }
pascal@12905 89
al@20846 90 post_install() {
pascal@20248 91 MINGW32_ID="i586-pc-mingw32"
pascal@12905 92 # Archives get stripped during packaging; need to run ranlib
pascal@18732 93 chroot "$1/" find "/usr/lib/gcc/$MINGW32_ID/" -name *.a -exec $MINGW32_ID-ranlib {} \;
al@20846 94 chroot "$1/" find "/usr/$MINGW32_ID/lib/" -name *.a -exec $MINGW32_ID-ranlib {} \;
pascal@12905 95 }