# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: team/gnome <fossdd@pwned.life>
pkgname=totem-pl-parser
pkgver=3.26.6
pkgrel=5
pkgdesc="GNOME playlist parser library"
url="https://www.gnome.org/"
arch="all"
license="LGPL-2.0-or-later"
makedepends="
	gmime-dev
	gobject-introspection-dev
	itstool
	json-glib-dev
	libarchive-dev
	libgcrypt-dev
	libxml2-dev
	libxml2-utils
	libxslt
	meson
	"
options="!check" # doesn't detect gvfs' http support
subpackages="$pkgname-dev $pkgname-lang"
source="https://download.gnome.org/sources/totem-pl-parser/${pkgver%.*}/totem-pl-parser-$pkgver.tar.xz"

prepare() {
	default_prepare
	# Patch out -Werror= cflags
	sed "/'-Werror=/d" -i meson.build
}

build() {
	export CFLAGS="$CFLAGS -Wno-error"
	abuild-meson \
		-Denable-libarchive=yes \
		-Denable-libgcrypt=yes \
		-Dintrospection=true \
		build
	meson compile -C build
}

check() {
	meson test --print-errorlogs -C build
}

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

sha512sums="
1a7aa69e147b55c3c9761328604821a7e40bac4e7b82492e5ce1b2405e3b6d5154e3b06687f2446ec923b34bf6ea96eef179ef8410c005a061d448fc6b3e754e  totem-pl-parser-3.26.6.tar.xz
"
