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)
16 _commit=2f2ddc1f2dbca56c874e8f9c31b5b963202d80e7 # tags/json-c-0.16-20220414^0
17 source=("git+https://github.com/json-c/json-c#commit=$_commit")
22 local tag="$(git describe --tags --abbrev=0)"
23 local ver="$(git describe --tags)"
24 echo "${tag%-*}${ver#$tag}" | sed 's/^json-c-//;s/[^-]*-g/r&/;s/-/+/g'
32 cmake -S json-c -B build -G Ninja \
33 -DCMAKE_BUILD_TYPE=None \
34 -DCMAKE_INSTALL_PREFIX=/usr \
35 -DCMAKE_INSTALL_LIBDIR=/usr/lib \
36 -DBUILD_STATIC_LIBS=OFF \
37 -DENABLE_THREADING=ON \
43 cmake --build build --target test
47 DESTDIR="$pkgdir" cmake --install build
48 install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 json-c/COPYING