maintainer="Antoni Aloy <aaloytorrens@gmail.com>"
# Contributor: Zachary Lee Andrews <zcrayfish@gmail.com>
pkgname=xdg-desktop-portal-lxqt
pkgver=1.2.0
pkgrel=0
pkgdesc="LXQT xdg desktop portal"
url="https://github.com/lxqt/xdg-desktop-portal-lxqt"
arch="all !armhf" # kwindowsystem
license="LGPL-2.1-or-later"
depends="
	xdg-desktop-portal
	"
makedepends="
	cmake
	kwindowsystem-dev
	libfm-qt-dev
	qt6-qtbase-dev
	samurai
	xdg-desktop-portal-dev
	"
source="https://github.com/lxqt/xdg-desktop-portal-lxqt/releases/download/$pkgver/xdg-desktop-portal-lxqt-$pkgver.tar.xz"
options="!check" # no tests

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=None \
		-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/lxqt/translations/$pkgname
}

sha512sums="
fe0c8efedfbf3c7ec7f4b633d030bf9ed884e3836ba70390de4d61d4f73b57aa34afbabd474b05034f1db5fd54125988ccb52e34284ead850a8f3d6fba665b89  xdg-desktop-portal-lxqt-1.2.0.tar.xz
"
