# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks-old
pkgname=kfilemetadata5
pkgver=5.116.0
pkgrel=0
pkgdesc="A library for extracting file metadata"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-or-later AND ( LGPL-2.1-only OR LGPL-3.0-only )"
depends_dev="
	attr-dev
	exiv2-dev
	karchive5-dev
	kconfig5-dev
	kcoreaddons5-dev
	ki18n5-dev
	qt5-qtbase-dev
	taglib-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	ffmpeg-dev
	qt5-qttools-dev
	samurai
	"
_repo_url="https://invent.kde.org/frameworks/kfilemetadata.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kfilemetadata-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
builddir="$srcdir/kfilemetadata-$pkgver"

replaces="kfilemetadata<=5.110.0-r0"

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

check() {
	# Broken tests
	local skipped_tests="("
	local tests="
		usermetadatawritertest
		extractorcoveragetest
		propertyinfotest_localized
		extractorcollectiontest
		"
	for test in $tests; do
		skipped_tests="$skipped_tests|$test"
	done
	skipped_tests="$skipped_tests)test"
	ctest --test-dir build --output-on-failure -E "$skipped_tests"
}

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

sha512sums="
1c5d264ad2bc123ba0d85882461009efc10c268441e33f82810823d1e2c6fb30209336542b4e2c1eabb96b53cc9184fc3982c27922872a9b92cac38bafe2da0e  kfilemetadata-5.116.0.tar.xz
"
