Skip to content

Commit

Permalink
Ports: Add nlohmann-json
Browse files Browse the repository at this point in the history
  • Loading branch information
janso3 authored and linusg committed Feb 8, 2023
1 parent 32e9293 commit 1f20728
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions Ports/AvailablePorts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
27 changes: 27 additions & 0 deletions Ports/nlohmann-json/package.sh
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 1f20728

Please sign in to comment.