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