Name json-c
Description JSON implementation in C
Version 0.18-2
Package Base json-c
Homepage https://github.com/json-c/json-c/wiki
Maintainers ['Jan Alexander Steffens (heftig) <heftig@archlinux.org>']
Contributors ['Geoffroy Carrier <geoffroy.carrier@koon.fr>', 'congyiwu <congyiwu AT gmail DOT com>']
Distro-repo https://gitlab.archlinux.org/archlinux/packaging/packages/json-c
Sources ['git+https://github.com/json-c/json-c#tag=json-c-0.18-20240915']
Dependencies ['glibc']
Optional-Dependencies []
Build-Dependencies ['cmake', 'git', 'ninja']
Provides ['libjson-c.so']
Builddate 14-05-2025 00:39:08
Architecture x86_64
Distro-Version
Licenses ['MIT']
Hash 5900c861de5cdacb14d040bf77db6e785708ba31fab5d4824e3a98983ccce790
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Geoffroy Carrier <geoffroy.carrier@koon.fr>
# Contributor: congyiwu <congyiwu AT gmail DOT com>

pkgname=json-c
pkgver=0.18
_tagdate=20240915
pkgrel=2
pkgdesc="JSON implementation in C"
url="https://github.com/json-c/json-c/wiki"
license=(MIT)
arch=(x86_64)
depends=(
  glibc
)
makedepends=(
  cmake
  git
  ninja
)
provides=(libjson-c.so)
source=("git+https://github.com/json-c/json-c#tag=json-c-$pkgver-$_tagdate")
b2sums=('4abc79ff71b8320022f4385221ff0c7183e2f150c94e3d837369226d26c118a2123823cb5c5123299b87068e998bca543ee20a74b9d6fbe39eb0cbd8600a8473')

build() {
  local cmake_options=(
    -D BUILD_STATIC_LIBS=OFF
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_INSTALL_LIBDIR=/usr/lib
    -D CMAKE_INSTALL_PREFIX=/usr
    -D CMAKE_POLICY_VERSION_MINIMUM=3.5
    -D ENABLE_RDRAND=OFF
    -D ENABLE_THREADING=ON
  )

  cmake -S json-c -B build -G Ninja "${cmake_options[@]}"
  cmake --build build
}

check() {
  ctest --test-dir build --output-on-failure --stop-on-failure -j$(nproc)
}

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

# vim:set sw=2 sts=-1 et: