feat(netsurf): dynamic

Signed-off-by: Anhad Singh <andypython@protonmail.com>
This commit is contained in:
Anhad Singh 2025-02-11 20:20:03 +11:00
parent 4f70981463
commit 5c45667dce
No known key found for this signature in database
GPG Key ID: 80E0357347554B89
2 changed files with 56 additions and 32 deletions

View File

@ -1,32 +0,0 @@
VERSION=3.10
TAR=https://download.netsurf-browser.org/netsurf/releases/source-full/netsurf-all-$VERSION.tar.gz
BUILD_DEPENDS=(curl expat libjpeg libpng nghttp2 openssl1 sdl1 zlib freetype2 liborbital libiconv)
DEPENDS="ca-certificates orbital"
function recipe_version {
echo "$VERSION"
skip=1
}
function recipe_build {
export TARGET="framebuffer"
export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${PWD}/inst-${TARGET}/include"
export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib -L${PWD}/inst-${TARGET}/lib -Wl,--allow-multiple-definition"
# nghttp2 is not linked for some reason
export LDFLAGS="${LDFLAGS} -lcurl -lnghttp2"
"$REDOX_MAKE" PREFIX=/usr V=1 -j"$($NPROC)"
skip=1
}
function recipe_clean {
"$REDOX_MAKE" clean
skip=1
}
function recipe_stage {
dest="$(realpath "$1")"
"$REDOX_MAKE" DESTDIR="$dest" PREFIX=/usr install
mkdir -pv "$dest/ui/apps"
cp -v "${COOKBOOK_RECIPE}/manifest" "$dest/ui/apps/00_netsurf"
skip=1
}

View File

@ -0,0 +1,56 @@
[source]
tar = "https://download.netsurf-browser.org/netsurf/releases/source-full/netsurf-all-3.10.tar.gz"
blake3 = "d0f3b4dabf536a39059b156d2ec4633c6f7b71208466e09a3c1ca2a319a44b61"
patches = [
"./01_redox.patch"
]
[build]
template = "custom"
dependencies = [
"curl",
"expat",
"libjpeg",
"libpng",
"nghttp2",
"openssl1",
"sdl1",
"zlib",
"freetype2",
"liborbital",
"libiconv"
]
script = """
DYNAMIC_INIT
# Netsurf does not currently support out-of-tree builds :(
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
export TARGET="framebuffer"
export CFLAGS="-I${COOKBOOK_SYSROOT}/include -I${PWD}/inst-${TARGET}/include"
export LDFLAGS="-L${COOKBOOK_SYSROOT}/lib -L${PWD}/inst-${TARGET}/lib -Wl,--allow-multiple-definition -Wl,-rpath-link,${COOKBOOK_SYSROOT}/lib"
# nghttp2 is not linked for some reason
export LDFLAGS="${LDFLAGS} -lcurl -lnghttp2"
"$COOKBOOK_MAKE" PREFIX=/usr V=1 -j"$($NPROC)"
"$COOKBOOK_MAKE" DESTDIR="$COOKBOOK_STAGE" PREFIX=/usr install -j"$($NPROC)"
mkdir -pv "$COOKBOOK_STAGE/ui/apps"
cp -v "${COOKBOOK_RECIPE}/manifest" "$COOKBOOK_STAGE/ui/apps/00_netsurf"
"""
[package]
shared-deps = [
# XXX: currently only the following are dynamically linked
"libgcc",
"relibc",
"curl",
"nghttp2",
"libiconv",
"zlib",
"openssl1",
"liborbital",
]
dependencies = [
"ca-certificates",
"orbital",
]