0
0
mirror of https://github.com/termux-pacman/glibc-packages.git synced 2024-11-21 20:46:38 +00:00
glibc-packages/cgct/glibc-cgct/PKGBUILD
Ivan Max 63d5639e39
cgct/glibc-cgct: fixed recognition of LD_* variables (#291)
+ fixed path to `/etc/ld.so.preload`
2024-09-23 19:51:59 +03:00

79 lines
2.0 KiB
Bash

pkgname=glibc-cgct
pkgver=2.40
pkgrel=2
pkgdesc="GNU C Library for CGCT (only for Linux)"
arch=(x86_64)
url='https://www.gnu.org/software/libc/'
license=('GPL' 'LGPL')
source=(https://ftp.gnu.org/gnu/libc/glibc-$pkgver.tar.xz
rtld.c.patch
setup-cgct)
sha256sums=('19a890175e9263d748f627993de6f4b1af9cd21e03f080e4bfb3a1fac10205a2'
'e40eb4a004438f0ea40e08d159e5558c341c3572d7f037dcefb3e733c6595145'
'15dcc4a741f0a347252aa26963bb0f1a7bdd5dbfc2690827600d6acb5dbd2aa9')
groups=('cgct')
prepare() {
for i in *.patch; do
patch -Np1 -i ${srcdir}/$i
done
for var in LD_WARN LD_LIBRARY_PATH LD_BIND_NOW LD_BIND_NOT LD_DYNAMIC_WEAK LD_PRELOAD; do
for file in $(grep -s -r -l "${var}" ./glibc-${pkgver}); do
sed -i "s/${var}/${var}_CGCT/g" ${file}
done
done
rm ./glibc-${pkgver}/sysdeps/unix/sysv/linux/x86_64/configure*
mkdir -p glibc-build || true
}
build() {
cd glibc-build
unset CFLAGS CXXFLAGS AR LD CC CXX
echo "slibdir=${CGCT_PATH}/lib" > configparms
echo "rtlddir=${CGCT_PATH}/lib" >> configparms
echo "sbindir=${CGCT_PATH}/bin" >> configparms
echo "rootsbindir=${CGCT_PATH}/bin" >> configparms
../glibc-$pkgver/configure \
--prefix=$CGCT_PATH \
--libdir=${CGCT_PATH}/lib \
--libexecdir=${CGCT_PATH}/lib \
--host=${CHOST} \
--build=${CHOST} \
--target=${CHOST} \
--with-bugurl=https://github.com/termux-pacman/glibc-packages/issues \
--enable-bind-now \
--disable-multi-arch \
--enable-stack-protector=strong \
--enable-systemtap \
--disable-nscd \
--disable-profile \
--disable-werror \
--disable-default-pie \
--enable-cet
make -O
}
package() {
make -C glibc-build install_root="$pkgdir" install
rm -f "$pkgdir"/${CGCT_PATH}/etc/ld.so.{cache,conf}
rm -f "$pkgdir"/${CGCT_PATH}/bin/{tzselect,zdump,zic}
cd glibc-$pkgver
install -m644 nscd/nscd.conf "$pkgdir/${CGCT_PATH}/etc/nscd.conf"
install -m644 posix/gai.conf "$pkgdir"/${CGCT_PATH}/etc/gai.conf
rm -fr "$pkgdir"/${CGCT_PATH}/{include,var}
install -m755 "$srcdir/setup-cgct" "$pkgdir/${CGCT_PATH}/bin"
replace_hard_with_symbolic "$pkgdir"
}