summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user/json/APKBUILD36
1 files changed, 36 insertions, 0 deletions
diff --git a/user/json/APKBUILD b/user/json/APKBUILD
new file mode 100644
index 000000000..750f3fbd1
--- /dev/null
+++ b/user/json/APKBUILD
@@ -0,0 +1,36 @@
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=json
+pkgver=3.11.3
+pkgrel=0
+pkgdesc="JSON for Modern C++"
+url="https://json.nlohmann.me/"
+arch="noarch"
+license="MIT"
+depends=""
+makedepends="cmake"
+subpackages=""
+source="json-$pkgver.tar.gz::https://github.com/nlohmann/json/archive/refs/tags/v$pkgver.tar.gz"
+
+build() {
+ if [ "$CBUILD" != "$CHOST" ]; then
+ CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
+ fi
+ cmake \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_LIBDIR=lib \
+ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+ ${CMAKE_CROSSOPTS} \
+ -Bbuild
+ make DESTDIR="$pkgdir" -C build
+}
+
+check() {
+ cd build
+ CTEST_OUTPUT_ON_FAILURE=true ctest -E '(cmake_fetch*|test-unicode*)' -j${JOBS}
+}
+
+package() {
+ make DESTDIR="$pkgdir" -C build install
+}
+
+sha512sums="7df19b621de34f08d5d5c0a25e8225975980841ef2e48536abcf22526ed7fb99f88ad954a2cb823115db59ccc88d1dbe74fe6c281b5644b976b33fb78db9d717 json-3.11.3.tar.gz"