2022-03-20 13:19:37 +01:00
|
|
|
# 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
|
2023-08-17 17:25:08 +02:00
|
|
|
pkgver=0.17
|
2024-07-05 00:29:03 +02:00
|
|
|
_tagdate=20230812
|
|
|
|
pkgrel=2
|
2022-03-20 13:19:37 +01:00
|
|
|
pkgdesc="A JSON implementation in C"
|
|
|
|
url="https://github.com/json-c/json-c/wiki"
|
|
|
|
license=(MIT)
|
|
|
|
arch=(x86_64)
|
2023-08-17 17:25:08 +02:00
|
|
|
depends=(
|
|
|
|
glibc
|
|
|
|
)
|
|
|
|
makedepends=(
|
|
|
|
cmake
|
|
|
|
git
|
|
|
|
ninja
|
|
|
|
)
|
2022-03-20 13:19:37 +01:00
|
|
|
provides=(libjson-c.so)
|
2024-07-05 00:29:03 +02:00
|
|
|
source=("git+https://github.com/json-c/json-c#tag=json-c-$pkgver-$_tagdate")
|
|
|
|
b2sums=('9e0b0f41703460a4a61bf4e2b005bbc436f0f563a1a82ce8acb399d5efa18744ec86e8610866568fc6f77e3eec097fd688cbb9cb6bfbf7179b8178d8ee2de3ff')
|
2022-03-20 13:19:37 +01:00
|
|
|
|
|
|
|
build() {
|
2023-08-17 17:25:08 +02:00
|
|
|
local cmake_options=(
|
|
|
|
-DCMAKE_BUILD_TYPE=None
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr
|
|
|
|
-DCMAKE_INSTALL_LIBDIR=/usr/lib
|
|
|
|
-DBUILD_STATIC_LIBS=OFF
|
|
|
|
-DENABLE_THREADING=ON
|
2022-03-20 13:19:37 +01:00
|
|
|
-DENABLE_RDRAND=OFF
|
2023-08-17 17:25:08 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
cmake -S json-c -B build -G Ninja "${cmake_options[@]}"
|
2022-03-20 13:19:37 +01:00
|
|
|
cmake --build build
|
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
2024-07-05 00:29:03 +02:00
|
|
|
ctest --test-dir build --output-on-failure --stop-on-failure -j$(nproc)
|
2022-03-20 13:19:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
DESTDIR="$pkgdir" cmake --install build
|
|
|
|
install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 json-c/COPYING
|
|
|
|
}
|
|
|
|
|
2023-08-17 17:25:08 +02:00
|
|
|
# vim:set sw=2 sts=-1 et:
|