OSDN Git Service

upg
[joborun/jobcore.git] / json-c / PKGBUILD-arch
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>
4
5 pkgname=json-c
6 pkgver=0.15
7 pkgrel=3
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 options=(debug)
16 _commit=9021cdcdd01fc9dbcbe1f06391848c2ac915212f  # tags/json-c-0.15-20200726^0
17 source=("git+https://github.com/json-c/json-c#commit=$_commit")
18 sha256sums=('SKIP')
19
20 pkgver() {
21   cd json-c
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'
25 }
26
27 prepare() {
28   cd json-c
29 }
30
31 build() {
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 \
38     -DENABLE_RDRAND=OFF
39   cmake --build build
40 }
41
42 check() {
43   cmake --build build --target test
44 }
45
46 package() {
47   DESTDIR="$pkgdir" cmake --install build
48   install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 json-c/COPYING
49 }
50
51 # vim:set sw=2 et: