template (1498B)
1 # Template file for 'zlib' 2 pkgname=zlib 3 version=1.3.1 4 revision=4 5 short_desc="General-purpose compression library" 6 maintainer="finwo <finwo@pm.me>" 7 license="Zlib" 8 homepage="https://zlib.net" 9 # NOTE: canonical zlib.net flaked on fetch during pinning; GitHub mirror 10 # used instead. Hash matches the widely published zlib-1.3.1 sha256. 11 distfiles="https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz" 12 checksum=9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23 13 # glibc first: the post-install runs /sbin/ldconfig, which needs libc 14 # present. busybox first: control scripts run under /bin/sh, which must 15 # exist before the script executes (ordering, not just runtime truth - 16 # apk runs each package's scripts right after unpacking it). 17 depends="glibc busybox" 18 19 # Notes: 20 # - apk-tools links zlib unconditionally (gzip .apk members). --shared for 21 # the .so; the static .a is removed per the shared-only policy. 22 # - Sysroot seed (second install + .pc prefix rewrite) so apk-tools' 23 # muon/meson configure finds it via PKG_CONFIG_PATH. 24 25 do_configure() { 26 cd "${WRKSRC}" 27 ./configure --prefix=/usr --shared 28 } 29 30 do_build() { 31 cd "${WRKSRC}" 32 make -j"$(nproc)" 33 } 34 35 do_install() { 36 cd "${WRKSRC}" 37 make install DESTDIR="${DESTDIR}" 38 make install DESTDIR="${SYSROOT}" 39 rm -f "${DESTDIR}/usr/lib/libz.a" "${SYSROOT}/usr/lib/libz.a" 40 # The sysroot .pc prefix is rewritten and verified centrally by mk/build.sh, 41 # which runs pc-fixup.sh after this function returns. 42 }