wok-next view glibc/receipt @ rev 19879

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