features
This commit is contained in:
+23
-9
@@ -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=<store>" 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}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user