# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks-old
maintainer="team/kde <bribbers@disroot.org>"
pkgname=solid5
pkgver=5.116.0
pkgrel=0
pkgdesc="Hardware integration and detection"
# armhf blocked by qt5-qtdeclarative
arch="all !armhf"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-only OR LGPL-3.0-only"
depends_dev="qt5-qtdeclarative-dev"
makedepends="$depends_dev
	bison
	doxygen
	eudev-dev
	extra-cmake-modules
	flex-dev
	qt5-qttools-dev
	samurai
	udisks2-dev
	upower-dev
	"
_repo_url="https://invent.kde.org/frameworks/solid.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/solid-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-libs:_libs $pkgname-doc $pkgname-lang"
builddir="$srcdir/solid-$pkgver"

replaces="solid<=5.110.0-r0"

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

check() {
	# solidmttest is broken
	ctest --test-dir build -E "solidmttest"
}

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

_libs() {
	# workaround: need to specify replaces, otherwise upgrade will fail
	replaces="solid-libs<=5.110.0-r0"
	default_libs
}

sha512sums="
1d6cb0c096bfede35a4b2963cd87e2ef0cb1a6be640d18c737434451e288645f7bbb0657c8ac780f3a60104c153b3b20ed7bd9c90b077d9aa7daea5740947b36  solid-5.116.0.tar.xz
"
