# Maintainer: David Runge pkgname=nlohmann-json # upstream doesn't use annotated tags _commit=bc889afb4c5bf1c0d8ee29ef35eaaf4c8bef8a5d # v3.11.2^{} pkgver=3.11.2 pkgrel=1 # tests are tracked in a separate repo # https://github.com/nlohmann/json_test_data _test_pkgver=3.1.0 pkgdesc="JSON for Modern C++" arch=(any) url="https://github.com/nlohmann/json" license=(MIT) makedepends=(cmake git) source=( $pkgname::git+https://github.com/nlohmann/json#commit=$_commit?signed json_test_data-$_test_pkgver.tar.gz::https://github.com/nlohmann/json_test_data/archive/v$_test_pkgver.tar.gz ) sha512sums=('SKIP' 'db6c411b37f2154f5dd1ed90f4e8fa0907f4a736cd0ff79943bcacf9da422285ff142bb6a7dc6022b236090083166ac1ab197be3f480d8dc50b26a91a9477821') b2sums=('SKIP' '809be0728a0b9d007fcc752911bdf6f7e548d6e3ec59871ea2b16d87d8248ca4dd2f681a1d0f82c618463294188ad41d6d965b8bdc39c70fdcf4b939d4121e9c') validpgpkeys=('797167AE41C0A6D9232E48457F3CEA63AE251B69') # Niels Lohmann prepare() { mkdir -vp build-test/ mv -v json_test_data-${_test_pkgver}/ build-test/json_test_data/ } build() { cmake -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=/usr/lib \ -DCMAKE_BUILD_TYPE=None \ -DJSON_MultipleHeaders=ON \ -Wno-dev \ -B build \ -S $pkgname make VERBOSE=1 -C build cmake -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=/usr/lib \ -DCMAKE_BUILD_TYPE=None \ -DBUILD_TESTING=ON \ -DJSON_BuildTests=ON \ -DJSON_MultipleHeaders=ON \ -Wno-dev \ -B build-test \ -S $pkgname make VERBOSE=1 -C build-test } check() { make -k test -C build-test } package() { make DESTDIR="$pkgdir" install -C build install -vDm 644 $pkgname/README.md -t "$pkgdir/usr/share/doc/$pkgname/" install -vDm 644 $pkgname/LICENSE.MIT -t "$pkgdir/usr/share/licenses/$pkgname/" }