wok-next view glibc/receipt @ rev 17632

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