jobcore/json-c/PKGBUILD-arch

61 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

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
2022-04-16 03:33:45 +02:00
pkgrel=1
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)
2023-08-17 17:25:08 +02:00
_commit=b4c371fa0cbc4dcbaccc359ce9e957a22988fb34 # tags/json-c-0.17-20230812^0
2022-03-20 13:19:37 +01:00
source=("git+https://github.com/json-c/json-c#commit=$_commit")
2023-08-17 17:25:08 +02:00
b2sums=('SKIP')
2022-03-20 13:19:37 +01:00
pkgver() {
cd json-c
local tag="$(git describe --tags --abbrev=0)"
local ver="$(git describe --tags)"
2022-04-16 03:33:45 +02:00
echo "${tag%-*}${ver#$tag}" | sed 's/^json-c-//;s/[^-]*-g/r&/;s/-/+/g'
2022-03-20 13:19:37 +01:00
}
prepare() {
cd json-c
}
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() {
2023-08-17 17:25:08 +02:00
cd build
ctest --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: