# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=plasma-bigscreen
pkgver=0_git20201102
pkgrel=0
_commit="8a1ef82ab51006b4bf5b21388367377e7370f508"
pkgdesc="A 10-feet interface made for TVs"
url="https://invent.kde.org/plasma/plasma-bigscreen/"
arch="all !armhf" # armhf blocked by qt5-qtdeclarative
license="Apache-2.0 AND LGPL-2.0-only AND LGPL-2.1-only AND GPL-2.0-only"
depends="
	kdeconnect
	kirigami2
	plasma-nano
	plasma-nm
	plasma-pa
	plasma-settings
	plasma-workspace
	"
makedepends="
	extra-cmake-modules
	kactivities-dev
	kactivities-stats-dev
	kcmutils-dev
	kdeclarative-dev
	ki18n-dev
	kio-dev
	kirigami2-dev
	knotifications-dev
	kwayland-dev
	kwindowsystem-dev
	plasma-framework-dev
	plasma-workspace-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtmultimedia-dev
	"
source="https://invent.kde.org/plasma/plasma-bigscreen/-/archive/$_commit/plasma-bigscreen-$_commit.tar.gz"
builddir="$srcdir/plasma-bigscreen-$_commit"

prepare() {
	default_prepare

	# qmlplugindump fails for armv7+qemu (pmb#1970). This is purely for
	# packager knowledge and doesn't affect runtime, so we can disable it.
	if [ "$CARCH" = "armv7" ]; then
		sed -i "s/ecm_find_qmlmodule/# ecm_find_qmlmodule/g" CMakeLists.txt
		sed -i "s/ecm_find_qmlmodule/# ecm_find_qmlmodule/g" kcms/audio-device-chooser/CMakeLists.txt
		sed -i "s/ecm_find_qmlmodule/# ecm_find_qmlmodule/g" kcms/kdeconnect/CMakeLists.txt
		sed -i "s/ecm_find_qmlmodule/# ecm_find_qmlmodule/g" kcms/wifi/CMakeLists.txt
	fi
}

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

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

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

sha512sums="0eed8a0048684b6487136f6f3026e2a409e273aaca9bc84d9df3537ca0a3c6657ae16fd4e219be4a4ede83640c9d250c0580757aeaf3ab96b2e47b39aaad2c1e  plasma-bigscreen-8a1ef82ab51006b4bf5b21388367377e7370f508.tar.gz"
