From 815160cfd786f948ff3187d65397adb9297a89aa Mon Sep 17 00:00:00 2001 From: huntedbytheirs Date: Tue, 18 Aug 2026 18:59:25 -0400 Subject: [PATCH] features --- stable/brotli.kap | 38 ++++++++++++++++++++ stable/ca-certificates.kap | 29 +++++++++++++++ stable/curl.kap | 74 ++++++++++++++++++++++++++++++++++++++ stable/index.kap | 14 ++++++++ stable/iproute2.kap | 36 +++++++++++++++++++ stable/libbsd.kap | 38 ++++++++++++++++++++ stable/libcap.kap | 34 ++++++++++++++++++ stable/libffi.kap | 35 ++++++++++++++++++ stable/libidn2.kap | 38 ++++++++++++++++++++ stable/libmnl.kap | 35 ++++++++++++++++++ stable/libpsl.kap | 35 ++++++++++++++++++ stable/libunistring.kap | 34 ++++++++++++++++++ stable/links.kap | 32 ++++++++++++----- stable/openssl.kap | 41 +++++++++++++++++++++ stable/wget.kap | 51 ++++++++++++++++++++++++++ stable/zlib.kap | 4 ++- stable/zstd.kap | 35 ++++++++++++++++++ 17 files changed, 593 insertions(+), 10 deletions(-) create mode 100644 stable/brotli.kap create mode 100644 stable/ca-certificates.kap create mode 100644 stable/curl.kap create mode 100644 stable/iproute2.kap create mode 100644 stable/libbsd.kap create mode 100644 stable/libcap.kap create mode 100644 stable/libffi.kap create mode 100644 stable/libidn2.kap create mode 100644 stable/libmnl.kap create mode 100644 stable/libpsl.kap create mode 100644 stable/libunistring.kap create mode 100644 stable/openssl.kap create mode 100644 stable/wget.kap create mode 100644 stable/zstd.kap diff --git a/stable/brotli.kap b/stable/brotli.kap new file mode 100644 index 0000000..b2927c6 --- /dev/null +++ b/stable/brotli.kap @@ -0,0 +1,38 @@ +/* + * brotli — Brotli compression (curl/wget HTTP compression). + * + * cmake-only build (no Makefile in the release): uses the store cmake, + * static libs only. + */ +package "brotli" { + const version = "1.2.0" + const source = "https://github.com/google/brotli/archive/refs/tags/v${version}.tar.gz" + sha256 = "816c96e8e8f193b40151dad7e8ff37b1221d019dbcb9c35cd3fadbfe6477dfec" + license = "MIT" + + provides = ["libbrotli.a"] + + depends = [ + { name = "cmake" }, + { name = "make" }, + ] + + prepare { + curl -L -o brotli-${version}.tar.gz ${source} + echo "816c96e8e8f193b40151dad7e8ff37b1221d019dbcb9c35cd3fadbfe6477dfec brotli-${version}.tar.gz" | sha256sum -c - + tar xf brotli-${version}.tar.gz --strip-components=1 + ROOT=$KAPPA_ROOT; [ -z $ROOT ] && ROOT=/usr/local/kappa; if [ -d $ROOT/temp/cmake/destdir/usr/bin ]; then echo $ROOT/temp/cmake/destdir/usr/bin; else echo $ROOT/bin/$(grep '^cmake ' $ROOT/db/installed | tail -1 | cut -d' ' -f3)/usr/bin; fi > cmake.path + } + + build { + PATH=$(cat cmake.path):$PATH cmake -B build -DCMAKE_INSTALL_PREFIX=${prefix} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF + PATH=$(cat cmake.path):$PATH cmake --build build -j${jobs} + } + + install { + PATH=$(cat cmake.path):$PATH DESTDIR=${destdir} cmake --install build + find ${destdir} -name '*.la' -delete + find ${destdir} -name '*.la' -delete + + } +} diff --git a/stable/ca-certificates.kap b/stable/ca-certificates.kap new file mode 100644 index 0000000..9212693 --- /dev/null +++ b/stable/ca-certificates.kap @@ -0,0 +1,29 @@ +/* + * ca-certificates — the Mozilla CA root bundle (121 roots). + * + * A data package: no build. The bundle is the curl.se snapshot; bump + * the version + sha256 when updating. Installed to the path that + * openssl's --openssldir and curl's --with-ca-bundle both expect. + */ +package "ca-certificates" { + const version = "2026-08-18" + const source = "https://curl.se/ca/cacert.pem" + sha256 = "f66dff1bdf8f96060b8177976f8b7d9254bc89bc4db933d769f7384d28480bc9" + license = "MPL-2.0" + + provides = ["ca-certificates"] + + prepare { + curl -L -o cacert.pem ${source} + echo "f66dff1bdf8f96060b8177976f8b7d9254bc89bc4db933d769f7384d28480bc9 cacert.pem" | sha256sum -c - + } + + build { + true + } + + install { + mkdir -p ${destdir}/etc/ssl/certs + cp cacert.pem ${destdir}/etc/ssl/certs/ca-certificates.crt + } +} diff --git a/stable/curl.kap b/stable/curl.kap new file mode 100644 index 0000000..0e7daf5 --- /dev/null +++ b/stable/curl.kap @@ -0,0 +1,74 @@ +/* + * curl — the transfer tool (HTTP/HTTPS, ftp, ...). + * + * Optional deps are kappa FEATURES (Gentoo-USE-flag style): each maps to + * a curl --with-* configure flag carrying the resolved store path, and a + * feature-conditional dependency. Enable in the system config: + * + * packages { curl { features { zlib = true, brotli = true, ... } } } + * + * PKG_CONFIG_LIBDIR=/nonexistent makes pkg-config find nothing, so a + * feature only takes effect through its explicit flag — a dev host can + * never leak its own libraries into the store build. Static curl + + * static store openssl = zero runtime lib resolution. + */ +package "curl" { + const version = "8.21.0" + const source = "https://curl.se/download/curl-${version}.tar.gz" + sha256 = "d9b327997999045a24cda50f3983e69e51c516bd8be6ef9842fc7f99135e33bb" + license = "curl" + + provides = ["curl"] + + features { + zlib = { enabled = false, flag = "--with-zlib=$(cat zlib.path 2>/dev/null)" } + brotli = { enabled = false, flag = "--with-brotli=$(cat brotli.path 2>/dev/null)" } + zstd = { enabled = false, flag = "--with-zstd=$(cat zstd.path 2>/dev/null)" } + libidn2 = { enabled = false, flag = "--with-libidn2=$(cat idn2.path 2>/dev/null)" } + libpsl = { enabled = false, flag = "--with-libpsl=$(cat psl.path 2>/dev/null)" } + } + + depends = [ + { name = "openssl" }, + { name = "ca-certificates" }, + { name = "zlib", feature = "zlib" }, + { name = "brotli", feature = "brotli" }, + { name = "zstd", feature = "zstd" }, + { name = "libidn2", feature = "libidn2" }, + { name = "libpsl", feature = "libpsl" }, + { name = "make" }, + ] + + prepare { + curl -L -o curl-${version}.tar.gz ${source} + echo "d9b327997999045a24cda50f3983e69e51c516bd8be6ef9842fc7f99135e33bb curl-${version}.tar.gz" | sha256sum -c - + tar xf curl-${version}.tar.gz --strip-components=1 + ROOT=$KAPPA_ROOT; [ -z $ROOT ] && ROOT=/usr/local/kappa; if [ -d $ROOT/temp/openssl/destdir/usr ]; then echo $ROOT/temp/openssl/destdir/usr; else echo $ROOT/bin/$(grep '^openssl ' $ROOT/db/installed | tail -1 | cut -d' ' -f3)/usr; fi > openssl.path + ROOT=$KAPPA_ROOT; [ -z $ROOT ] && ROOT=/usr/local/kappa; if [ ${feature.zlib} ]; then if [ -d $ROOT/temp/zlib/destdir/usr ]; then echo $ROOT/temp/zlib/destdir/usr; else echo $ROOT/bin/$(grep '^zlib ' $ROOT/db/installed | tail -1 | cut -d' ' -f3)/usr; fi > zlib.path; fi + ROOT=$KAPPA_ROOT; [ -z $ROOT ] && ROOT=/usr/local/kappa; if [ ${feature.brotli} ]; then if [ -d $ROOT/temp/brotli/destdir/usr ]; then echo $ROOT/temp/brotli/destdir/usr; else echo $ROOT/bin/$(grep '^brotli ' $ROOT/db/installed | tail -1 | cut -d' ' -f3)/usr; fi > brotli.path; fi + ROOT=$KAPPA_ROOT; [ -z $ROOT ] && ROOT=/usr/local/kappa; if [ ${feature.zstd} ]; then if [ -d $ROOT/temp/zstd/destdir/usr ]; then echo $ROOT/temp/zstd/destdir/usr; else echo $ROOT/bin/$(grep '^zstd ' $ROOT/db/installed | tail -1 | cut -d' ' -f3)/usr; fi > zstd.path; fi + ROOT=$KAPPA_ROOT; [ -z $ROOT ] && ROOT=/usr/local/kappa; if [ ${feature.libidn2} ]; then if [ -d $ROOT/temp/libidn2/destdir/usr ]; then echo $ROOT/temp/libidn2/destdir/usr; else echo $ROOT/bin/$(grep '^libidn2 ' $ROOT/db/installed | tail -1 | cut -d' ' -f3)/usr; fi > idn2.path; fi + ROOT=$KAPPA_ROOT; [ -z $ROOT ] && ROOT=/usr/local/kappa; if [ ${feature.libpsl} ]; then if [ -d $ROOT/temp/libpsl/destdir/usr ]; then echo $ROOT/temp/libpsl/destdir/usr; else echo $ROOT/bin/$(grep '^libpsl ' $ROOT/db/installed | tail -1 | cut -d' ' -f3)/usr; fi > psl.path; fi + // all enabled libs' -L dirs via a file (the .pc files lie about + // their location — configured /usr — so pkg-config -L misses the + // store and hits host libs; the explicit -L list fixes it). + echo -L$(cat openssl.path)/lib -L$(cat zlib.path 2>/dev/null)/lib -L$(cat brotli.path 2>/dev/null)/lib -L$(cat zstd.path 2>/dev/null)/lib -L$(cat idn2.path 2>/dev/null)/lib -L$(cat psl.path 2>/dev/null)/lib > ldflags.txt + echo -I$(cat openssl.path)/include -I$(cat zlib.path 2>/dev/null)/include -I$(cat brotli.path 2>/dev/null)/include -I$(cat zstd.path 2>/dev/null)/include -I$(cat idn2.path 2>/dev/null)/include -I$(cat psl.path 2>/dev/null)/include > cppflags.txt + } + + build { + // The --without-* flags always sit in the line (curl's configure + // also header-detects, so pkg-config starvation alone is not + // enough); each feature flag is injected AFTER them, so the last + // --with-X= wins when enabled. + // PKG_CONFIG_LIBDIR covers openssl + every enabled feature lib's + // pkgconfig dir (missing ones are empty entries, skipped by + // pkg-config) — curl's --with-X=PATH checks use pkg-config. + PKG_CONFIG_LIBDIR=$(cat openssl.path)/lib/pkgconfig:$(cat zlib.path 2>/dev/null)/lib/pkgconfig:$(cat brotli.path 2>/dev/null)/lib/pkgconfig:$(cat zstd.path 2>/dev/null)/lib/pkgconfig:$(cat idn2.path 2>/dev/null)/lib/pkgconfig:$(cat psl.path 2>/dev/null)/lib/pkgconfig CPPFLAGS=$(cat cppflags.txt) LDFLAGS=$(cat ldflags.txt) LIBS=-lcrypto ./configure --prefix=${prefix} --disable-shared --enable-static --with-openssl=$(cat openssl.path) --without-zlib --without-brotli --without-zstd --without-libidn2 --without-libpsl --without-nghttp2 --without-nghttp3 --without-ngtcp2 --without-quiche --without-libuv --disable-ldap --disable-ldaps ${feature.zlib} ${feature.brotli} ${feature.zstd} ${feature.libidn2} ${feature.libpsl} --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt + make -j${jobs} + } + + install { + make DESTDIR=${destdir} install + } +} diff --git a/stable/index.kap b/stable/index.kap index 84bfce6..0126e6f 100644 --- a/stable/index.kap +++ b/stable/index.kap @@ -25,5 +25,19 @@ index "local" { ncurses { version = "6.6" } readline { version = "8.3" } vim { version = "9.2.0967" } + openssl { version = "3.5.3" } + ca-certificates { version = "2026-08-18" } + iproute2 { version = "7.1.0" } + curl { version = "8.21.0" } + wget { version = "1.24.5" } links { version = "2.30" } + libunistring { version = "1.4" } + libidn2 { version = "2.3.8" } + libpsl { version = "0.23.3" } + zstd { version = "1.5.7" } + libffi { version = "3.8.0" } + libcap { version = "2.78" } + libmnl { version = "1.0.5" } + libbsd { version = "0.12.2" } + brotli { version = "1.2.0" } } diff --git a/stable/iproute2.kap b/stable/iproute2.kap new file mode 100644 index 0000000..2cae0fa --- /dev/null +++ b/stable/iproute2.kap @@ -0,0 +1,36 @@ +/* + * iproute2 — the ip/ss/tc network tools. + * + * Built minimal and deterministic: PKG_CONFIG_LIBDIR=/nonexistent makes + * pkg-config find nothing (a dev host would otherwise leak libmnl, libelf, + * libtirpc, libcap, krb5... into the store build), and --libbpf_force off + * drops the libbpf dependency. iproute2's configure degrades gracefully, + * so this is also exactly what a barebones system builds. + */ +package "iproute2" { + const version = "7.1.0" + const source = "https://cdn.kernel.org/pub/linux/utils/net/iproute2/iproute2-${version}.tar.gz" + sha256 = "f036279976a39dfa1e2b6df001e981a10aed7ab5f50a3145cea1b1d22cf77f55" + license = "GPL-2.0-or-later" + + provides = ["ip", "ss", "tc"] + + depends = [ + { name = "make" }, + ] + + prepare { + curl -L -o iproute2-${version}.tar.gz ${source} + echo "f036279976a39dfa1e2b6df001e981a10aed7ab5f50a3145cea1b1d22cf77f55 iproute2-${version}.tar.gz" | sha256sum -c - + tar xf iproute2-${version}.tar.gz --strip-components=1 + } + + build { + PKG_CONFIG_LIBDIR=/nonexistent ./configure --libbpf_force off + make -j${jobs} + } + + install { + make install DESTDIR=${destdir} + } +} diff --git a/stable/libbsd.kap b/stable/libbsd.kap new file mode 100644 index 0000000..65a4c85 --- /dev/null +++ b/stable/libbsd.kap @@ -0,0 +1,38 @@ +/* + * libbsd — BSD compatibility functions (strlcpy, getpass, ...), needed + * by links (its configure hard-links -lbsd when detected). + * + * Upstream gitlab.io is Cloudflare-challenged (unfetchable by curl), so + * the source comes from Debian's pool mirror — byte-identical to + * upstream. .tar.xz needs xz on the build system (base toolchain). + */ +package "libbsd" { + const version = "0.12.2" + const source = "https://deb.debian.org/debian/pool/main/libb/libbsd/libbsd_0.12.2.orig.tar.xz" + sha256 = "b88cc9163d0c652aaf39a99991d974ddba1c3a9711db8f1b5838af2a14731014" + license = "BSD-3-Clause" + + provides = ["libbsd.a"] + + depends = [ + { name = "make" }, + ] + + prepare { + curl -L -o libbsd-${version}.tar.xz ${source} + echo "b88cc9163d0c652aaf39a99991d974ddba1c3a9711db8f1b5838af2a14731014 libbsd-${version}.tar.xz" | sha256sum -c - + tar xf libbsd-${version}.tar.xz --strip-components=1 + } + + build { + ./configure --prefix=${prefix} --disable-shared + make -j${jobs} + } + + install { + make DESTDIR=${destdir} install + find ${destdir} -name '*.la' -delete + find ${destdir} -name '*.la' -delete + + } +} diff --git a/stable/libcap.kap b/stable/libcap.kap new file mode 100644 index 0000000..8c359cf --- /dev/null +++ b/stable/libcap.kap @@ -0,0 +1,34 @@ +/* + * libcap — POSIX capabilities (iproute2, privileged tooling). + * + * Its own Makefile build. RAISE_SETFCAP=no avoids needing root during + * install (no setfcap on the installed binaries). + */ +package "libcap" { + const version = "2.78" + const source = "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-${version}.tar.gz" + sha256 = "2a2c705e382c413643a458b837575c0eb0989477ab6fb99c87adbe9a259612ad" + license = "BSD-3-Clause OR GPL-2.0-or-later" + + provides = ["libcap.a", "setcap", "getcap"] + + depends = [ + { name = "make" }, + ] + + prepare { + curl -L -o libcap-${version}.tar.gz ${source} + echo "2a2c705e382c413643a458b837575c0eb0989477ab6fb99c87adbe9a259612ad libcap-${version}.tar.gz" | sha256sum -c - + tar xf libcap-${version}.tar.gz --strip-components=1 + } + + build { + make -j${jobs} + } + + install { + make install DESTDIR=${destdir} RAISE_SETFCAP=no + find ${destdir} -name '*.la' -delete + + } +} diff --git a/stable/libffi.kap b/stable/libffi.kap new file mode 100644 index 0000000..1e2d8d3 --- /dev/null +++ b/stable/libffi.kap @@ -0,0 +1,35 @@ +/* + * libffi — Foreign Function Interface (python ctypes, interpreters). + * + * Standard autotools static build. + */ +package "libffi" { + const version = "3.8.0" + const source = "https://github.com/libffi/libffi/releases/download/v${version}/libffi-${version}.tar.gz" + sha256 = "7da3e2d9a171eb0a038f592ecad3ff2bb2550f3496d87b3b29ad0cf4430c0db4" + license = "MIT" + + provides = ["libffi.a"] + + depends = [ + { name = "make" }, + ] + + prepare { + curl -L -o libffi-${version}.tar.gz ${source} + echo "7da3e2d9a171eb0a038f592ecad3ff2bb2550f3496d87b3b29ad0cf4430c0db4 libffi-${version}.tar.gz" | sha256sum -c - + tar xf libffi-${version}.tar.gz --strip-components=1 + } + + build { + ./configure --prefix=${prefix} --disable-shared + make -j${jobs} + } + + install { + make DESTDIR=${destdir} install + find ${destdir} -name '*.la' -delete + find ${destdir} -name '*.la' -delete + + } +} diff --git a/stable/libidn2.kap b/stable/libidn2.kap new file mode 100644 index 0000000..49075be --- /dev/null +++ b/stable/libidn2.kap @@ -0,0 +1,38 @@ +/* + * libidn2 — internationalized domain names (IDNA2008), for curl/wget. + * + * Uses its BUNDLED libunistring (the distro-standard approach — Alpine + * and Gentoo do the same): linking an external static libunistring.la + * confuses libtool ("was moved" — its .la records /usr/lib), which + * breaks the build. Bundled = fully self-contained. + */ +package "libidn2" { + const version = "2.3.8" + const source = "https://ftp.gnu.org/gnu/libidn/libidn2-${version}.tar.gz" + sha256 = "f557911bf6171621e1f72ff35f5b1825bb35b52ed45325dcdee931e5d3c0787a" + license = "GPL-2.0-or-later OR LGPL-3.0-or-later" + + provides = ["libidn2.a"] + + depends = [ + { name = "make" }, + ] + + prepare { + curl -L -o libidn2-${version}.tar.gz ${source} + echo "f557911bf6171621e1f72ff35f5b1825bb35b52ed45325dcdee931e5d3c0787a libidn2-${version}.tar.gz" | sha256sum -c - + tar xf libidn2-${version}.tar.gz --strip-components=1 + } + + build { + ./configure --prefix=${prefix} --disable-shared --with-included-libunistring + make -j${jobs} + } + + install { + make DESTDIR=${destdir} install + find ${destdir} -name '*.la' -delete + find ${destdir} -name '*.la' -delete + + } +} diff --git a/stable/libmnl.kap b/stable/libmnl.kap new file mode 100644 index 0000000..c3d5463 --- /dev/null +++ b/stable/libmnl.kap @@ -0,0 +1,35 @@ +/* + * libmnl — minimal netlink library (iproute2, NetworkManager). + * + * Standard autotools static build. + */ +package "libmnl" { + const version = "1.0.5" + const source = "https://www.netfilter.org/projects/libmnl/files/libmnl-${version}.tar.bz2" + sha256 = "274b9b919ef3152bfb3da3a13c950dd60d6e2bcd54230ffeca298d03b40d0525" + license = "LGPL-2.1-or-later" + + provides = ["libmnl.a"] + + depends = [ + { name = "make" }, + ] + + prepare { + curl -L -o libmnl-${version}.tar.bz2 ${source} + echo "274b9b919ef3152bfb3da3a13c950dd60d6e2bcd54230ffeca298d03b40d0525 libmnl-${version}.tar.bz2" | sha256sum -c - + tar xf libmnl-${version}.tar.bz2 --strip-components=1 + } + + build { + ./configure --prefix=${prefix} --disable-shared + make -j${jobs} + } + + install { + make DESTDIR=${destdir} install + find ${destdir} -name '*.la' -delete + find ${destdir} -name '*.la' -delete + + } +} diff --git a/stable/libpsl.kap b/stable/libpsl.kap new file mode 100644 index 0000000..023f130 --- /dev/null +++ b/stable/libpsl.kap @@ -0,0 +1,35 @@ +/* + * libpsl — Public Suffix List (cookie domain handling), for curl/wget. + * + * Built without libicu (the heavy Unicode dep — libidn2 covers IDN). + */ +package "libpsl" { + const version = "0.23.3" + const source = "https://github.com/rockdaboot/libpsl/releases/download/0.23.3/libpsl-0.23.3.tar.gz" + sha256 = "93941f85a1e7bd593fa94f299233cb5dfc91cd144fd9a78a6ceb75001c5b03be" + license = "MIT" + + provides = ["libpsl.a"] + + depends = [ + { name = "make" }, + ] + + prepare { + curl -L -o libpsl-${version}.tar.gz ${source} + echo "93941f85a1e7bd593fa94f299233cb5dfc91cd144fd9a78a6ceb75001c5b03be libpsl-${version}.tar.gz" | sha256sum -c - + tar xf libpsl-${version}.tar.gz --strip-components=1 + } + + build { + ./configure --prefix=${prefix} --disable-shared --enable-static --without-libicu --disable-runtime + make -j${jobs} + } + + install { + make DESTDIR=${destdir} install + find ${destdir} -name '*.la' -delete + find ${destdir} -name '*.la' -delete + + } +} diff --git a/stable/libunistring.kap b/stable/libunistring.kap new file mode 100644 index 0000000..26d1d0a --- /dev/null +++ b/stable/libunistring.kap @@ -0,0 +1,34 @@ +/* + * libunistring — Unicode string library (base for libidn2 and wget). + * + * Standard autotools static build; no external deps. + */ +package "libunistring" { + const version = "1.4" + const source = "https://ftp.gnu.org/gnu/libunistring/libunistring-${version}.tar.gz" + sha256 = "f7e39ddeca18858ecdd02c60d1d5374fcdcbbcdb6b68a391f8497cb1cb2cf3f7" + license = "LGPL-3.0-or-later" + + provides = ["libunistring.a"] + + depends = [ + { name = "make" }, + ] + + prepare { + curl -L -o libunistring-${version}.tar.gz ${source} + echo "f7e39ddeca18858ecdd02c60d1d5374fcdcbbcdb6b68a391f8497cb1cb2cf3f7 libunistring-${version}.tar.gz" | sha256sum -c - + tar xf libunistring-${version}.tar.gz --strip-components=1 + } + + build { + ./configure --prefix=${prefix} --disable-shared + make -j${jobs} + } + + install { + make DESTDIR=${destdir} install + find ${destdir} -name '*.la' -delete + + } +} diff --git a/stable/links.kap b/stable/links.kap index a571fbb..e9f4336 100644 --- a/stable/links.kap +++ b/stable/links.kap @@ -1,38 +1,52 @@ /* * links — the text-mode web browser. * + * HTTPS is a kappa feature (enable: packages { links { features { ssl = + * true } } }): "--without-ssl" sits in the line always, and the feature + * flag's "--with-ssl=" comes AFTER it, so the last flag wins when + * enabled. When disabled, the explicit --without-ssl beats the host's + * openssl headers. + * * Two modern-compiler fixes (verified): * - ftp.c: const-correct strchr (clang 16+) rejects assigning through * the const result; sed casts the operand to char*. * - CFLAGS=-std=gnu17 keeps pre-C23 strchr semantics everywhere else. - * - * Optional deps (openssl/libevent/libjpeg/libpng/libtiff) disabled — - * http-only until an openssl package exists. Terminfo from store ncurses. */ package "links" { const version = "2.30" - const source = "https://fossies.org/linux/www/links-${version}.tar.gz" - sha256 = "19bea8eaff960314cd9583749accc78ef22277581783fbfab8130c9dff077095" + const source = "https://fossies.org/linux/www/links-${version}.tar.bz2" + sha256 = "c4631c6b5a11527cdc3cb7872fc23b7f2b25c2b021d596be410dadb40315f166" license = "GPL-2.0-or-later" provides = ["links"] + features { + ssl = { enabled = false, flag = "--with-ssl=$(cat openssl.path 2>/dev/null)" } + } + depends = [ { name = "ncurses" }, + { name = "libbsd" }, + { name = "openssl", feature = "ssl" }, { name = "make" }, ] prepare { - curl -L -o links-${version}.tar.gz ${source} - echo "19bea8eaff960314cd9583749accc78ef22277581783fbfab8130c9dff077095 links-${version}.tar.gz" | sha256sum -c - - tar xf links-${version}.tar.gz --strip-components=1 + curl -L -o links-${version}.tar.bz2 ${source} + echo "c4631c6b5a11527cdc3cb7872fc23b7f2b25c2b021d596be410dadb40315f166 links-${version}.tar.bz2" | sha256sum -c - + tar xf links-${version}.tar.bz2 --strip-components=1 ROOT=$KAPPA_ROOT; [ -z $ROOT ] && ROOT=/usr/local/kappa; if [ -d $ROOT/temp/ncurses/destdir/usr ]; then echo $ROOT/temp/ncurses/destdir/usr; else echo $ROOT/bin/$(grep '^ncurses ' $ROOT/db/installed | tail -1 | cut -d' ' -f3)/usr; fi > ncurses.path + ROOT=$KAPPA_ROOT; [ -z $ROOT ] && ROOT=/usr/local/kappa; if [ -d $ROOT/temp/libbsd/destdir/usr ]; then echo $ROOT/temp/libbsd/destdir/usr; else echo $ROOT/bin/$(grep '^libbsd ' $ROOT/db/installed | tail -1 | cut -d' ' -f3)/usr; fi > bsd.path + ROOT=$KAPPA_ROOT; [ -z $ROOT ] && ROOT=/usr/local/kappa; if [ ${feature.ssl} ]; then if [ -d $ROOT/temp/openssl/destdir/usr ]; then echo $ROOT/temp/openssl/destdir/usr; else echo $ROOT/bin/$(grep '^openssl ' $ROOT/db/installed | tail -1 | cut -d' ' -f3)/usr; fi > openssl.path; fi + // multi-flag CPPFLAGS/LDFLAGS via files (bare -I.. -I.. would split) + echo -I$(cat ncurses.path)/include -I$(cat bsd.path)/include > cppflags.txt + echo -L$(cat ncurses.path)/lib -L$(cat bsd.path)/lib > ldflags.txt } build { // note: no "= 0" in the pattern — the DSL strips spaces before '='. sed -i 's/strchr(cast_const_char ud, POST_CHAR)/strchr((char *)ud, POST_CHAR)/g' ftp.c - CFLAGS=-std=gnu17 CPPFLAGS=-I$(cat ncurses.path)/include LDFLAGS=-L$(cat ncurses.path)/lib ./configure --prefix=${prefix} --without-ssl --without-libevent --without-libjpeg --without-libpng --without-libtiff + CPPFLAGS=$(cat cppflags.txt) LDFLAGS=$(cat ldflags.txt) ./configure --prefix=${prefix} --without-ssl --without-libevent --without-libjpeg --without-libpng --without-libtiff --without-lzma --without-bzip2 --without-zstd --without-brotli --without-zlib --without-gpm --without-libavif --without-libwebp --without-freetype ${feature.ssl} make -j${jobs} } diff --git a/stable/openssl.kap b/stable/openssl.kap new file mode 100644 index 0000000..57aaa33 --- /dev/null +++ b/stable/openssl.kap @@ -0,0 +1,41 @@ +/* + * openssl — the crypto library + CLI (TLS for everything downstream). + * + * Static-only (no-shared): consumers link libssl/libcrypto in, so no + * runtime lib resolution is needed in the store. --openssldir=/etc/ssl + * makes the DEFAULT CA path /etc/ssl/certs/... — matching the + * ca-certificates package and curl's explicit --with-ca-bundle. + * --libdir=lib keeps the store uniform (no lib64). + * + * Configure is perl-based: the store perl is prepended to PATH. + */ +package "openssl" { + const version = "3.5.3" + const source = "https://www.openssl.org/source/openssl-${version}.tar.gz" + sha256 = "c9489d2abcf943cdc8329a57092331c598a402938054dc3a22218aea8a8ec3bf" + license = "Apache-2.0" + + provides = ["libssl.a", "libcrypto.a", "openssl"] + + depends = [ + { name = "perl" }, + { name = "make" }, + ] + + prepare { + curl -L -o openssl-${version}.tar.gz ${source} + echo "c9489d2abcf943cdc8329a57092331c598a402938054dc3a22218aea8a8ec3bf openssl-${version}.tar.gz" | sha256sum -c - + tar xf openssl-${version}.tar.gz --strip-components=1 + ROOT=$KAPPA_ROOT; [ -z $ROOT ] && ROOT=/usr/local/kappa; if [ -d $ROOT/temp/perl/destdir/usr/bin ]; then echo $ROOT/temp/perl/destdir/usr/bin; else echo $ROOT/bin/$(grep '^perl ' $ROOT/db/installed | tail -1 | cut -d' ' -f3)/usr/bin; fi > perl.path + } + + build { + PATH=$(cat perl.path):$PATH ./Configure linux-x86_64 --prefix=${prefix} --libdir=lib --openssldir=/etc/ssl no-shared + PATH=$(cat perl.path):$PATH make -j${jobs} + } + + install { + PATH=$(cat perl.path):$PATH make DESTDIR=${destdir} install + ln -sf libssl.pc ${destdir}/usr/lib/pkgconfig/openssl.pc + } +} diff --git a/stable/wget.kap b/stable/wget.kap new file mode 100644 index 0000000..b6a1ed5 --- /dev/null +++ b/stable/wget.kap @@ -0,0 +1,51 @@ +/* + * wget — the classic downloader (revived now that its optional deps are + * kappa packages). 1.24.5 (not 1.25): 1.25 hard-requires libidn2 + + * libunistring + pcre2 regardless of flags, which can't be expressed as + * optional features. + * + * The zlib feature follows the USE-flag model (enable via config: + * packages { wget { features { zlib = true } } }). libpsl/libidn2 are + * auto-detected by wget with no --with flag — kept off via the + * pkg-config starvation + --disable-iri, since they can't be feature + * flags. HTTPS via the store openssl + ca-certificates. + */ +package "wget" { + const version = "1.24.5" + const source = "https://ftp.gnu.org/gnu/wget/wget-${version}.tar.gz" + sha256 = "fa2dc35bab5184ecbc46a9ef83def2aaaa3f4c9f3c97d4bd19dcb07d4da637de" + license = "GPL-3.0-or-later" + + provides = ["wget"] + + features { + zlib = { enabled = false, flag = "--with-zlib=$(cat zlib.path 2>/dev/null)" } + } + + depends = [ + { name = "openssl" }, + { name = "ca-certificates" }, + { name = "zlib", feature = "zlib" }, + { name = "make" }, + ] + + prepare { + curl -L -o wget-${version}.tar.gz ${source} + echo "fa2dc35bab5184ecbc46a9ef83def2aaaa3f4c9f3c97d4bd19dcb07d4da637de wget-${version}.tar.gz" | sha256sum -c - + tar xf wget-${version}.tar.gz --strip-components=1 + ROOT=$KAPPA_ROOT; [ -z $ROOT ] && ROOT=/usr/local/kappa; if [ -d $ROOT/temp/openssl/destdir/usr ]; then echo $ROOT/temp/openssl/destdir/usr; else echo $ROOT/bin/$(grep '^openssl ' $ROOT/db/installed | tail -1 | cut -d' ' -f3)/usr; fi > openssl.path + ROOT=$KAPPA_ROOT; [ -z $ROOT ] && ROOT=/usr/local/kappa; if [ ${feature.zlib} ]; then if [ -d $ROOT/temp/zlib/destdir/usr ]; then echo $ROOT/temp/zlib/destdir/usr; else echo $ROOT/bin/$(grep '^zlib ' $ROOT/db/installed | tail -1 | cut -d' ' -f3)/usr; fi > zlib.path; fi + // static openssl needs -lssl then -lcrypto (trailing pair wins). + echo -lssl -lcrypto > libs.txt + echo -L$(cat openssl.path)/lib -L$(cat zlib.path 2>/dev/null)/lib > ldflags.txt + } + + build { + PKG_CONFIG_LIBDIR=$(cat openssl.path)/lib/pkgconfig CPPFLAGS=-I$(cat openssl.path)/include LDFLAGS=$(cat ldflags.txt) LIBS=$(cat libs.txt) ./configure --prefix=${prefix} --with-ssl=openssl --disable-iri --disable-pcre2 --disable-pcre --without-libunistring-prefix --without-libpsl --without-zlib ${feature.zlib} + make -j${jobs} + } + + install { + make DESTDIR=${destdir} install + } +} diff --git a/stable/zlib.kap b/stable/zlib.kap index bec46d0..0dd0d11 100644 --- a/stable/zlib.kap +++ b/stable/zlib.kap @@ -28,8 +28,10 @@ package "zlib" { tar xf zlib-${version}.tar.gz --strip-components=1 } + // --static: only the archive (no libz.so) — consumers link it in, so + // no runtime lib resolution is needed in the store. build { - ./configure --prefix=${prefix} + ./configure --prefix=${prefix} --static make -j${jobs} } diff --git a/stable/zstd.kap b/stable/zstd.kap new file mode 100644 index 0000000..a0bcfc6 --- /dev/null +++ b/stable/zstd.kap @@ -0,0 +1,35 @@ +/* + * zstd — Zstandard compression (curl/wget/brotli-class, and the de-facto + * distro compression standard). + * + * Built with its own Makefile (make lib + make install, PREFIX/DESTDIR). + */ +package "zstd" { + const version = "1.5.7" + const source = "https://github.com/facebook/zstd/releases/download/v${version}/zstd-${version}.tar.gz" + sha256 = "eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3" + license = "BSD-3-Clause" + + provides = ["libzstd.a", "zstd"] + + depends = [ + { name = "make" }, + ] + + prepare { + curl -L -o zstd-${version}.tar.gz ${source} + echo "eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3 zstd-${version}.tar.gz" | sha256sum -c - + tar xf zstd-${version}.tar.gz --strip-components=1 + } + + build { + make -j${jobs} lib + make -j${jobs} + } + + install { + make install PREFIX=${prefix} DESTDIR=${destdir} + find ${destdir} -name '*.la' -delete + find ${destdir} -name '*.so*' -delete + } +}