# Contributor: André Klitzing <aklitzing@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=ausweisapp2
pkgver=2.2.2
pkgrel=0
pkgdesc="Official authentication app for German ID card and residence permit"
url="https://www.ausweisapp.bund.de/"
arch="all"
license="EUPL-1.2"
depends="
	acsccid
	ccid
	pcsc-cyberjack
	pcsc-lite
	"
makedepends="
	cmake
	http-parser-dev
	openssl-dev
	pcsc-lite-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qtscxml-dev
	qt6-qtsvg-dev
	qt6-qttools-dev
	qt6-qtwebsockets-dev
	qt6-qtwebsockets
	samurai
	"
subpackages="$pkgname-doc"
source="https://github.com/Governikus/AusweisApp2/releases/download/$pkgver/AusweisApp-$pkgver.tar.gz
	"
options="!check" # no upstream tests in release build
builddir="$srcdir/AusweisApp-$pkgver"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		cmake_crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		$cmake_crossopts .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
f86dabd4d7347e3986045407e0d2f94174552a676215292954d558d0b3c7df1ab5212b623a809bd36136ad79bd57541969e30783c46ddd01c786581ad01e727f  AusweisApp-2.2.2.tar.gz
"
