# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Pablo Correa Gomez <ablocorrea@hotmail.com>
pkgname=gnome-software-plugin-apk
pkgver=0.13.0
pkgrel=2
pkgdesc="APK plugin for GNOME Software"
url="https://github.com/Cogitri/gnome-software-plugin-apk"
arch="x86_64 armv7 armhf aarch64 x86 ppc64le" # apk-polkit-rs
license="GPL-2.0-or-later"
makedepends="meson gnome-software-dev apk-polkit-rs-dev appstream-dev"
checkdepends="py3-dbusmock gnome-software"
options="!check" # Tests will fail if gnome-software-plugin-apk is installed
subpackages="$pkgname-dbg"
source="$pkgname-$pkgver.tar.gz::https://github.com/Cogitri/gnome-software-plugin-apk/archive/v$pkgver.tar.gz
	"
# GNOME Software cannot depend on the plugin, due to the cylic dependency
# on the checkdepends. One solution could be to merge the 2 aports.
install_if="gnome-software"

build() {
	abuild-meson . output
	meson compile -C output
}

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

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

sha512sums="
7863a3872517ea4acc6f5722e1dd3a90a80900639c06e2367b1127a4c456f387c717b6d75000c1b277f374433d31f61961f25193dd54ee8b0dea01c337a832e2  gnome-software-plugin-apk-0.13.0.tar.gz
"
