# 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=kde-other
pkgname=haruna
pkgver=1.2.0
pkgrel=0
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://invent.kde.org/multimedia/haruna"
pkgdesc="Open-source video player built with Qt/QML and libmpv"
license="GPL-2.0-or-later AND GPL-3.0-or-later AND BSD-3-Clause"
depends="
	kirigami
	yt-dlp
	"
makedepends="
	extra-cmake-modules
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	mpvqt-dev
	ffmpeg-dev
	breeze-dev
	kconfig-dev
	kcoreaddons-dev
	kdoctools-dev
	kfilemetadata-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	kirigami-dev
	kxmlgui-dev
	samurai
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/multimedia/haruna.git"
source="https://download.kde.org/stable/haruna/$pkgver/haruna-$pkgver.tar.xz"

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

check() {
	ctest --test-dir build --output-on-failure
}

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

sha512sums="
17efcca52c624703a25b33875e7130e71929295a20526ca26cf559e91b4136af78968ae0dc61f89dbc23b09c332befcd1f00e4b35d7b544d2d7511471e45e500  haruna-1.2.0.tar.xz
"
