template (2271B)
1 # Template file for 'glibc' 2 pkgname=glibc 3 version=2.44 4 revision=6 5 short_desc="GNU C library" 6 maintainer="finwo <finwo@pm.me>" 7 license="LGPL-2.1-or-later" 8 homepage="https://www.gnu.org/software/libc/" 9 distfiles="https://ftp.gnu.org/gnu/glibc/glibc-2.44.tar.xz" 10 checksum=37f600f2bef3c5e8300147059568b2a2e40a7ad6ccc65ce942556d49429cc667 11 # runtime needs from base-files: /etc/nsswitch.conf, /etc/ld.so.conf. 12 # busybox first: the post-install runs under /bin/sh (see libmnl). 13 depends="base-files busybox" 14 hostmakedepends="python3 bison gawk sed make" 15 16 # Notes: 17 # - glibc forbids in-source builds; configure runs in a sibling build dir. 18 # - Upstream mandates python3 for the build (allowed: build-only, never 19 # shipped). No `make check` locally (slow/flaky outside CI); CI runs it. 20 # - --enable-kernel=5.4: floor for any plausible UNOS kernel (generic target 21 # and switch kernels are 6.x; ONIE's kernel is irrelevant). 22 # - --libdir=/usr/lib (slibdir stays /lib64 for the loader + libc): without 23 # it glibc defaults libdir to /usr/lib64 on x86_64, scattering libraries 24 # across /lib64 + /usr/lib64 while every other UNOS package installs to 25 # /usr/lib - and the loader's baked-in search then misses /usr/lib 26 # entirely (`ip` failed to find libmnl). With /usr/lib as libdir the 27 # loader searches /lib64 + /usr/lib and one layout covers everything. 28 # - Single fat package (runtime + headers + static libs); split if size 29 # ever matters. No debuginfo split either. 30 # - Locales: C.UTF-8 only. No tzdata (UTC everywhere). 31 32 do_configure() { 33 export LC_ALL=C 34 mkdir -p "${WORK}/build" 35 cd "${WORK}/build" 36 "${WRKSRC}/configure" \ 37 --prefix=/usr \ 38 --libdir=/usr/lib \ 39 --enable-kernel=5.4 \ 40 --disable-werror 41 } 42 43 do_build() { 44 cd "${WORK}/build" 45 make -j"$(nproc)" 46 } 47 48 do_install() { 49 cd "${WORK}/build" 50 make install DESTDIR="${DESTDIR}" 51 # make install does not create the locale dir itself 52 mkdir -p "${DESTDIR}/usr/lib/locale" 53 # localedef is linked against the just-built libc (2.44) but the host is 54 # bookworm (2.36); run it against its own libs so GLIBC_2.38+ symbols resolve. 55 LD_LIBRARY_PATH="${WORK}/build:${WORK}/build/elf${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" \ 56 ./locale/localedef --prefix="${DESTDIR}" -i C -f UTF-8 C.UTF-8 57 }