# 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-other
pkgname=kid3
pkgver=3.9.5
pkgrel=0
pkgdesc="Efficient audio tagger that supports a large variety of file formats"
url="https://kid3.kde.org/"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
license="GPL-2.0-or-later"
makedepends="
	chromaprint-dev
	extra-cmake-modules
	ffmpeg-dev
	flac-dev
	id3lib-dev
	libvorbis-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qtmultimedia-dev
	qt6-qtsvg-dev
	qt6-qttools-dev
	readline-dev
	samurai
	taglib-dev
	zlib-dev
	"
subpackages="$pkgname-doc"
_repo_url="https://invent.kde.org/multimedia/kid3.git"
source="https://download.kde.org/stable/kid3/$pkgver/kid3-$pkgver.tar.xz"

build() {
	CXXFLAGS="$CXXFLAGS -flto=auto" \
	cmake -B build -G Ninja \
		-DBUILD_WITH_QT6=ON \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DWITH_APPS="qt;qml;cli"
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

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

sha512sums="
a5b21ebabeddb49a2755fd1b5c563a822419d2a82184182bda85e5be9932ccd9626e969f944fb55cfa4c85f7c7c9821adba75375f966ee90272c2cf2283acdd8  kid3-3.9.5.tar.xz
"
