Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

88.2. json-c-0.19

JSON implementation in C

0.19-1 · MIT · 0.6 SBU · 209.3 KiB, 24 files · 41_system, 34 of 1047 · ports/core/formats/json-c

Homepage: https://github.com/json-c/json-c

json-c is a small C library for reading and writing JSON as a tree of reference-counted objects. Storage and system tools are its main users here: cryptsetup keeps LUKS2 metadata in JSON through it, and nvme-cli, libnvme, ndctl, crun and libvirt link it, as do gdal, freerdp and clamav.

Depends on: cmake, ninja.

Required by (15): accountsservice, clamav, crun, cryptsetup, freerdp, gdal, libmypaint, libnvme, libvirt, ndctl, newsboat, nvme-cli, thunderbird, tpm2-tss, v4l-utils.

Sources: json-c-0.19.tar.gz (451.4 KiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install json-c'

build.sh:

cmake -S . -B build -G Ninja \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBEXECDIR=lib \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_C_FLAGS_RELEASE="$CFLAGS -DNDEBUG" \
    -DBUILD_TESTING=OFF \
    -DBUILD_SHARED_LIBS=ON \
    -DBUILD_STATIC_LIBS=OFF \
    -DDISABLE_EXTRA_LIBS=ON \
    -Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

Libraries: libjson-c.so.

Directories: /usr/include/json-c, /usr/lib/cmake/json-c, /usr/share/licenses/json-c.