From cb447620084a20be80d116c81c2e9ec110be7118 Mon Sep 17 00:00:00 2001 From: davidovski Date: Sun, 16 Jan 2022 01:23:51 +0000 Subject: restructured repo system --- repo/system/glibc.xibuild | 102 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 repo/system/glibc.xibuild (limited to 'repo/system/glibc.xibuild') diff --git a/repo/system/glibc.xibuild b/repo/system/glibc.xibuild new file mode 100644 index 0000000..61e5a0a --- /dev/null +++ b/repo/system/glibc.xibuild @@ -0,0 +1,102 @@ +#!/bin/bash + +DEPS=(glibc) + +SOURCE=https://ftp.gnu.org/gnu/glibc/glibc-2.34.tar.xz +DESC="The main gnu C library providing basic routines and procedures" + +build () { + # patches as recommended by lfs + sed -e '/NOTIFY_REMOVED)/s/)/ \&\& data.attr != NULL)/' -i sysdeps/unix/sysv/linux/mq_notify.c + + curl https://www.linuxfromscratch.org/patches/lfs/development/glibc-2.34-fhs-1.patch > glibc-2.34-fhs-1.patch + + patch -Np1 -i glibc-2.34-fhs-1.patch + + mkdir -v build + cd build + + # ensure that the ldconfig and sln utilities are installed into /usr/sbin + echo "rootsbindir=/usr/sbin" > configparms + + ../configure --prefix=/usr \ + --disable-werror \ + --enable-kernel=3.2 \ + --enable-stack-protector=strong \ + --with-headers=/usr/include \ + libc_cv_slibdir=/usr/lib + + make + + # some check failures are 'expected' + #make check || true + +} + +package () { + mkdir -pv $PKG_DEST/etc + touch $PKG_DEST/etc/ld.so.conf + + sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile + make DESTDIR=$PKG_DEST install + + # fix hardcoded path to the excutable in ldd script + sed '/RTLDLIST=/s@/usr@@g' -i $PKG_DEST/usr/bin/ldd + + cp -v ../nscd/nscd.conf $PKG_DEST/etc/nscd.conf + mkdir -pv $PKG_DEST/var/cache/nscd + + # create locales for the system + # note, this should be moved to a better place + make DESTDIR=$PKG_DEST localedata/install-locales + + cat > $PKG_DEST/etc/nsswitch.conf << "EOF" +# Begin /etc/nsswitch.conf + +passwd: files +group: files +shadow: files + +hosts: files dns +networks: files + +protocols: files +services: files +ethers: files +rpc: files + +# End /etc/nsswitch.conf +EOF + + curl https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/glibc/trunk/locale-gen > locale-gen + + install -m755 locale-gen "$PKG_DEST/usr/bin" + + #curl https://data.iana.org/time-zones/releases/tzdata2021e.tar.gz > tzdata2021e.tar.gz + #tar -xf tzdata2021e.tar.gz +# + #ZONEINFO=$PKG_DEST/usr/share/zoneinfo + #mkdir -pv $ZONEINFO/{posix,right} +## + #for tz in etcetera southamerica northamerica europe africa antarctica \ + #asia australasia backward; do + #zic -L /dev/null -d $ZONEINFO ${tz} + #zic -L /dev/null -d $ZONEINFO/posix ${tz} + #zic -L leapseconds -d $ZONEINFO/right ${tz} + #done +# + #cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO + #zic -d $ZONEINFO -p America/New_York + #unset ZONEINFO + + + # configure dynamic loader + cat > $PKG_DEST/etc/ld.so.conf << "EOF" +# Begin /etc/ld.so.conf +/usr/local/lib +/opt/lib +include /etc/ld.so.conf.d/*.conf +EOF + mkdir -pv $PKG_DEST/etc/ld.so.conf.d +} + -- cgit v1.2.1