# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=maui
maintainer="team/kde <bribbers@disroot.org>"
pkgname=pix
pkgver=4.0.0
pkgrel=0
_geonames_pkgver=2020.06.25
pkgdesc="Image gallery manager built with MauiKit"
# armhf blocked by qt5-qtdeclarative
# s390x, armhf, x86, ppc64le blocked by mauikit-imagetools
arch="all !armhf !s390x !x86 !ppc64le"
url="https://invent.kde.org/maui/maui-pix"
license="GPL-3.0-or-later"
depends="
	kimageformats
	kquickimageeditor
	qt6-qtbase-sqlite
	qt6-qtlocation
	"
makedepends="
	attica-dev
	exiv2-dev
	extra-cmake-modules
	kconfig-dev
	ki18n-dev
	kio-dev
	knotifications-dev
	mauikit-dev
	mauikit-filebrowsing-dev
	mauikit-imagetools-dev
	qt6-qtbase-dev
	qt6-qtdeclarative-dev
	qt6-qtdeclarative-private-dev
	qt6-qtlocation-dev
	qt6-qtsvg-dev
	samurai
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/maui/maui-pix.git"
source="https://download.kde.org/stable/maui/pix/$pkgver/maui-pix-$pkgver.tar.xz
	https://github.com/pmsourcedump/geonames/archive/$_geonames_pkgver/geonames-$_geonames_pkgver.tar.gz
	"
options="!check" # No tests available
builddir="$srcdir/maui-$pkgname-$pkgver"

prepare() {
	default_prepare

	unzip "$srcdir/geonames-$_geonames_pkgver"/cities1000.zip
}

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

package() {
	mv "$builddir"/cities1000.txt build/src/
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
d866466a53f45341bcec43eb0bbf1c36bacfa8914541339f3671eea4a5c7e7292fb34c66c2d1fa1c9d428c8b8ab03eb057ad6a155f4db09c1336b66801a05e97  maui-pix-4.0.0.tar.xz
07485983a5ce0f03f1e12e64c280abe01e81beaa22b2dd43bc1b0e7632298acbfb83f09ef8c01a0915481c8e918a430b97d68f1ed5d43f76506798245345bc14  geonames-2020.06.25.tar.gz
"
