summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 714fe0f9d12d736274c3128efbf802d1f380588c (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
# Maintainer: Jesin <Jesin00@gmail.com>
# Contributor: Eduardo Sánchez Muñoz
pkgname=nlohmann-json-git
_name="${pkgname%-git}"
pkgver=3.1.1
pkgrel=1
pkgdesc='Header-only JSON library for Modern C++'
url='https://github.com/nlohmann/json'
license=(MIT)
arch=(x86_64)
makedepends=(cmake git)
provides=("$_name=${pkgver%%+*}")
conflicts=("$_name")
source=("git+$url")
sha256sums=(SKIP)

pkgver() {
	cd json
	local v="$(git describe --tags)"
	v="${v#v}"
	printf %s "${v//-/+}"
}

build() {
	mkdir build
	cd build
	cmake ../json -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release 
	make
}

check() {
	cd build
	ctest --output-on-failure
}

package() {
	cd build
	make "DESTDIR=$pkgdir" install
	install -Dm644 "-t$pkgdir/usr/share/licenses/$_name" ../json/LICENSE.MIT
}