Files
binary-repo/sys/base/glibc/ympbuild
T
2023-02-08 07:15:57 +00:00

126 lines
3.5 KiB
Bash

#!/bin/bash
name=glibc
release=1
version=2.36
url='https://gitlab.com/sulinos/devel/ymp'
description='GNU libc library'
email='parduscix@yandex.ru'
maintainer='sulincix'
license=('GPLv3')
arch=(x86_64)
dontstrip="31"
source=("https://ftp.gnu.org/gnu/glibc/glibc-${version}.tar.xz"
'ld.conf/ld.so.conf'
'ld.conf/usr-support.conf'
'ld.conf/x86_64-linux-gnu.conf'
'data/glibc.sysconf'
'data/reenable_DT_HASH.patch'
'scripts/locale-gen'
'scripts/revdep-rebuild'
'data/tr_TR'
)
md5sums=('00e9b89e043340f688bc93ec03239b57'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
)
uses=(multilib)
group=(sys.base)
export CFLAGS="-O2 ${debug:+-g} -s -mtune=generic -DTURKMAN"
export CXXFLAGS="-O2 ${debug:+-g} -s -mtune=generic -DTURKMAN"
cd "$name-$version"
setup(){
# Thx archlinux
patch -Np1 -i "../reenable_DT_HASH.patch"
opts=(
--prefix=/usr
--mandir=/usr/share/man
--infodir=/usr/share/info
--enable-bind-now
--enable-cet
--enable-kernel=5.10
--enable-multi-arch
--enable-stack-protector=strong
--enable-static-nss
--disable-crypt
--disable-profile
--disable-werror
)
if use multilib ; then
export CC="gcc -m32"
export CXX="g++ -m32"
mkdir glibc32-build
cd glibc32-build
echo "slibdir=/lib32" >> configparms
echo "rtlddir=/lib32" >> configparms
../configure ${opts[@]} \
--host=i686-pc-linux-gnu \
--libdir=/lib32 \
--libexecdir=/lib32/glibc
cd ..
fi
export CC="gcc"
export CXX="g++"
mkdir glibc-build
cd glibc-build
echo "slibdir=/lib64" >> configparms
echo "rtlddir=/lib64" >> configparms
../configure ${opts[@]} \
--host=x86_64-pc-linux-gnu \
--libdir=/lib64 \
--libexecdir=/lib64/glibc
cd ..
}
build(){
for bdir in glibc-build glibc32-build ; do
if [[ -d $bdir ]] ; then
make -C $bdir all
make -C $bdir info
fi
done
}
package(){
# create symlink lib64 (gentoo compability)
mkdir -p ${DESTDIR}/lib64
ln -s lib64 ${DESTDIR}/lib
if use multilib ; then
mkdir -p ${DESTDIR}/lib32
ln -s lib32 ${DESTDIR}/libx32
fi
for bdir in glibc32-build glibc-build ; do
if [[ -d $bdir ]] ; then
make -C $bdir install
fi
done
mkdir -p ${DESTDIR}/etc/ld.so.conf.d/ ${DESTDIR}/etc/sysconf.d/ ${DESTDIR}/bin
install ../ld.so.conf ${DESTDIR}/etc/ld.so.conf
install ../usr-support.conf ${DESTDIR}/etc/ld.so.conf.d/
install ../x86_64-linux-gnu.conf ${DESTDIR}/etc/ld.so.conf.d/
# remove ld.so.cache file (this file must generated by ldconfig command from ymp)
rm -f ${DESTDIR}/etc/ld.so.cache
# install sysconf trigger
install ../glibc.sysconf ${DESTDIR}/etc/sysconf.d/glibc
# install extra tools
install ../locale-gen ${DESTDIR}/bin/locale-gen
install ../revdep-rebuild ${DESTDIR}/bin/revdep-rebuild
# replace buggy turkish format with better one
install ../tr_TR ${DESTDIR}/usr/share/i18n/locales/tr_TR
# remove unused languages
for l in ku hy ; do
rm -rf ${DESTDIR}/usr/lib/locale/${i}_*
rm -rf ${DESTDIR}/usr/share/locale/${i}_*
rm -rf ${DESTDIR}/usr/share/i18n/locales/${i}_*
done
# fix ldd shebang
sed -i "s|#!/bin/bash|#!/bin/sh|g" ${DESTDIR}/usr/bin/ldd
}