# Contributor: Andreas Røsdal <andreas.rosdal@gmail.com>
# Maintainer: Andreas Røsdal <andreas.rosdal@gmail.com>
pkgname=nordstjernen
pkgver=1.0.33
pkgrel=0
pkgdesc="Small, hand-written web browser written in C with GTK 4 and libcurl"
url="https://nordstjernen.org"
# quickjs and lexbor are vendored C and build in-tree; the engine also links
# a little C++ (poppler, libavif). Restrict to arches the deps + WAMR asm cover.
arch="x86_64 aarch64"
license="LicenseRef-NSL-1.0 OR GPL-3.0-or-later"
makedepends="
	meson
	ninja
	gtk4.0-dev
	libepoxy-dev
	curl-dev
	openssl-dev
	uchardet-dev
	libpsl-dev
	sqlite-dev
	libseccomp-dev
	libwebp-dev
	libavif-dev
	ffmpeg-dev
	poppler-dev
	fontconfig-dev
	freetype-dev
	pango-dev
	brotli-dev
	libjxl-dev
	gstreamer-dev
	gst-plugins-base-dev
	enchant2-dev
	libvorbis-dev
	opusfile-dev
	sdl2-dev
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/nordstjernen-web/nordstjernen-sol-browser/archive/refs/tags/$pkgver.tar.gz"
# GitHub names the archive root after the repository, not after $pkgname.
builddir="$srcdir/nordstjernen-sol-browser-$pkgver"
# No test suite upstream — behaviour is verified by running the browser.
options="!check"

build() {
	abuild-meson -Dwebgpu=disabled . output
	meson compile -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	install -Dm644 License.md \
		"$pkgdir"/usr/share/licenses/$pkgname/License.md
	install -Dm644 COPYING \
		"$pkgdir"/usr/share/licenses/$pkgname/COPYING
}

# Regenerate with `abuild checksum` whenever pkgver moves.
sha512sums="
1a332d71763009d7dacb758c0e4bf0288f5ed39e1d2252804fcc6f5258a20596507bd8503019920eb06a770fa55e5f31da81d899ce109be5ddedd40f25f2951d  nordstjernen-1.0.33.tar.gz
"
