# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=fwupd-efi
pkgver=1.7
pkgrel=0
pkgdesc="EFI application used by uefi-capsule plugin in fwupd"
url="https://github.com/fwupd/fwupd-efi"
# only recognised/supported arches
# armv7 fails with textrel
arch="aarch64 x86 x86_64"
license="LGPL-3.0-or-later"
makedepends="meson gnu-efi-dev py3-pefile"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/fwupd/fwupd-efi/archive/refs/tags/$pkgver.tar.gz"

build() {
	abuild-meson \
		-Defi_sbat_distro_id=alpine \
		-Defi_sbat_distro_summary='Alpine Linux' \
		-Defi_sbat_distro_pkgname=$pkgname \
		-Defi_sbat_distro_version=$pkgver \
		-Defi_sbat_distro_url=https://alpinelinux.org \
		. output
	meson compile -C output
}

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

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

sha512sums="
db0857e76964c6e36dd8708fe3b4a0b56290543c374e40a9e1f0919e0016d59de6bd6d2e4f43fb2ddd706841917b60d36da086e1290d3351283504d287083a7e  fwupd-efi-1.7.tar.gz
"
