57 lines
3.0 KiB
Plaintext
57 lines
3.0 KiB
Plaintext
/*
|
|
* 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.
|
|
*/
|
|
package "links" {
|
|
const version = "2.30"
|
|
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.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
|
|
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}
|
|
}
|
|
|
|
install {
|
|
make DESTDIR=${destdir} install
|
|
}
|
|
}
|