# Contributor: André Klitzing <aklitzing@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=ausweisapp2
pkgver=2.2.0
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="
c90df976c1c6bedfc131e2962b8204c78af0af380f3860603f57bcb6ff72ce5a7bf1bd67903847bd9520d0306fea3e7ff74f169a792d5b11855e9a05c4a6b788  AusweisApp-2.2.0.tar.gz
"
