# Contributor: Dmitry Zakharchenko <dmitz@disroot.org>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=elinks
pkgver=0.18.0
pkgrel=0
pkgdesc="Advanced and well-established feature-rich text mode web browser"
url="https://github.com/rkd77/elinks"
arch="all"
license="GPL-2.0-or-later AND GPL-3.0-or-later AND MIT AND MPL-1.1"
makedepends="
	bzip2-dev
	curl-dev
	expat-dev
	gettext-dev
	gpm-dev
	libidn2-dev
	linux-headers
	meson
	openssl-dev
	python3
	xmlto
	zlib-dev
	"
subpackages="$pkgname-doc $pkgname-lang"
source="https://github.com/rkd77/elinks/releases/download/v$pkgver/elinks-$pkgver.tar.xz"
options="!check"

build() {
	LDFLAGS="$LDFLAGS -lintl" \
	abuild-meson \
		-Db_lto=true \
		-Dgettext=true \
		-Dhtml-highlight=true \
		-Dbacktrace=false \
		-D256-colors=true \
		-Dtrue-color=true \
		-Dtre=false \
		-Dlibcss=false \
		-Dreproducible=true \
		-Dsource-date-epoch="$SOURCE_DATE_EPOCH" \
		output .
	ninja -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
e0ff737e06d4b591d362257b9a375b938f9d6222cf6ee4df2065c7b47f883a5eacf76dabae8fc7c0b32cf9b7df56267752217d6999b0ae24c2482763b5b0ccb9  elinks-0.18.0.tar.xz
"