wok-next view glibc/receipt @ rev 20785

gpgme: add gnupg, since build can not find gpgconf and gpg
author Erkan Yilmaz <erkan@slitaz.org>
date Sat Jun 09 07:02:52 2018 +0000 (2018-06-09)
parents 6c73b944e8dd
children d5aab818505e
line source
1 # SliTaz package receipt v2.
3 PACKAGE="glibc"
4 VERSION="2.26"
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/"
10 LFS="http://www.linuxfromscratch.org/lfs/view/stable/chapter06/glibc.html"
12 TARBALL="$PACKAGE-$VERSION.tar.gz"
13 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
15 BUILD_DEPENDS="linux-api-headers autoconf bash gawk gettext bison 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*) VERSION="2.13";;
25 esac
27 # Handle multiarch installation.
28 case "$SLITAZ_ARCH" in
29 arm*) VERSION="2.13";;
30 esac
33 # Rules to compile & install the temporary toolchain.
34 cook_tmp_toolchain() {
35 unset CFLAGS CXXFLAGS
36 case $ARCH in
37 i386) Arch='i486';;
38 x86_64) Arch='nocona';;
39 *) Arch="$ARCH";;
40 esac
41 echo "CFLAGS += -O2 -march=$Arch -mtune=$Arch" > configparms
43 # Build in a separate directory.
44 mkdir build
45 cd build
47 ../configure \
48 --host=$HOST_SYSTEM \
49 --build=$($src/scripts/config.guess) \
50 --disable-profile \
51 --enable-add-ons \
52 --enable-kernel=3.2 \
53 --with-headers=/tools/include \
54 libc_cv_forced_unwind=yes \
55 libc_cv_c_cleanup=yes &&
56 make -j1 &&
57 make install || return 1
59 # Link compiler to this new glibc.
60 SPECS=$(dirname $($HOST_SYSTEM-gcc -print-libgcc-file-name))/specs
61 $HOST_SYSTEM-gcc -dumpspecs \
62 | sed \
63 -e 's@/lib\(64\)\?/ld@/tools&@g' \
64 -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
65 unset SPECS
66 }
68 # Rules to configure and make the package.
69 compile_rules() {
70 # Glibc needs ld.so.conf in the install destdir.
71 mkdir -p $install/etc
72 touch $install/etc/ld.so.conf
74 # Read the INSTALL file in glibc. Also Glibc don't build with -Os flag.
75 unset CFLAGS CXXFLAGS
76 case $ARCH in
77 i?86) Arch='i486'; ARCH_ARGS='-m32';;
78 x86_64) Arch='nocona'; ARCH_ARGS='-m64';;
79 *) Arch="$ARCH"; ARCH_ARGS='';;
80 esac
81 echo "CFLAGS += -O2 -march=$Arch -mtune=$Arch" > configparms
83 # Remove a file that may be left over from a previous build attempt
84 rm -f /usr/include/limits.h 2>/dev/null
86 mkdir build
87 cd build
88 # --enale-kernel: please respect Kernel version of the build host,
89 # put the exact or lower numbers. From Glibc INSTALL:
90 # > The higher the VERSION number is, the less compatibility code is
91 # > added, and the faster the code gets.
92 CC="gcc $ARCH_ARGS -isystem /usr/lib/gcc/$BUILD_SYSTEM/$(. $WOK/gcc/receipt; echo $VERSION)/include \
93 -isystem /usr/include" \
94 ../configure \
95 --disable-werror \
96 --enable-kernel=3.2 \
97 --enable-stack-protector=strong \
98 libc_cv_slibdir=/lib \
99 $CONFIGURE_ARGS &&
100 make -j1 &&
101 touch $install/etc/ld.so.conf &&
102 sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile &&
103 make install_root=$install install || return 1
105 # nscd
106 cp ../nscd/nscd.conf $install/etc/nscd.conf
107 mkdir -p $install/var/cache/nscd $install/var/db
108 install -Dm755 $stuff/nscd $install/etc/init.d/nscd
110 # nsswitch.conf
111 cp $stuff/nsswitch.conf $install/etc
113 # ld.so.conf
114 install -Dm644 $stuff/ld.so.conf $install/etc/ld.so.conf
116 # If temporary toolchain was previously used, switch to regular toolchain.
117 if [ -d /tools ]; then
118 mv /tools/bin/ld /tools/bin/ld-old
119 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
120 mv /tools/bin/ld-new /tools/bin/ld
121 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
122 gcc -dumpspecs \
123 | sed -e 's@/tools@@g' \
124 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
125 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
126 $(dirname $(gcc --print-libgcc-file-name))/specs
127 fi
129 # Create symlinks to the dynamic loader for LSB compliance.
130 case $ARCH in
131 i?86)
132 ln -sf ld-linux.so.2 $install/lib/ld-lsb.so.3
133 ;;
134 x86_64)
135 mkdir -p $install/lib64
136 ln -sf ../lib/ld-$VERSION.so $install/lib64/ld-linux-x86-64.so.2
137 ln -sf ../lib/ld-$VERSION.so $install/lib64/ld-lsb-x86-64.so.3
138 ;;
139 esac
141 # Place the debugging symbols for selected libraries in separate files.
142 # This debugging information is needed if running regression tests that use valgrind or gdb.
143 # http://www.linuxfromscratch.org/lfs/view/stable/chapter06/strippingagain.html
145 for i in ld-$VERSION.so libc-$VERSION.so libpthread-$VERSION.so libthread_db-1.0.so; do
146 cd $install/lib/
147 objcopy --only-keep-debug $i $i.dbg
148 strip --strip-unneeded $i
149 objcopy --add-gnu-debuglink=$i.dbg $i
150 done
151 }
153 genpkg_rules() {
154 case $PACKAGE in
155 glibc)
156 LOCALE=""
157 CAT="meta|meta-package"
158 DEPENDS="glibc-base glibc-locale glibc-dev"
159 TAGS="LFS"
160 ;;
161 glibc-base)
162 case "$ARCH" in
163 arm*)
164 # Eglibc is cross compiled by cross to have a toolchain so we can
165 # use these files instead of recooking it. ARM use Eglibc
166 echo "Using cross compiled Eglibc..."
167 install="/cross/$ARCH/sysroot"
168 copy libc_nonshared.a libpthread_nonshared.a
169 ;;
170 esac
171 copy \
172 ld-*.so* ld.so* \
173 libanl-*.so* libanl.so* \
174 libc-*.so* libc.so* \
175 libcrypt-*.so* libcrypt.so* \
176 libdl-*.so* libdl.so* \
177 libm-*.so* libm.so* \
178 libnsl-*.so* libnsl.so* \
179 libnss_compat-*.so* libnss_compat.so* \
180 libnss_dns-*.so* libnss_dns.so* \
181 libnss_files-*.so* libnss_files.so* \
182 libpthread-*.so* libpthread.so* \
183 libresolv-*.so* libresolv.so* \
184 librt-*.so* librt.so* \
185 libthread_db-*.so* libthread_db.so* \
186 libutil-*.so* libutil.so* \
187 \
188 UNICODE.so gconv-modules ANSI_X3.110.so ISO8859-1.so \
189 ISO8859-15.so UTF-16.so CP1252.so IBM437.so IBM850.so \
190 \
191 i18n iso14651_t1 iso14651_t1_common \
192 translit_neutral translit_combining translit_circle \
193 translit_cjk_compat translit_compat translit_font \
194 translit_fraction translit_narrow translit_small \
195 translit_wide \
196 \
197 locale localedef locale.alias UTF-8.gz UTC rpc \
198 nsswitch.conf \
199 $DEFAULT_LOCALE
201 find $fs -type f -name '*.so.dbg' -delete
203 CAT="base-system|minimal libraries and UTF-8 support for SliTaz"
204 DEPENDS=" "
205 ;;
206 glibc-locale)
207 copy gconv/ locale/ i18n/ iconv tzselect @rm # Remove glibc-base files
209 # Remove files provided by locale-pack.
210 . $WOK/slitaz-i18n/stuff/locale-pack.conf
211 echo -n "Removing locale: "
212 for i in $LOCALE_PACK; do
213 echo -n "$i "
214 rm -rf $fs/usr/share/locale/$i
215 done
216 status
217 CAT="system-tools|misc. locale files and utilities"
218 DEPENDS="glibc-base"
219 ;;
220 nscd)
221 copy /var/db/ /var/cache/nscd/ nscd getent nscd.conf
222 CAT="base-system|name-server caching daemon"
223 DEPENDS=" "
224 ;;
225 glibc-dev)
226 copy @std @dev @rm
227 DEPENDS="glibc-base"
228 ;;
229 esac
230 }