Files
haikuports/dev-libs/cjson/cjson-1.7.18.recipe
2025-08-24 20:26:52 +02:00

92 lines
2.4 KiB
Bash

SUMMARY="Ultralightweight JSON parser in ANSI C"
DESCRIPTION="cJSON aims to be the dumbest possible parser that you can get your job done with. \
It's a single file of C, and a single header file.
JSON is described best here: http://www.json.org/
It's like XML, but fat-free. You use it to move data around, store things, or just generally \
represent your program's state.
As a library, cJSON exists to take away as much legwork as it can, but not get in your way. As a \
point of pragmatism (i.e. ignoring the truth), I'm going to say that you can use it in one of \
two modes: Auto and Manual. Let's have a quick run-through.
I lifted some JSON from this page: http://www.json.org/fatfree.html That page inspired me to \
write cJSON, which is a parser that tries to share the same philosophy as JSON itself. Simple, \
dumb, out of the way."
HOMEPAGE="https://github.com/DaveGamble/cJSON"
COPYRIGHT="2009-2017 Dave Gamble and cJSON contributors"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/DaveGamble/cJSON/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="3aa806844a03442c00769b83e99970be70fbef03735ff898f4811dd03b9f5ee5"
SOURCE_DIR="cJSON-$portVersion"
PATCHES="cjson-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
libVersion="$portVersion"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
cjson$secondaryArchSuffix = $portVersion
lib:libcjson$secondaryArchSuffix = $libVersionCompat
lib:libcjson_utils$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_devel="
cjson${secondaryArchSuffix}_devel = $portVersion
devel:libcjson$secondaryArchSuffix = $libVersionCompat
devel:libcjson_utils$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
cjson$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
gcc${secondaryArchSuffix}_syslibs_devel
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:make
"
TEST_REQUIRES="
cmd:cmp
"
BUILD()
{
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release \
$cmakeDirArgs . \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DENABLE_CJSON_UTILS=ON \
-DENABLE_CJSON_TEST=OFF
cmake --build build $jobArgs
}
INSTALL()
{
cmake --build build --target install
prepareInstalledDevelLibs \
libcjson \
libcjson_utils
fixPkgconfig
packageEntries devel \
$developDir \
$libDir/cmake
}
TEST()
{
cmake --build build --target test
}