# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=flameshot
pkgver=12.1.0
pkgrel=3
pkgdesc="Featureful screenshot app"
options="!check" # No test suite
url="https://github.com/flameshot-org/flameshot"
arch="all !armhf" # kguiaddons
license="GPL-3.0-or-later"
depends="qt5-qtsvg"
makedepends="
	cmake
	kguiaddons5-dev
	qt5-qtsvg-dev
	qt5-qttools-dev
	samurai
	"
subpackages="
	$pkgname-lang
	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	$pkgname-doc
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/flameshot-org/flameshot/archive/v$pkgver.tar.gz"
langdir="/usr/share/flameshot/translations"

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

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

sha512sums="
159bf3a8ff406b3881dcc77fc48d9e7cc0d595bd47ee2363396d7efc95f69160cf25ccf99cd1b2c2b527baeadf91c209784a7bca23ed5f17caacc385e161c83c  flameshot-12.1.0.tar.gz
"
