# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
# Contributor: Zachary Lee Andrews <zcrayfish@gmail.com>
pkgname=lxqt-archiver
pkgver=1.1.0
pkgrel=1
pkgdesc="Simple and lightweight desktop-agnostic Qt file archiver"
url="https://github.com/lxqt/lxqt-archiver"
arch="all !armhf"
license="LGPL-2.0-or-later"
depends="tar"
makedepends="
	cmake samurai lxqt-build-tools qt6-qttools-dev
	libfm-qt-dev json-glib-dev menu-cache-dev libexif-dev
	"
options="!check" # No testsuite
subpackages="$pkgname-lang"
source="https://github.com/lxqt/lxqt-archiver/releases/download/$pkgver/lxqt-archiver-$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="
7c2c1a9e9eae30452c3c6c276c5fe30f5b9d9ed8ca92291e69fdc32d1cb94e3a88de79a4379cddebec8ca201a57c70494b8e57c5704b885010a51ec6647f1a16  lxqt-archiver-1.1.0.tar.xz
"
