# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=jsoncpp
pkgver=1.8.4
pkgrel=0
pkgdesc="JSON C++ library"
url="https://github.com/open-source-parsers/jsoncpp"
arch="all"
license="Public-Domain"
makedepends="meson"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/open-source-parsers/jsoncpp/archive/$pkgver.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver

build() {
	cd "$builddir"
	# we cannot use cmake since jsoncpp is a dependency for cmake which
	# means we would get circular buildtime deps
	meson --prefix /usr --libdir /usr/lib --buildtype release --default-library shared . build
	ninja -C build
}

check() {
	cd "$builddir"
	ninja -C build test
}

package() {
	cd "$builddir"
	DESTDIR="$pkgdir" ninja -C build install
}

sha512sums="f70361a3263dd8b9441374a9a409462be1426c0d6587c865171a80448ab73b3f69de2b4d70d2f0c541764e1e6cccc727dd53178347901f625ec6fb54fb94f4f1  jsoncpp-1.8.4.tar.gz"
