wok-current view glibc/receipt @ rev 24032
modified get-teamviewer to be able to fetch versions < 13
author | Hans-G?nter Theisgen |
---|---|
date | Tue Apr 06 14:38:05 2021 +0100 (2021-04-06) |
parents | d411d873dbdf |
children | 324b3fa82b76 |
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 advancecomp"
16 # Genpkg order for tazwok.
17 COOK_OPT="genpkg=glibc-base: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 -j1 &&
53 make -j1 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 # SliTaz is a Busybox based OS, why we so small and fast. Using gawk by
68 # default to build package will not ensure package work with Busybox awk
69 # and so should NOT be use to cook.
70 if [ -x /usr/bin/cook ]; then
71 [ -d "/var/lib/tazpkg/installed/gawk" ] || tazpkg get-install gawk
72 fi
74 # Make 4.x support...
75 sed -i 's/3\.79/4.* | &/' configure*
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 # Update for binutils 2.29, see https://sourceware.org/bugzilla/show_bug.cgi?id=21661
101 sed -i 's|obstack_compat;|obstack_compat __attribute__ ((nocommon));|' malloc/obstack.c
103 # Fix a stack imbalance that occurs under some conditions:
104 sed -i '195,213 s/PRIVATE_FUTEX/FUTEX_CLOCK_REALTIME/' \
105 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S \
106 nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
108 # Glibc needs ld.so.conf in the install destdir.
109 mkdir -p $WOK/$PACKAGE/install/etc
110 touch $WOK/$PACKAGE/install/etc/ld.so.conf
111 mkdir ../glibc-build && cd ../glibc-build
113 # Read the INSTALL file in glibc. Also Glibc dont build with -Os flag.
114 # --enale-kernel use latest SliTaz Kernel version. From Glibc INSTALL:
115 # "The higher the VERSION number is, the less compatibility code is
116 # added, and the faster the code gets."
117 unset CFLAGS CXXFLAGS
118 case "$ARCH" in
119 i386|i486)
120 echo "CFLAGS += -O2 -march=i486 -mtune=i486" > configparms ;;
121 *)
122 echo "CFLAGS += -O2 -march=$ARCH -mtune=$ARCH" > configparms ;;
123 esac
124 { $src/configure \
125 --disable-profile \
126 --enable-add-ons \
127 --enable-kernel=2.6.30 \
128 --libexecdir=/usr/lib/glibc \
129 --build=$HOST_SYSTEM \
130 --host=$HOST_SYSTEM \
131 --target=$BUILD_SYSTEM &&
132 make -j1 && make install_root=$DESTDIR install
133 } || return 1
134 for i in $DESTDIR/usr/share/i18n/charmaps/*.gz ; do
135 advdef -z4 $i
136 done
138 # If temporary toolchain was previously used, switch to regular toolchain.
139 [ -d /tools ] || return
140 mv /tools/bin/ld /tools/bin/ld-old
141 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
142 mv /tools/bin/ld-new /tools/bin/ld
143 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
144 gcc -dumpspecs | sed -e 's@/tools@@g' \
145 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
146 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
147 `dirname $(gcc --print-libgcc-file-name)`/specs
148 }
150 # Rules to gen a SliTaz package suitable for Tazpkg.
151 genpkg_rules()
152 {
153 LOCALE=""
154 mkdir -p $fs/var
156 # Remove build directory.
157 rm -rf $WOK/$PACKAGE/source/$PACKAGE-build
158 rm -rf $WOK/$PACKAGE/$PACKAGE-build
160 # check install
161 ls $install/lib/
162 }