wok-next view glibc/receipt @ rev 19561

Initial commit to wok-next (SliTaz v.6 now): update 61 packages (about) according to LFS 7.10
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Dec 16 01:16:56 2016 +0200 (2016-12-16)
parents 9d1b90ff4cae
children 6b0977689017
line source
1 # SliTaz package receipt.
3 PACKAGE="glibc"
4 VERSION="2.24"
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 WEB_SITE="http://www.gnu.org/software/libc/"
11 TARBALL="$PACKAGE-$VERSION.tar.gz"
12 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
14 DEPENDS="glibc-base glibc-locale glibc-dev"
15 BUILD_DEPENDS="linux-api-headers autoconf bash advancecomp \
16 gawk gettext-tools bison"
18 # Genpkg order for tazwok.
19 COOK_OPT="genpkg=glibc-base:glib-locale:glibc-dev"
21 # Rules to compile & install the temporary toolchain.
22 cook_tmp_toolchain()
23 {
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 # glibc no longer support i386, so use -march=i486 for better compatibility.
34 # If i686 ???
35 unset CFLAGS CXXFLAGS
36 case $ARCH in
37 i386|i486)
38 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
39 *)
40 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
41 esac
43 {
44 # Build in a separate directory.
45 mkdir glibc-build
46 cd glibc-build
48 ../configure \
49 --host=$HOST_SYSTEM \
50 --build=$($src/scripts/config.guess) \
51 --disable-profile \
52 --enable-add-ons \
53 --enable-kernel=2.6.32 \
54 --with-headers=/tools/include \
55 libc_cv_forced_unwind=yes \
56 libc_cv_c_cleanup=yes &&
57 make -j1 &&
58 make install
59 } || return 1
61 # Link compiler to this new glibc.
62 SPECS=`dirname $($HOST_SYSTEM-gcc -print-libgcc-file-name)`/specs
63 $HOST_SYSTEM-gcc -dumpspecs | sed \
64 -e 's@/lib\(64\)\?/ld@/tools&@g' \
65 -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
66 unset SPECS
67 }
69 # Rules to configure and make the package.
70 compile_rules()
71 {
72 # # SliTaz is a Busybox based OS, why we so small and fast. Using gawk by
73 # # default to build package will not ensure package work with Busybox awk
74 # # and so should NOT be use to cook.
75 # if [ -x /usr/bin/cook ]; then
76 # [ -d "/var/lib/tazpkg/installed/gawk" ] || tazpkg get-install gawk
77 # fi
79 # # Make 4.x support...
80 # sed -i 's/3\.79/4.* | &/' configure*
81 # # Fixes and patches from LFS, Redhat
82 # sed -i -e 's/"db1"/& \&\& $name ne "nss_test1"/' scripts/test-installation.pl
83 # sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in
85 # # Glibc misc Bug Fixes
86 # patch -Np1 -i $stuff/glibc-2.14.1-fixes-1.patch
88 # # Glibc Bug Sort Relocatable Objects Patch
89 # #patch -Np1 -i $stuff/glibc-2.14.1-sort-1.patch
91 # # Fix a bug that prevents Glibc from building with GCC-4.6.2
92 # patch -Np1 -i $stuff/glibc-2.14.1-gcc_fix-1.patch
94 # # Revert commit causing issues with crappy DNS servers
95 # patch -Np1 -i $stuff/glibc-2.14-revert-4768ae77.patch
97 # # re-export RPC interface until libtirpc is ready as a replacement
98 # # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=acee4873 (only fedora branch...)
99 # patch -Np1 -i $stuff/glibc-2.14-reexport-rpc-interface.patch
100 # # http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=bdd816a3 (only fedora branch...)
101 # patch -Np1 -i $stuff/glibc-2.14-reinstall-nis-rpc-headers.patch
102 # # GHOST
103 # patch -Np1 -i $stuff/glibc-2.14.1-CVE-2015-0235.patch
105 # # Fix a stack imbalance that occurs under some conditions:
106 # sed -i '195,213 s/PRIVATE_FUTEX/FUTEX_CLOCK_REALTIME/' \
107 # nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S \
108 # nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
110 # Glibc needs ld.so.conf in the install destdir.
111 mkdir -p $WOK/$PACKAGE/install/etc
112 touch $WOK/$PACKAGE/install/etc/ld.so.conf
114 # mkdir ../glibc-build && cd ../glibc-build
116 # Read the INSTALL file in glibc. Also Glibc dont build with -Os flag.
117 # --enale-kernel use latest SliTaz Kernel version. From Glibc INSTALL:
118 # "The higher the VERSION number is, the less compatibility code is
119 # added, and the faster the code gets."
120 unset CFLAGS CXXFLAGS
121 case "$ARCH" in
122 i386|i486)
123 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
124 *)
125 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
126 esac
128 # Glibc FHS Patch - LFS 7.10
129 patch -p1 -i $stuff/glibc-2.24-fhs-1.patch
131 {
132 mkdir build
133 cd build
134 $src/configure \
135 --disable-profile \
136 --enable-add-ons \
137 --enable-kernel=2.6.32 \
138 --libexecdir=/usr/lib/glibc \
139 --build=$HOST_SYSTEM \
140 --host=$HOST_SYSTEM \
141 --target=$BUILD_SYSTEM &&
142 make -j1 && make install_root=$DESTDIR install
143 } || return 1
145 for i in $DESTDIR/usr/share/i18n/charmaps/*.gz ; do
146 advdef -z4 $i
147 done
149 # If temporary toolchain was previously used, switch to regular toolchain.
150 [ -d /tools ] || return
151 mv /tools/bin/ld /tools/bin/ld-old
152 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
153 mv /tools/bin/ld-new /tools/bin/ld
154 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
155 gcc -dumpspecs | sed -e 's@/tools@@g' \
156 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
157 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
158 `dirname $(gcc --print-libgcc-file-name)`/specs
159 }
161 # Rules to gen a SliTaz package suitable for Tazpkg.
162 genpkg_rules()
163 {
164 LOCALE=""
165 mkdir -p $fs/var
167 # # Remove build directory.
168 # rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
169 # rm -rf $WOK/$PACKAGE/$PACKAGE-build
171 # check install
172 ls $install/lib/ | tr '\n' ' ' | fold -s
173 }