wok-next annotate glibc/receipt @ rev 21020

Cleaning is almost finished... I should proceed to upgrades.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Nov 02 14:15:08 2018 +0200 (2018-11-02)
parents a429b73c2d89
children d03cdb2a688a
rev   line source
al@19743 1 # SliTaz package receipt v2.
pankso@9 2
pankso@9 3 PACKAGE="glibc"
al@20436 4 VERSION="2.26"
pankso@3475 5 CATEGORY="meta"
al@19743 6 SHORT_DESC="The GNU C libraries"
al@21020 7 MAINTAINER="devel@slitaz.org"
pascal@15000 8 LICENSE="GPL2"
al@19561 9 WEB_SITE="http://www.gnu.org/software/libc/"
al@20436 10 LFS="http://www.linuxfromscratch.org/lfs/view/stable/chapter06/glibc.html"
al@19561 11
pankso@9 12 TARBALL="$PACKAGE-$VERSION.tar.gz"
pankso@9 13 WGET_URL="$GNU_MIRROR/$PACKAGE/$TARBALL"
pankso@9713 14
al@21020 15 BUILD_DEPENDS="linux-api-headers autoconf bash gawk gettext-dev bison texinfo"
al@19743 16 # slitaz-i18n should present in wok
al@21020 17 SPLIT="$PACKAGE-base $PACKAGE-locale nscd $PACKAGE-dev"
al@19743 18
al@19743 19 # Locales include to glibc-base package by default, other locales are in: locale-** and glibc-locale
al@19743 20 DEFAULT_LOCALE="en_US en_GB"
al@19743 21
al@21020 22 # Compile & install the temporary toolchain.
al@20436 23 cook_tmp_toolchain() {
slaxemulator@10420 24 unset CFLAGS CXXFLAGS
al@20436 25 case $ARCH in
al@20436 26 i386) Arch='i486';;
al@20436 27 x86_64) Arch='nocona';;
al@20436 28 *) Arch="$ARCH";;
al@20436 29 esac
al@20436 30 echo "CFLAGS += -O2 -march=$Arch -mtune=$Arch" > configparms
gokhlayeh@8189 31
al@20436 32 # Build in a separate directory.
al@20436 33 mkdir build
al@20436 34 cd build
al@19561 35
al@20436 36 ../configure \
al@20436 37 --host=$HOST_SYSTEM \
al@20436 38 --build=$($src/scripts/config.guess) \
al@20436 39 --disable-profile \
al@20436 40 --enable-add-ons \
al@20436 41 --enable-kernel=3.2 \
al@20436 42 --with-headers=/tools/include \
al@20436 43 libc_cv_forced_unwind=yes \
al@20436 44 libc_cv_c_cleanup=yes &&
al@20436 45 make -j1 &&
al@20436 46 make install || return 1
gokhlayeh@8189 47
gokhlayeh@8189 48 # Link compiler to this new glibc.
al@19577 49 SPECS=$(dirname $($HOST_SYSTEM-gcc -print-libgcc-file-name))/specs
al@20436 50 $HOST_SYSTEM-gcc -dumpspecs \
al@20436 51 | sed \
gokhlayeh@8189 52 -e 's@/lib\(64\)\?/ld@/tools&@g' \
al@19577 53 -e "/^\*cpp:$/{n;s,$, -isystem /tools/include,}" > $SPECS
gokhlayeh@8189 54 unset SPECS
gokhlayeh@8189 55 }
pankso@9 56
al@20436 57 compile_rules() {
pankso@10031 58 # Glibc needs ld.so.conf in the install destdir.
al@19743 59 mkdir -p $install/etc
al@19743 60 touch $install/etc/ld.so.conf
al@19561 61
al@19743 62 # Read the INSTALL file in glibc. Also Glibc don't build with -Os flag.
pankso@10031 63 unset CFLAGS CXXFLAGS
al@20436 64 case $ARCH in
al@20439 65 i?86) Arch='i486'; ARCH_ARGS='-m32';;
al@20439 66 x86_64) Arch='nocona'; ARCH_ARGS='-m64';;
al@20439 67 *) Arch="$ARCH"; ARCH_ARGS='';;
al@20436 68 esac
al@20436 69 echo "CFLAGS += -O2 -march=$Arch -mtune=$Arch" > configparms
al@19561 70
al@20436 71 # Remove a file that may be left over from a previous build attempt
al@20436 72 rm -f /usr/include/limits.h 2>/dev/null
al@20436 73
al@20436 74 mkdir build
al@20436 75 cd build
al@20436 76 # --enale-kernel: please respect Kernel version of the build host,
al@20436 77 # put the exact or lower numbers. From Glibc INSTALL:
al@20436 78 # > The higher the VERSION number is, the less compatibility code is
al@20436 79 # > added, and the faster the code gets.
al@20439 80 CC="gcc $ARCH_ARGS -isystem /usr/lib/gcc/$BUILD_SYSTEM/$(. $WOK/gcc/receipt; echo $VERSION)/include \
al@20436 81 -isystem /usr/include" \
al@20436 82 ../configure \
al@20436 83 --disable-werror \
al@20436 84 --enable-kernel=3.2 \
al@20436 85 --enable-stack-protector=strong \
al@20436 86 libc_cv_slibdir=/lib \
al@20438 87 $CONFIGURE_ARGS &&
al@20436 88 make -j1 &&
al@20436 89 touch $install/etc/ld.so.conf &&
al@20436 90 sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile &&
al@20436 91 make install_root=$install install || return 1
al@19561 92
al@19743 93 # nscd
al@20436 94 cp ../nscd/nscd.conf $install/etc/nscd.conf
al@20436 95 mkdir -p $install/var/cache/nscd $install/var/db
al@20436 96 install -Dm755 $stuff/nscd $install/etc/init.d/nscd
al@19743 97
al@19743 98 # nsswitch.conf
al@19743 99 cp $stuff/nsswitch.conf $install/etc
gokhlayeh@8189 100
al@20436 101 # ld.so.conf
al@20436 102 install -Dm644 $stuff/ld.so.conf $install/etc/ld.so.conf
al@20436 103
pankso@10031 104 # If temporary toolchain was previously used, switch to regular toolchain.
al@19578 105 if [ -d /tools ]; then
al@19577 106 mv /tools/bin/ld /tools/bin/ld-old
al@19577 107 mv /tools/$(gcc -dumpmachine)/bin/ld /tools/$(gcc -dumpmachine)/bin/ld-old
al@19577 108 mv /tools/bin/ld-new /tools/bin/ld
al@19577 109 ln -s /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld
al@20436 110 gcc -dumpspecs \
al@20436 111 | sed -e 's@/tools@@g' \
al@19577 112 -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \
al@19577 113 -e '/\*cpp:/{n;s@$@ -isystem /usr/include@}' > \
al@19577 114 $(dirname $(gcc --print-libgcc-file-name))/specs
al@19577 115 fi
pankso@9 116
al@20436 117 # Create symlinks to the dynamic loader for LSB compliance.
al@20436 118 case $ARCH in
al@20436 119 i?86)
al@20436 120 ln -sf ld-linux.so.2 $install/lib/ld-lsb.so.3
al@20436 121 ;;
al@20436 122 x86_64)
al@20436 123 mkdir -p $install/lib64
al@20436 124 ln -sf ../lib/ld-$VERSION.so $install/lib64/ld-linux-x86-64.so.2
al@20436 125 ln -sf ../lib/ld-$VERSION.so $install/lib64/ld-lsb-x86-64.so.3
al@20436 126 ;;
al@20436 127 esac
al@20436 128
al@20436 129 # Place the debugging symbols for selected libraries in separate files.
al@20436 130 # This debugging information is needed if running regression tests that use valgrind or gdb.
al@20436 131 # http://www.linuxfromscratch.org/lfs/view/stable/chapter06/strippingagain.html
al@20436 132
al@20436 133 for i in ld-$VERSION.so libc-$VERSION.so libpthread-$VERSION.so libthread_db-1.0.so; do
al@20436 134 cd $install/lib/
al@20436 135 objcopy --only-keep-debug $i $i.dbg
al@20436 136 strip --strip-unneeded $i
al@20436 137 objcopy --add-gnu-debuglink=$i.dbg $i
al@19743 138 done
al@19743 139 }
al@19743 140
al@20436 141 genpkg_rules() {
al@19743 142 case $PACKAGE in
al@19743 143 glibc)
al@19743 144 LOCALE=""
al@19790 145 CAT="meta|meta-package"
al@19790 146 DEPENDS="glibc-base glibc-locale glibc-dev"
al@20436 147 TAGS="LFS"
al@19743 148 ;;
al@19743 149 glibc-base)
al@19743 150 copy \
al@19743 151 ld-*.so* ld.so* \
al@19743 152 libanl-*.so* libanl.so* \
al@19743 153 libc-*.so* libc.so* \
al@19743 154 libcrypt-*.so* libcrypt.so* \
al@19743 155 libdl-*.so* libdl.so* \
al@19743 156 libm-*.so* libm.so* \
al@19743 157 libnsl-*.so* libnsl.so* \
al@19743 158 libnss_compat-*.so* libnss_compat.so* \
al@19743 159 libnss_dns-*.so* libnss_dns.so* \
al@19743 160 libnss_files-*.so* libnss_files.so* \
al@19743 161 libpthread-*.so* libpthread.so* \
al@19743 162 libresolv-*.so* libresolv.so* \
al@19743 163 librt-*.so* librt.so* \
al@19743 164 libthread_db-*.so* libthread_db.so* \
al@19743 165 libutil-*.so* libutil.so* \
al@19743 166 \
al@19743 167 UNICODE.so gconv-modules ANSI_X3.110.so ISO8859-1.so \
al@19743 168 ISO8859-15.so UTF-16.so CP1252.so IBM437.so IBM850.so \
al@19743 169 \
al@19743 170 i18n iso14651_t1 iso14651_t1_common \
al@19743 171 translit_neutral translit_combining translit_circle \
al@19743 172 translit_cjk_compat translit_compat translit_font \
al@19743 173 translit_fraction translit_narrow translit_small \
al@19743 174 translit_wide \
al@19743 175 \
al@19743 176 locale localedef locale.alias UTF-8.gz UTC rpc \
al@19743 177 nsswitch.conf \
al@19743 178 $DEFAULT_LOCALE
gokhlayeh@8189 179
al@20436 180 find $fs -type f -name '*.so.dbg' -delete
al@20436 181
al@19743 182 CAT="base-system|minimal libraries and UTF-8 support for SliTaz"
al@19790 183 DEPENDS=" "
al@19743 184 ;;
al@19743 185 glibc-locale)
al@20436 186 copy gconv/ locale/ i18n/ iconv tzselect @rm # Remove glibc-base files
al@19743 187
al@19743 188 # Remove files provided by locale-pack.
al@19743 189 . $WOK/slitaz-i18n/stuff/locale-pack.conf
al@19743 190 echo -n "Removing locale: "
al@19743 191 for i in $LOCALE_PACK; do
al@19743 192 echo -n "$i "
al@19743 193 rm -rf $fs/usr/share/locale/$i
al@19743 194 done
al@19743 195 status
al@19790 196 CAT="system-tools|misc. locale files and utilities"
al@19743 197 DEPENDS="glibc-base"
al@19743 198 ;;
al@19743 199 nscd)
al@20436 200 copy /var/db/ /var/cache/nscd/ nscd getent nscd.conf
al@19743 201 CAT="base-system|name-server caching daemon"
al@19790 202 DEPENDS=" "
al@19743 203 ;;
al@19743 204 glibc-dev)
al@20436 205 copy @std @dev @rm
al@19743 206 DEPENDS="glibc-base"
al@19743 207 ;;
al@19743 208 esac
pankso@9 209 }