# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
maintainer="Bart Ribbers <bribbers@disroot.org>"
pkgname=okteta
pkgver=0.26.21
pkgrel=0
pkgdesc="KDE hex editor for viewing and editing the raw data of files"
# armhf blocked by qt5-qtdeclarative
arch="all !armhf"
url="https://kde.org/applications/utilities/org.kde.okteta"
license="(LGPL-2.1-only OR LGPL-3.0-only) AND (GPL-2.0-only OR GPL-3.0-only) AND GFDL-1.2-only"
makedepends="
	extra-cmake-modules
	kbookmarks5-dev
	kcmutils5-dev
	kcodecs5-dev
	kcompletion5-dev
	kconfigwidgets5-dev
	kcrash5-dev
	kdbusaddons5-dev
	kdoctools5-dev
	ki18n5-dev
	kiconthemes5-dev
	kio5-dev
	knewstuff5-dev
	kparts5-dev
	kservice5-dev
	kwidgetsaddons5-dev
	kxmlgui5-dev
	qca-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtscript-dev
	qt5-qttools-dev
	qt5-qtxmlpatterns-dev
	samurai
	shared-mime-info
	"
checkdepends="xwayland-run"
_repo_url="https://invent.kde.org/utilities/okteta.git"
source="https://download.kde.org/stable/okteta/$pkgver/src/okteta-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_DESKTOPPROGRAM=ON \
		-DBUILD_TERMINALTOOL=OFF # Remove when switching package to Qt6 and add konsole-dev as dep
	cmake --build build
}

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

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

sha512sums="
c3dd65a16b9f9c8fc82aa3e052ed948187e908f72b7f595b618b312d55f924c4425d3cd06e195df04eaaf19302946ffd7f0685b767299e7b1bc830bc25622528  okteta-0.26.21.tar.xz
"
