# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Maintainer: Bruno Pagani <archange@archlinux.org>

pkgname=keepassxc
pkgver=2.4.3
pkgrel=1
pkgdesc="Cross-platform community-driven port of Keepass password manager"
arch=(x86_64)
url="https://keepassxc.org/"
license=(GPL)
depends=(argon2 curl desktop-file-utils hicolor-icon-theme libgcrypt libsodium libxtst qrencode
         qt5-svg qt5-x11extras quazip yubikey-personalization)
makedepends=(git cmake qt5-tools)
_tag=af7d9a8e9f8648abb7822c1b99f31e1e79dc52f3 # git rev-parse ${pkgver}
source=("git+https://github.com/keepassxreboot/keepassxc#tag=${_tag}?signed")
sha256sums=(SKIP)
validpgpkeys=(BF5A669F2272CF4324C1FDA8CFB4C2166397D0D2  # KeePassXC Release <release@keepassxc.org>
              3489040C1F0C3EEAB8D556A5440FC65F2E0C6E01  # Jonathan White <support@dmapps.us>
              B3724F5B2C98B5B0AEDDBD582AC0283D4CFC9A10) # Janek Bevendorff <janek@jbev.net>

prepare() {
	mkdir -p build
}

build() {
	cd build
	cmake ../${pkgname} \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DWITH_XC_ALL=ON
	make
}

check() {
	cd build
	make test
}

package() {
	cd build
	make DESTDIR="${pkgdir}" install
}
