# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=maui
pkgname=shelf
pkgver=4.0.0
pkgrel=0
pkgdesc="Document and EBook collection manager"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://invent.kde.org/maui/maui-shelf"
license="GPL-3.0-or-later"
depends="
	mauikit-documents
	mauikit-texteditor
	"
makedepends="
	extra-cmake-modules
	kcoreaddons-dev
	ki18n-dev
	mauikit-dev
	mauikit-documents-dev
	mauikit-filebrowsing-dev
	poppler-qt5-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	samurai
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/maui/maui-shelf.git"
source="https://download.kde.org/stable/maui/shelf/$pkgver/maui-shelf-$pkgver.tar.xz"
options="!check" # No tests
builddir="$srcdir/maui-$pkgname-$pkgver"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
f6d2e53ceff4ed6c7c4ea14631c26f875ec0143f205ad7755cbf88b1b06aa1181e45607cd4614fe70bba320cd78ee15ad5adb1cc65572df8ee62824d591a2cc2  maui-shelf-4.0.0.tar.xz
"
