APKBUILD 2.97 KB
Newer Older
Bart Ribbers's avatar
Bart Ribbers committed
1 2 3
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=discover
4
pkgver=5.17.4
5
pkgrel=0
6
arch="all !armhf" # armhf blocked by qt5-qtdeclarative
Bart Ribbers's avatar
Bart Ribbers committed
7 8 9 10 11 12 13
url="https://userbase.kde.org/Discover"
pkgdesc="KDE Plasma resources management GUI"
license="LGPL-2.0-or-later AND (GPL-2.0-only OR GPL-3.0-only) AND GFDL-1.2-only"
depends="kirigami2"
makedepends="extra-cmake-modules qt5-qtbase-dev qt5-qtdeclarative-dev kcoreaddons-dev kconfig-dev kcrash-dev kdbusaddons-dev ki18n-dev karchive-dev kxmlgui-dev kitemmodels-dev kio-dev kdeclarative-dev attica-dev knewstuff-dev plasma-framework-dev appstream-dev flatpak-dev"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/plasma/$pkgver/discover-$pkgver.tar.xz"
14
subpackages="$pkgname-lang $pkgname-backend-flatpak:backend_flatpak"
Bart Ribbers's avatar
Bart Ribbers committed
15 16

case "$CARCH" in
17 18 19 20
	x86|x86_64)
		makedepends="$makedepends fwupd-dev"
		subpackages="$subpackages $pkgname-backend-fwupd:backend_fwupd"
		;;
Bart Ribbers's avatar
Bart Ribbers committed
21 22 23
	*) ;;
esac

24 25 26 27 28 29
prepare() {
	default_prepare

	mkdir "$builddir"/build
}

Bart Ribbers's avatar
Bart Ribbers committed
30
build() {
31 32
	cd "$builddir"/build
	cmake "$builddir" \
Bart Ribbers's avatar
Bart Ribbers committed
33 34
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
35 36
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_DISABLE_FIND_PACKAGE_Snapd=ON
Bart Ribbers's avatar
Bart Ribbers committed
37 38 39 40
	make
}

check() {
41
	cd "$builddir"/build
Bart Ribbers's avatar
Bart Ribbers committed
42 43 44 45 46
	# knsbackendtest and flatpaktest fail to find their required executables
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest -E "(knsbackend|flatpak)test"
}

package() {
47
	cd "$builddir"/build
Bart Ribbers's avatar
Bart Ribbers committed
48 49 50
	DESTDIR="$pkgdir" make install
}

51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
backend_flatpak() {
	pkgdesc="Flatpak backend for $pkgname"
	depends=""
	install_if="$pkgname flatpak"

	mkdir -p \
		"$subpkgdir"/usr/lib/qt5/plugins/discover \
		"$subpkgdir"/usr/share/libdiscover/categories \
		"$subpkgdir"/usr/lib/qt5/plugins/discover-notifier \
		"$subpkgdir"/usr/share/applications \
		"$subpkgdir"/usr/share/metainfo \
		"$subpkgdir"/usr/share/icons/hicolor/scalable/apps

	mv "$pkgdir"/usr/lib/qt5/plugins/discover/flatpak-backend.so \
		"$subpkgdir"/usr/lib/qt5/plugins/discover/
	mv "$pkgdir"/usr/share/libdiscover/categories/flatpak-backend-categories.xml \
		"$subpkgdir"/usr/share/libdiscover/categories/
	mv "$pkgdir"/usr/lib/qt5/plugins/discover-notifier/FlatpakNotifier.so \
		"$subpkgdir"/usr/lib/qt5/plugins/discover-notifier/
	mv "$pkgdir"/usr/share/applications/org.kde.discover-flatpak.desktop \
		"$subpkgdir"/usr/share/applications/
	mv "$pkgdir"/usr/share/metainfo/org.kde.discover.flatpak.appdata.xml \
		"$subpkgdir"/usr/share/metainfo/
	mv "$pkgdir"/usr/share/icons/hicolor/scalable/apps/flatpak-discover.svg \
		"$subpkgdir"/usr/share/icons/hicolor/scalable/apps/
}

backend_fwupd() {
	pkgdesc="fwupd backend for $pkgname"
	depends=""
	install_if="$pkgname fwupd"

	mkdir -p \
		"$subpkgdir"/usr/lib/qt5/plugins/discover

	mv "$pkgdir"/usr/lib/qt5/plugins/discover/fwupd-backend.so \
		"$subpkgdir"/usr/lib/qt5/plugins/discover/
}

90
sha512sums="a31df976ce053c898e22c9f3b9c8f06e461a785c6fa6048cbca51ee0d08597f7e300dfde8132c5d1d326d32476abe09d5637ae9b0e358c03d310d939bae19736  discover-5.17.4.tar.xz"