# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=gnome-autoar
pkgver=0.4.5
pkgrel=0
pkgdesc="GNOME archive extraction library"
options="chmod-clean" # There are read-only test files
url="https://www.gnome.org/"
arch="all"
license="LGP-2.1-only"
makedepends="
	gobject-introspection-dev
	gtk+3.0-dev
	gtk-doc
	libarchive-dev
	meson
	vala
	"
subpackages="$pkgname-dev"
source="https://download.gnome.org/sources/gnome-autoar/${pkgver%.*}/gnome-autoar-$pkgver.tar.xz"

# secfixes:
#   0.3.1-r0:
#     - CVE-2021-28650
#     - CVE-2020-36241

build() {
	abuild-meson \
		-Db_lto=true \
		-Dgtk=true \
		-Dintrospection=enabled \
		-Dvapi=true \
		-Dtests=true \
		-Dgtk_doc=false \
		. output
	meson compile -C output
}

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

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

sha512sums="
ba38dfc0ad3c00fd8316d02d1a8e38ce3c743e11032f7c4efff74e7c3f8e8e815a1debe51eae8e2ee653155356d34992f1bc0e35e6cfab82398265fde8648050  gnome-autoar-0.4.5.tar.xz
"
