# Contributor: k0r10n <k0r10n.dev@gmail.com>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=qjson
pkgver=0.9.0
pkgrel=4
pkgdesc="A qt-based library that maps JSON data to QVariant objects"
url="https://qjson.sourceforge.net/"
arch="all"
license="LGPL-2.1-or-later"
makedepends="qt5-qtbase-dev cmake"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/flavio/qjson/archive/$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=None \
		. $CMAKE_CROSSOPTS
	make -C build
}

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

sha512sums="ff0674f32abc6c88f9c535a58931f60baafa355655b043009a2574dadb822f10ec25017b78f2911f897a554a34733d7332c94cf4290dec16a631e22070c15e61  qjson-0.9.0.tar.gz"
