wok annotate glibc/receipt @ rev 12269

Up: glibc (2.14.1)
author Christophe Lincoln <pankso@slitaz.org>
date Thu Apr 12 16:31:36 2012 +0200 (2012-04-12)
parents 52fadc2d223d
children 380ffe05937a
rev   line source
pankso@9 1 # SliTaz package receipt.
pankso@9 2
pankso@9 3 PACKAGE="glibc"
pankso@12269 4 VERSION="2.14.1"
pankso@3475 5 CATEGORY="meta"
pankso@9 6 SHORT_DESC="The GNU C libraries. This package is used to compile the libc."
pankso@9 7 MAINTAINER="pankso@slitaz.org"
pankso@9 8 TARBALL="$PACKAGE-$VERSION.tar.gz"
pankso@9 9 WEB_SITE="http://www.gnu.org/software/libc/"
pankso@9 10 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
pankso@9713 11
pankso@9713 12 DEPENDS="glibc-base glibc-locale glibc-dev"
pankso@12269 13 BUILD_DEPENDS="linux-api-headers autoconf bash"
pankso@9713 14
pankso@9713 15 # Genpkg order for tazwok.
gokhlayeh@9253 16 COOK_OPT="genpkg=glibc-base:glibc-extra-samba:glib-locale:glibc-dev"
gokhlayeh@8189 17
gokhlayeh@8189 18 # Rules to compile & install the temporary toolchain.
gokhlayeh@8189 19 cook_tmp_toolchain()
gokhlayeh@8189 20 {
gokhlayeh@8189 21 cd $src
pankso@10166 22
pankso@12269 23 # Glibc Bug Fixes Patch from LFS
pankso@12269 24 patch -Np1 -i $stuff/glibc-2.14.1-fixes-1.patch
pankso@12269 25 # Glibc Bug Sort Relocatable Objects Patch
pankso@12269 26 patch -Np1 -i $stuff/glibc-2.14.1-sort-1.patch
pankso@12269 27 # Fix a bug that prevents Glibc from building with GCC-4.6.2
pankso@12269 28 patch -Np1 -i stuff/glibc-2.14.1-gcc_fix-1.patch
gokhlayeh@8189 29
gokhlayeh@8189 30 # Build in a separate directory.
gokhlayeh@8189 31 mkdir ../glibc-build && cd ../glibc-build
gokhlayeh@8189 32
gokhlayeh@8189 33 # glibc no longer support i386, so use -march=i486 for better compatibility.
pankso@10024 34 # If i686 ???
slaxemulator@10420 35 unset CFLAGS CXXFLAGS
gokhlayeh@8189 36 case $ARCH in
slaxemulator@10420 37 i386|i486)
pankso@12008 38 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
slaxemulator@10420 39 *)
pankso@12006 40 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
gokhlayeh@8189 41 esac
gokhlayeh@8189 42
gokhlayeh@8189 43 { $src/configure \
slaxemulator@10420 44 --host=$HOST_SYSTEM \
gokhlayeh@8189 45 --build=$($src/scripts/config.guess) \
gokhlayeh@8189 46 --disable-profile --enable-add-ons \
slaxemulator@10420 47 --enable-kernel=2.6.30 --with-headers=/tools/include \
gokhlayeh@8189 48 libc_cv_forced_unwind=yes libc_cv_c_cleanup=yes &&
gokhlayeh@8189 49 make &&
gokhlayeh@8189 50 make install
gokhlayeh@8189 51 } || return 1
gokhlayeh@8189 52
gokhlayeh@8189 53 # Link compiler to this new glibc.
slaxemulator@10420 54 SPECS=`dirname $($HOST_SYSTEM-gcc -print-libgcc-file-name)`/specs
slaxemulator@10420 55 $HOST_SYSTEM-gcc -dumpspecs | sed \
gokhlayeh@8189 56 -e 's@/lib\(64\)\?/ld@/tools&@g' \
gokhlayeh@8189 57 -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
gokhlayeh@8189 58 unset SPECS
gokhlayeh@8189 59 }
pankso@9 60
pankso@9 61 # Rules to configure and make the package.
pankso@9 62 compile_rules()
pankso@9 63 {
pankso@10031 64 cd $src
slaxemulator@10351 65
slaxemulator@10351 66 # SliTaz is a Busybox based OS, why we so small and fast. Using gawk by
slaxemulator@10351 67 # default to build package will not ensure package work with Busybox awk
slaxemulator@10351 68 # and so should NOT be use to cook.
slaxemulator@10351 69 if [ -x /usr/bin/cook ]; then
slaxemulator@10351 70 [ -d "/var/lib/tazpkg/installed/gawk" ] || tazpkg get-install gawk
slaxemulator@10351 71 fi
slaxemulator@10351 72
pankso@12269 73 # Fixes and patches from LFS, Redhat
gokhlayeh@8748 74 sed -i -e 's/"db1"/& \&\& $name ne "nss_test1"/' scripts/test-installation.pl
gokhlayeh@8189 75 sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
gokhlayeh@8189 76
pankso@12269 77 # Glibc misc Bug Fixes
pankso@12269 78 patch -Np1 -i $stuff/glibc-2.14.1-fixes-1.patch
pankso@12269 79
pankso@12269 80 # Glibc Bug Sort Relocatable Objects Patch
pankso@12269 81 #patch -Np1 -i $stuff/glibc-2.14.1-sort-1.patch
pankso@12269 82
pankso@12269 83 # Fix a bug that prevents Glibc from building with GCC-4.6.2
pankso@12269 84 patch -Np1 -i $stuff/glibc-2.14.1-gcc_fix-1.patch
pankso@12269 85
pankso@12269 86 # Revert commit causing issues with crappy DNS servers
pankso@12269 87 patch -Np1 -i $stuff/glibc-2.14-revert-4768ae77.patch
pankso@12269 88
pankso@12269 89 # re-export RPC interface until libtirpc is ready as a replacement
pankso@12269 90 # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=acee4873 (only fedora branch...)
pankso@12269 91 patch -Np1 -i $stuff/glibc-2.14-reexport-rpc-interface.patch
pankso@12269 92 # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=bdd816a3 (only fedora branch...)
pankso@12269 93 patch -Np1 -i $stuff/glibc-2.14-reinstall-nis-rpc-headers.patch
gokhlayeh@8748 94
gokhlayeh@8748 95 # Fix a stack imbalance that occurs under some conditions:
gokhlayeh@8748 96 sed -i '195,213 s/PRIVATE_FUTEX/FUTEX_CLOCK_REALTIME/' \
gokhlayeh@8748 97 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S \
gokhlayeh@8748 98 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
gokhlayeh@8189 99
pankso@10031 100 # Glibc needs ld.so.conf in the install destdir.
gokhlayeh@8189 101 mkdir -p $WOK/$PACKAGE/install/etc
gokhlayeh@8189 102 touch $WOK/$PACKAGE/install/etc/ld.so.conf
pankso@10031 103 mkdir ../glibc-build && cd ../glibc-build
pankso@10031 104
pankso@10031 105 # Read the INSTALL file in glibc. Also Glibc dont build with -Os flag.
pankso@10031 106 # --enale-kernel use latest SliTaz Kernel version. From Glibc INSTALL:
pankso@10031 107 # "The higher the VERSION number is, the less compatibility code is
pankso@10031 108 # added, and the faster the code gets."
pankso@10031 109 unset CFLAGS CXXFLAGS
pankso@10031 110 case "$ARCH" in
pankso@10024 111 i386|i486)
pankso@12008 112 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
pankso@10024 113 *)
pankso@12008 114 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
pankso@10024 115 esac
gokhlayeh@8189 116 { $src/configure \
pankso@1153 117 --disable-profile \
pankso@1153 118 --enable-add-ons \
pankso@10034 119 --enable-kernel=2.6.30 \
pankso@10024 120 --libexecdir=/usr/lib/glibc \
pankso@10147 121 --build=$HOST_SYSTEM \
pankso@12269 122 --host=$HOST_SYSTEM \
pankso@12269 123 --target=$BUILD_SYSTEM &&
pankso@10031 124 make && make install_root=$DESTDIR install
gokhlayeh@8189 125 } || return 1
gokhlayeh@8189 126
pankso@10031 127 # If temporary toolchain was previously used, switch to regular toolchain.
gokhlayeh@8189 128 [ -d /tools ] || return
gokhlayeh@8189 129 mv /tools/bin/ld /tools/bin/ld-old
gokhlayeh@8189 130 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
gokhlayeh@8189 131 mv /tools/bin/ld-new /tools/bin/ld
gokhlayeh@8189 132 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
gokhlayeh@8189 133 gcc -dumpspecs | sed -e 's@/tools@@g' \
gokhlayeh@8189 134 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
gokhlayeh@8189 135 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
gokhlayeh@8189 136 `dirname $(gcc --print-libgcc-file-name)`/specs
pankso@9 137 }
pankso@9 138
pankso@9 139 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@9 140 genpkg_rules()
pankso@9 141 {
pankso@2701 142 LOCALE=""
pankso@9 143 mkdir -p $fs/var
gokhlayeh@8189 144
gokhlayeh@8189 145 # Remove build directory.
pankso@9713 146 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
pankso@9713 147 rm -rf $WOK/$PACKAGE/$PACKAGE-build
pankso@9 148 }