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

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=plasmatube
pkgver=24.08.1
pkgrel=0
pkgdesc="Kirigami YouTube video player based on Invidious"
# armhf, ppc64le, s390x, riscv64, loongarch64: blocked by purpose
arch="all !armhf !ppc64le !s390x !riscv64 !loongarch64"
url="https://invent.kde.org/plasma-mobile/plasmatube"
license="GPL-3.0-or-later AND CC0-1.0"
depends="
	gst-libav
	gst-plugins-good
	gst-plugins-good-qt
	kcoreaddons
	kdeclarative
	kirigami
	kirigami-addons
	kitemmodels
	purpose
	qt6-qtimageformats
	yt-dlp
	"
makedepends="
	extra-cmake-modules
	kdbusaddons-dev
	ki18n-dev
	kirigami-addons-dev
	kirigami-dev
	mpvqt-dev
	qt6-qtbase-dev
	qtkeychain-dev
	samurai
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/multimedia/plasmatube.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/plasmatube-$pkgver.tar.xz"
# No tests
options="!check"

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 --output-on-failure
}

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

sha512sums="
efc5392a9a6ec558b164aa2a79de6ea188ee063d723fb6d00d982b711f13ffa79808dee4be7a45326969d33d854e851ecf3afaf7bdd3a2e388356fd0a4ab0aaf  plasmatube-24.08.1.tar.xz
"
