/* * links — the text-mode web browser. * * 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" license = "GPL-2.0-or-later" provides = ["links"] depends = [ { name = "ncurses" }, { 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 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 } 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 make -j${jobs} } install { make DESTDIR=${destdir} install } }