jobcore/json-c/PKGBUILD-arch
2024-07-05 01:29:03 +03:00

48 lines
1.2 KiB
Text

# 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.17
_tagdate=20230812
pkgrel=2
pkgdesc="A 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=('9e0b0f41703460a4a61bf4e2b005bbc436f0f563a1a82ce8acb399d5efa18744ec86e8610866568fc6f77e3eec097fd688cbb9cb6bfbf7179b8178d8ee2de3ff')
build() {
local cmake_options=(
-DCMAKE_BUILD_TYPE=None
-DCMAKE_INSTALL_PREFIX=/usr
-DCMAKE_INSTALL_LIBDIR=/usr/lib
-DBUILD_STATIC_LIBS=OFF
-DENABLE_THREADING=ON
-DENABLE_RDRAND=OFF
)
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: