wok-next view glibc/receipt @ rev 19743

Remake/fix: alsa-lib, alsaplayer; update base (LFS) packages: bash, binutils, bison, bzip2, diffutils, file, findutils, gawk, gcc, gettext, glibc, gmp, m4, mpc-library, mpfr, ncurses, patch, xz; update: tazpkg, cookutils, svgcleaner.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Jun 06 17:37:54 2017 +0300 (2017-06-06)
parents f7d9f142f79d
children c36fd2641cd6
line source
1 # SliTaz package receipt v2.
3 PACKAGE="glibc"
4 VERSION="2.25"
5 CATEGORY="meta"
6 SHORT_DESC="The GNU C libraries"
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 gawk gettext bison \
16 texinfo"
17 # slitaz-i18n should present in wok
18 SPLIT="glibc-base glibc-locale nscd glibc-dev"
20 # Locales include to glibc-base package by default, other locales are in: locale-** and glibc-locale
21 DEFAULT_LOCALE="en_US en_GB"
23 # Handle multiarch compilation.
24 case "$ARCH" in
25 arm*|x86_64) VERSION="2.13";;
26 esac
28 # Handle multiarch installation.
29 case "$SLITAZ_ARCH" in
30 arm*|x86_64) VERSION="2.13";;
31 esac
34 # Rules to compile & install the temporary toolchain.
35 cook_tmp_toolchain()
36 {
37 unset CFLAGS CXXFLAGS
38 echo "CFLAGS += -O2 -march=${ARCH/i386/i486} -mtune=${ARCH/i386/i486}" > configparms ;;
40 {
41 # Build in a separate directory.
42 mkdir glibc-build
43 cd glibc-build
45 ../configure \
46 --host=$HOST_SYSTEM \
47 --build=$($src/scripts/config.guess) \
48 --disable-profile \
49 --enable-add-ons \
50 --enable-kernel=2.6.32 \
51 --with-headers=/tools/include \
52 libc_cv_forced_unwind=yes \
53 libc_cv_c_cleanup=yes &&
54 make -j1 &&
55 make install
56 } || return 1
58 # Link compiler to this new glibc.
59 SPECS=$(dirname $($HOST_SYSTEM-gcc -print-libgcc-file-name))/specs
60 $HOST_SYSTEM-gcc -dumpspecs | sed \
61 -e 's@/lib\(64\)\?/ld@/tools&@g' \
62 -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
63 unset SPECS
64 }
66 # Rules to configure and make the package.
67 compile_rules()
68 {
69 # Glibc needs ld.so.conf in the install destdir.
70 mkdir -p $install/etc
71 touch $install/etc/ld.so.conf
73 # Read the INSTALL file in glibc. Also Glibc don't build with -Os flag.
74 # --enale-kernel use latest SliTaz Kernel version. From Glibc INSTALL:
75 # "The higher the VERSION number is, the less compatibility code is
76 # added, and the faster the code gets."
77 unset CFLAGS CXXFLAGS
78 echo "CFLAGS += -O2 -march=${ARCH/i386/i486} -mtune=${ARCH/i386/i486}" > configparms ;;
80 {
81 mkdir build
82 cd build
83 $src/configure \
84 --disable-profile \
85 --enable-add-ons \
86 --enable-obsolete-rpc \
87 --enable-kernel=2.6.32 \
88 --libexecdir=/usr/lib/glibc \
89 --build=$HOST_SYSTEM \
90 --host=$HOST_SYSTEM \
91 --target=$BUILD_SYSTEM &&
92 make -j1 && make install_root=$DESTDIR install
93 } || return 1
95 # nscd
96 mkdir -p $install/etc/init.d $install/var/db
97 cp $stuff/nscd $install/etc/init.d
98 chmod +x $fs/etc/init.d/nscd
100 # nsswitch.conf
101 cp $stuff/nsswitch.conf $install/etc
103 # If temporary toolchain was previously used, switch to regular toolchain.
104 if [ -d /tools ]; then
105 mv /tools/bin/ld /tools/bin/ld-old
106 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
107 mv /tools/bin/ld-new /tools/bin/ld
108 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
109 gcc -dumpspecs | sed -e 's@/tools@@g' \
110 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
111 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
112 $(dirname $(gcc --print-libgcc-file-name))/specs
113 fi
114 }
116 # i18n
117 get_locales()
118 {
119 local path=$1
120 for i in $DEFAULT_LOCALE; do
121 cp $install/$path/i18n/locales/$i $fs/usr/share/i18n/locales
122 done
123 }
125 mk_dirs()
126 {
127 mkdir -p \
128 $fs/etc \
129 $fs/lib \
130 $fs/usr/bin \
131 $fs/usr/lib/gconv \
132 $fs/usr/lib/locale \
133 $fs/usr/share/zoneinfo/America \
134 $fs/usr/share/zoneinfo/Europe \
135 $fs/usr/share/i18n/locales \
136 $fs/usr/share/i18n/charmaps \
137 $fs/usr/share/locale
138 }
140 # Rules to gen a SliTaz package suitable for Tazpkg.
141 genpkg_rules()
142 {
143 case $PACKAGE in
144 glibc)
145 LOCALE=""
146 ;;
147 glibc-base)
148 case "$ARCH" in
149 arm*)
150 # Eglibc is cross compiled by cross to have a toolchain so we can
151 # use these files instead of recooking it. ARM use Eglibc
152 echo "Using cross compiled Eglibc..."
153 install="/cross/$ARCH/sysroot"
154 copy libc_nonshared.a libpthread_nonshared.a
155 ;;
156 x86_64)
157 # EXPERIMENTAL: Glibc is cross compiled by cross to have a
158 # toolchain so we can use these files instead of recooking it.
159 echo "Using cross compiled Glibc..."
160 install="/usr/cross/$ARCH"
161 copy libc_nonshared.a libpthread_nonshared.a
162 ;;
163 esac
164 copy \
165 ld-*.so* ld.so* \
166 libanl-*.so* libanl.so* \
167 libc-*.so* libc.so* \
168 libcrypt-*.so* libcrypt.so* \
169 libdl-*.so* libdl.so* \
170 libm-*.so* libm.so* \
171 libnsl-*.so* libnsl.so* \
172 libnss_compat-*.so* libnss_compat.so* \
173 libnss_dns-*.so* libnss_dns.so* \
174 libnss_files-*.so* libnss_files.so* \
175 libpthread-*.so* libpthread.so* \
176 libresolv-*.so* libresolv.so* \
177 librt-*.so* librt.so* \
178 libthread_db-*.so* libthread_db.so* \
179 libutil-*.so* libutil.so* \
180 \
181 UNICODE.so gconv-modules ANSI_X3.110.so ISO8859-1.so \
182 ISO8859-15.so UTF-16.so CP1252.so IBM437.so IBM850.so \
183 \
184 i18n iso14651_t1 iso14651_t1_common \
185 translit_neutral translit_combining translit_circle \
186 translit_cjk_compat translit_compat translit_font \
187 translit_fraction translit_narrow translit_small \
188 translit_wide \
189 \
190 locale localedef locale.alias UTF-8.gz UTC rpc \
191 nsswitch.conf \
192 $DEFAULT_LOCALE
194 case "$ARCH" in
195 x86_64)
196 # Fix libraries search path
197 sed -i "s|/usr/cross/$ARCH||g" $fs/lib/libc.so
198 sed -i "s|/usr/cross/$ARCH||g" $fs/lib/libpthread.so
199 ;;
200 esac
201 CAT="base-system|minimal libraries and UTF-8 support for SliTaz"
202 ;;
203 glibc-locale)
204 copy gconv/ locale/ i18n/ iconv tzselect
205 # Remove glibc-base files
206 remove_already_packed
208 # Remove files provided by locale-pack.
209 . $WOK/slitaz-i18n/stuff/locale-pack.conf
210 echo -n "Removing locale: "
211 for i in $LOCALE_PACK; do
212 echo -n "$i "
213 rm -rf $fs/usr/share/locale/$i
214 done
215 status
216 CAT="system-tools|locale files and utilities"
217 DEPENDS="glibc-base"
218 ;;
219 nscd)
220 copy /var/db/ nscd getent nscd.conf
221 CAT="base-system|name-server caching daemon"
222 ;;
223 glibc-dev)
224 cp -a $install/* $fs
225 remove_already_packed
226 DEPENDS="glibc-base"
227 ;;
228 esac
229 }