# Template file for 'datovka'
pkgname=datovka
version=4.29.1
revision=1
build_style=qmake
hostmakedepends="pkg-config qt5-qmake qt5-host-tools"
makedepends="libdatovka-devel qt5-websockets-devel qt5-svg-devel libxml2-devel
 quazip-devel"
depends="hicolor-icon-theme qt5-plugin-sqlite qt5-translations"
short_desc="Electronic communication interface endorsed by the Czech government"
maintainer="Emil Miler <em@0x45.cz>"
license="GPL-3.0-or-later"
homepage="https://www.datovka.cz/"
distfiles="https://datovka.nic.cz/${version}/${pkgname}-${version}.tar.xz"
checksum=fcfa84995fc566a8d7b4f2f47f09a14c447a1e10e70ebcdd1261b0059832bb31

post_extract() {
	# XXX: from https://gitlab.alpinelinux.org/alpine/aports/-/blob/master/community/datovka/APKBUILD
	# XXX: This enables '#define _Bool bool' which is needed on Alpine.
	sed -i 's/#if defined(__APPLE__) || defined(__clang__)/& || !defined(__GLIBC__)/' \
		config.tests/libdatovka/*.cpp \
		src/*.cpp \
		src/*.h \
		src/isds/*.cpp \
		src/isds/*.h \
		src/datovka_shared/isds/*.h \
		tests/*.cpp
}
