# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=libfm-qt
pkgver=2.0.2
pkgrel=0
pkgdesc="Qt port of libfm"
url="https://github.com/lxqt/libfm-qt"
arch="all"
license="LGPL-2.0-or-later"
depends="lxqt-menu-data"
depends_dev="
	libfm-dev
	libexif-dev
	lxqt-build-tools
	menu-cache-dev
	qt6-qtbase-dev
	qt6-qttools-dev
	"
makedepends="
	$depends_dev
	cmake
	samurai
	"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # No testsuite
source="https://github.com/lxqt/libfm-qt/releases/download/$pkgver/libfm-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 --install build
}

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

sha512sums="
479a7de05096b0c7763676e8eef5fa83ec06b4a5bc7bde697a265b2ba3ec79f6733169bf4b4aeef807df44660790b3d68f873c3a428f45aa38820bd861ca881b  libfm-qt-2.0.2.tar.xz
"
