# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=mycroft-plasmoid
pkgver=0_git20230618
pkgrel=1
_commit="18f1acca356f8b8ca64a6b10ab89f91f93341a97"
pkgdesc="Plasma integration of different Mycroft AI services"
url="https://invent.kde.org/utilities/mycroft-plasmoid"
# ppc64le, s390x, riscv64, armhf, armv7 and loongarch64 blocked by mycroft-gui
arch="all !ppc64le !s390x !armhf !riscv64 !armv7 !loongarch64"
license="Apache-2.0 AND LGPL-2.0-or-later AND LicenseRef-KDE-Accepted-GPL"
depends="mycroft-gui"
makedepends="
	extra-cmake-modules
	ki18n5-dev
	knotifications5-dev
	plasma-framework5-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtwebsockets-dev
	samurai
	"
source="https://invent.kde.org/utilities/mycroft-plasmoid/-/archive/$_commit/mycroft-plasmoid-$_commit.tar.gz"
options="!check" # No tests
builddir="$srcdir/mycroft-plasmoid-$_commit"

provides="plasma-mycroft=$pkgver-r$pkgrel" # Backwards compatibility
replaces="plasma-mycroft" # Backwards compatibility

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

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

	# Conflicts with mycroft-core and is unnecessary
	rm "$pkgdir"/etc/mycroft/mycroft.conf
}

sha512sums="
0dddffb61b3bc64256e5a722f87875e176e6d06bf5b7fbd9ea3de148d3b0589a987a092ff41830bd7cb043f427ca4549b174c44eb4c805e4492bc1bfb45d6fc8  mycroft-plasmoid-18f1acca356f8b8ca64a6b10ab89f91f93341a97.tar.gz
"
