archrelease: copy trunk to extra-x86_64
[arch-packages.git] / json-c / trunk / PKGBUILD
blob5f57aa6d3ce64a077da64ee7e0c0691bad17c3cd
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>
5 pkgname=json-c
6 pkgver=0.16
7 pkgrel=1
8 pkgdesc="A JSON implementation in C"
9 url="https://github.com/json-c/json-c/wiki"
10 license=(MIT)
11 arch=(x86_64)
12 depends=(glibc)
13 makedepends=(git cmake ninja)
14 provides=(libjson-c.so)
15 _commit=2f2ddc1f2dbca56c874e8f9c31b5b963202d80e7  # tags/json-c-0.16-20220414^0
16 source=("git+https://github.com/json-c/json-c#commit=$_commit")
17 sha256sums=('SKIP')
19 pkgver() {
20   cd json-c
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/r&/;s/-/+/g'
26 prepare() {
27   cd json-c
30 build() {
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 \
37     -DENABLE_RDRAND=OFF
38   cmake --build build
41 check() {
42   cmake --build build --target test
45 package() {
46   DESTDIR="$pkgdir" cmake --install build
47   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 json-c/COPYING
50 # vim:set sw=2 et: