From 1f207282a142b45077e635a01f0d9dca3233b9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Offenh=C3=A4user?= Date: Wed, 8 Feb 2023 12:12:44 +0100 Subject: [PATCH] Ports: Add nlohmann-json --- Ports/AvailablePorts.md | 1 + Ports/nlohmann-json/package.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 Ports/nlohmann-json/package.sh diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index eea9144bac07dd..90cdc07afa7ad8 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -180,6 +180,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n | [`nethack`](nethack/) | nethack | 3.6.6 | https://www.nethack.org/ | | [`ninja`](ninja/) | Ninja | 1.11.0 | https://ninja-build.org/ | | [`nippon`](nippon/) | Nippon Safes Inc. | 1.0 | https://www.scummvm.org/games/#games-nippon | +| [`nlohmann-json`](nlohmann-json/) | JSON for Modern C++ | 3.11.2 | https://json.nlohmann.me/ | | [`npiet`](npiet/) | Piet language interpreter | 1.3f | https://www.bertnase.de/npiet/ | | [`npth`](npth/) | New GNU Portable Threads Library | 1.6 | https://gnupg.org/software/npth/index.html | | [`ntbtls`](ntbtls/) | The Not Too Bad TLS Library | 0.2.0 | https://gnupg.org/software/ntbtls/index.html | diff --git a/Ports/nlohmann-json/package.sh b/Ports/nlohmann-json/package.sh new file mode 100755 index 00000000000000..bac9bbc033109d --- /dev/null +++ b/Ports/nlohmann-json/package.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port='nlohmann-json' +version='3.11.2' +auth_type='sha256' +workdir="json-${version}" +files="https://github.com/nlohmann/json/archive/refs/tags/v${version}.tar.gz json-${version}.tar.gz d69f9deb6a75e2580465c6c4c5111b89c4dc2fa94e3a85fcd2ffcd9a143d9273" +useconfigure='true' +configopts=( + "-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt" + "-DJSON_BuildTests=OFF" +) + +configure() { + mkdir -p "${PORT_BUILD_DIR}/json-${version}-build" + cd "${PORT_BUILD_DIR}/json-${version}-build" + cmake "${configopts[@]}" "${PORT_BUILD_DIR}/json-${version}" +} + +build() { + cd "${PORT_BUILD_DIR}/json-${version}-build" + make "${makeopts[@]}" +} + +install() { + cd "${PORT_BUILD_DIR}/json-${version}-build" + make install +}