summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0644330796b5525c045911881551bef4dc504f09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Maintainer:  Vincent Grande <shoober420@gmail.com>
# Contributor: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Geoffroy Carrier <geoffroy.carrier@koon.fr>
# Contributor: congyiwu <congyiwu AT gmail DOT com>

pkgname=json-c-git
pkgver=0.15
pkgrel=1
pkgdesc="A JSON implementation in C"
url="https://github.com/json-c/json-c/wiki"
license=(MIT)
arch=(x86_64)
depends=(glibc)
makedepends=(git cmake)
provides=(libjson-c.so json-c)
conflicts=(json-c)
source=("git+https://github.com/json-c/json-c")
sha256sums=('SKIP')

pkgver() {
  cd json-c
  
  git describe --tags --always | sed 's/-/+/g'
}

prepare() {
  cd json-c
}

build() {
  CFLAGS+=" $CPPFLAGS"
  CXXFLAGS+=" $CPPFLAGS"

  cmake -Hjson-c -Bbuild \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
    -DENABLE_THREADING=ON \
    -DENABLE_RDRAND=OFF
  cmake --build build
}

#check() {
#  cmake --build build --target test
#}

package() {
  DESTDIR="$pkgdir" cmake --build build --target install
  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 json-c/COPYING
}

# vim:set sw=2 et: