features
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user