# 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=phonon
pkgver=4.12.0
pkgrel=0
pkgdesc="KDE multimedia backend"
url="https://userbase.kde.org/Phonon"
arch="all !armhf" # armhf blocked by qt6-qtdeclarative
license="LGPL-2.1-or-later"
depends_dev="
	glib-dev
	qt5-qtdeclarative-dev
	qt6-qt5compat-dev
	qt6-qtdeclarative-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	qt5-qtbase-dev
	qt5-qttools-dev
	qt6-qtbase-dev
	qt6-qttools-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-lang $pkgname-qt5 $pkgname-qt6"
_repo_url="https://invent.kde.org/libraries/phonon.git"
source="https://download.kde.org/stable/phonon/4.12.0/phonon-$pkgver.tar.xz"

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

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

qt5() {
	amove usr/lib/libphonon4qt5*
	amove usr/lib/qt5/plugins/designer/phonon4qt5widgets.so
}

qt6() {
	amove usr/lib/libphonon4qt6*
	amove usr/lib/qt5/plugins/designer/phonon4qt6widgets.so
}

sha512sums="
0dbd88464985051f4c43e64a4d0b7e2d65e7f6b54fd2bae4ec1790fbdf9f79348aa91d4839c72a4f66297d5a9c7b379cc34923b99b97130a5443e5b2c0cc8a9a  phonon-4.12.0.tar.xz
"
