# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gexiv2
pkgver=0.14.6
pkgrel=0
pkgdesc="GObject-based wrapper around the Exiv2 library"
url="https://wiki.gnome.org/Projects/gexiv2"
arch="all"
license="GPL-2.0-or-later"
makedepends="
	exiv2-dev
	glib-dev
	gobject-introspection-dev
	gtk-doc
	meson
	py3-gobject3
	vala
	"
subpackages="py3-$pkgname-pyc py3-$pkgname:py3 $pkgname-dev $pkgname-doc"
source="https://download.gnome.org/sources/gexiv2/${pkgver%.*}/gexiv2-$pkgver.tar.xz"
replaces="libgexiv2"

build() {
	abuild-meson \
		-Dgtk_doc=true \
		-Dintrospection=true \
		-Dvapi=true \
		-Dtests="$(want_check && echo true || echo false)" \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
	python3 -m compileall -qf "$pkgdir"/usr/lib
}

py3() {
	amove usr/lib/python*
}

sha512sums="
1750964e539ed449c77bed5fc469fcd83a8534b25c4ea57a43671443b845ac6c2760236b03c1af936fd75b6517c8b2bd4873e066f0479e42ed521ab71a75efc9  gexiv2-0.14.6.tar.xz
"
