# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
# Contributor: Zachary Lee Andrews <zcrayfish@gmail.com>
pkgname=lximage-qt
pkgver=2.1.0
pkgrel=1
pkgdesc="The image viewer and screenshot tool for LXQt"
url="https://github.com/lxqt/lximage-qt"
arch="all !armhf !s390x" # armhf blocked by liblxqt, s390x blocked by libfm-qt
license="LGPL-2.0-or-later"
makedepends="
	cmake samurai lxqt-build-tools liblxqt-dev qt6-qttools-dev
	libfm-qt-dev libexif-dev menu-cache-dev
	"
options="!check" # No testsuite
subpackages="$pkgname-lang"
source="https://github.com/lxqt/lximage-qt/releases/download/$pkgver/lximage-qt-$pkgver.tar.xz"

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=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

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

lang() {
	install_if="lang $pkgname=$pkgver-r$pkgrel"
	amove usr/share/$pkgname/translations
}

sha512sums="
f94f6ee07e83524ac37f2377d5e5fec4926e2fdd33af67213cbe91ce1e40215774c2a79b81f16ac9d88e44e8bb55750a48cc4d68266d03d9c8973e1319f393c5  lximage-qt-2.1.0.tar.xz
"
