archrelease: copy trunk to extra-x86_64
[arch-packages.git] / json-c / trunk / PKGBUILD
blob263fc6ac0db2b37b555c00880c5e8f05e4d6e3c3
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.15
7 pkgrel=2
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=9021cdcdd01fc9dbcbe1f06391848c2ac915212f  # tags/json-c-0.15-20200726^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'
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: