# Contributor: Dmitry Zakharchenko <dmitz@disroot.org>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=elinks
pkgver=0.17.1.1
pkgrel=1
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
	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
	meson compile -C output
}

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

sha512sums="
7ad78f7d6a43341ae252c29f0c338e466cbedf8b40aefa9fa1939dbc62a9c9307b0a423b17181fce3bce1364fe6b6bdb80509ed90719965de174c9258b90902f  elinks-0.17.1.1.tar.xz
"
