1 # Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
2 # Contributor: Geoffroy Carrier <geoffroy.carrier@koon.fr>
3 # Contributor: congyiwu <congyiwu AT gmail DOT com>
8 pkgdesc="A JSON implementation in C"
9 url="https://github.com/json-c/json-c/wiki"
13 makedepends=(git cmake ninja)
14 provides=(libjson-c.so)
15 _commit=9021cdcdd01fc9dbcbe1f06391848c2ac915212f # tags/json-c-0.15-20200726^0
16 source=("git+https://github.com/json-c/json-c#commit=$_commit")
21 local tag="$(git describe --tags --abbrev=0)"
22 local ver="$(git describe --tags)"
23 echo "${tag%-*}${ver#$tag}" | sed 's/^json-c-//;s/-/+/g'
31 cmake -S json-c -B build -G Ninja \
32 -DCMAKE_BUILD_TYPE=None \
33 -DCMAKE_INSTALL_PREFIX=/usr \
34 -DCMAKE_INSTALL_LIBDIR=/usr/lib \
35 -DBUILD_STATIC_LIBS=OFF \
36 -DENABLE_THREADING=ON \
42 cmake --build build --target test
46 DESTDIR="$pkgdir" cmake --install build
47 install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 json-c/COPYING