aboutsummaryrefslogtreecommitdiffstats
path: root/testing/nlohmann-json/APKBUILD
blob: 7dd925b4ed2820f01afefc6a33e98e4935297db5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Contributor: Nick Black <dankamongmen@gmail.com>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=nlohmann-json
pkgver=3.7.1
pkgrel=0
pkgdesc="JSON for Modern C++"
url="https://github.com/nlohmann/json"
arch="noarch"
license="MIT"
makedepends="cmake doxygen graphviz"
subpackages="$pkgname-doc"
source="nlohmann-json-$pkgver.tar.gz::https://github.com/nlohmann/json/archive/v$pkgver.tar.gz"
builddir="$srcdir/json-$pkgver"

build() {
	cmake \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	make
	make -C doc
}

check() {
	local skipped_tests=
	if [ "$CARCH" = "aarch64" ]; then
		# test-unicode_all takes too long and times out
		skipped_tests="$skipped_tests|test-unicode_all"
	fi
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E "($skipped_tests)"
}

package() {
	DESTDIR="$pkgdir" make install

	mkdir -p "$pkgdir"/usr/share/doc/$pkgname
	mv doc/html "$pkgdir"/usr/share/doc/$pkgname/
}

sha512sums="d84a7d0d26133e7f618a11f7d6aa792992aecc4a0834a15c00f082749ebe1e2a71ebb54b6572b6effee3a1d656c4c05fe3c74b88b31e150582a792a829511842  nlohmann-json-3.7.1.tar.gz"