maintainer="Antoni Aloy <aaloytorrens@gmail.com>"
# Contributor: Zachary Lee Andrews <zcrayfish@gmail.com>
pkgname=liblxqt
pkgver=2.2.0
pkgrel=0
pkgdesc="Common base library for LXQt components"
url="https://github.com/lxqt/liblxqt"
# armhf blocked by extra-cmake-modules -> kwindowsystem
arch="all !armhf"
license="LGPL-2.0-or-later"
makedepends="
	cmake
	samurai
	lxqt-build-tools
	qt6-qttools-dev
	libqtxdg-dev
	kwindowsystem-dev
	polkit-qt-dev
	libxscrnsaver-dev
	"

subpackages="$pkgname-dev $pkgname-lang"
source="https://github.com/lxqt/liblxqt/releases/download/$pkgver/liblxqt-$pkgver.tar.xz"
options="!check" # No testsuite

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 \
		-DBUILD_BACKLIGHT_LINUX_BACKEND=True \
		$CMAKE_CROSSOPTS
	cmake --build build
}

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

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

sha512sums="
95366ecf6546d4f9a3968cae0994188fef3fdb2d6186fc82a3f342c728a1c95499b4307a8c1db213b88c656766db05059b2a34a99908949bba5093f8cc88615e  liblxqt-2.2.0.tar.xz
"
