# SliTaz package receipt. PACKAGE="mingw32-gcc" SOURCE="gcc-core" VERSION="3.4.5-20060117-2" CATEGORY="development" SHORT_DESC="MinGW32 gcc, for C, C++, and Ada." MAINTAINER="rcx@zoominternet.net" LICENSE="GPL2" PROVIDE="mingw32-gcc-c" TARBALL="$SOURCE-$VERSION-src.tar.gz" EXTRA_SOURCE_FILES="gcc-g++-$VERSION-src.tar.gz gcc-ada-$VERSION-src.tar.gz" WEB_SITE="http://www.mingw.org/" MINGW32_URL="$SF_MIRROR/mingw" WGET_URL="$MINGW32_URL/$TARBALL" MINGW32_ID="i586-pc-mingw32" TAGS="compiler C C++ ada" DEPENDS="glibc-base mingw32-binutils mingw32-w32api-headers \ mingw32-runtime-headers mingw32-w32api mingw32-runtime" BUILD_DEPENDS="slitaz-toolchain bison flex gcc49 mingw32-binutils \ mingw32-runtime-headers mingw32-w32api-headers mingw32-gcc-c \ mingw32-w32api mingw32-runtime" # Configuration only needs included if we're in the build/wok environment if [ -e $WOK/mingw32-toolchain/stuff/mingw32.conf ] ; then . $WOK/mingw32-toolchain/stuff/mingw32.conf fi # What is the latest version available today? current_version() { wget -O - https://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/ 2>/dev/null | \ sed '/scope="row/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \ sed '/scope="row/!d;s|.*/gcc-||;s|/.*||;q' } # Rules to configure and make the package. compile_rules() { mkdir -p $DESTDIR/usr/share/man/man1 $DESTDIR/usr/share/man/man7 if [ "$MINGW32_ID" != "$MINGW32_TARGET" ] ; then echo "ERROR: Conf 'TARGET' string differs from Receipt 'ID' string" return 1 fi ln -s . gcc-$VERSION for tgz in $EXTRA_SOURCE_FILES; do [ -s $SOURCES_REPOSITORY/$tgz ] || wget -P $SOURCES_REPOSITORY $MINGW32_URL/$tgz [ -s $SOURCES_REPOSITORY/$tgz ] && tar xzf $SOURCES_REPOSITORY/$tgz && continue echo "Can't download $MINGW32_URL/$tgz abort." return 1 done rm -f -r $src/binutils mkdir -p $SOURCE-$VERSION-build cd $SOURCE-$VERSION-build export CC=gcc-49 export CXX=gcc-49 $src/configure \ --prefix=/usr \ --libexecdir=/usr/lib \ --infodir=/usr/share/info \ --mandir=/usr/share/man \ --with-sysroot=$MINGW32_ROOT \ --disable-shared \ --disable-debug \ --target=$MINGW32_TARGET \ --enable-languages=c,c++,ada \ --enable-threads=win32 \ --disable-win32-registry \ --enable-sjlj-exceptions \ $CONFIGURE_ARGS && make -j 4 CFLAGS="-O2 -fomit-frame-pointer" LDFLAGS="-s" && make DESTDIR=$DESTDIR install 2>&1 | grep -v fixinc/fixincl } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { mkdir -p $fs/usr/lib $fs$MINGW32_ROOT cp -a $install$MINGW32_ROOT/* $fs$MINGW32_ROOT rm $fs$MINGW32_ROOT/lib/*.la cp -a $install/usr/bin $fs/usr cp -a $install/usr/include $fs/usr # do not need to copy lib/libiberty.a mkdir -p $fs/usr/lib cp -a $install/usr/lib/gcc $fs/usr/lib } # Rules to setup after installation post_install() { # Archives get stripped during packaging; need to run ranlib chroot "$1/" find "/usr/lib/gcc/$MINGW32_ID/" -name *.a -exec $MINGW32_ID-ranlib {} \; chroot "$1/" find "/usr/$MINGW32_ID/lib/" -name *.a -exec $MINGW32_ID-ranlib {} \; } # Rules to clean the package clean_wok() { rm -rf $SOURCE-$VERSION-build }