Files
haikuports/dev-libs/cjson/cjson-1.7.15.recipe
Stian Sebastian Skjelstad 156577cb10 Initial support for cJSON (#7785)
cjson_utils is enabled
2023-01-21 07:22:56 +01:00

75 lines
1.6 KiB
Bash

SUMMARY="Ultralightweight JSON parser in ANSI C"
DESCRIPTION="cJSON is an ultralightweight json parser."
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="5308fd4bd90cef7aa060558514de6a1a4a0819974a26e6ed13973c5f624c24b2"
SOURCE_DIR="cJSON-$portVersion"
PATCHES="cjson-$portVersion-pc.patch"
ARCHITECTURES="all ?x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
libVersion="1.7.15"
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
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:make
"
TEST_REQUIRES="
cmd:cmp
"
defineDebugInfoPackage cjson$secondaryArchSuffix \
$libDir/libcjson.so.$libVersion
BUILD()
{
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release \
$cmakeDirArgs . \
-DENABLE_CJSON_UTILS=ON
cmake --build build $jobArgs
}
INSTALL()
{
cmake --build build --target install
prepareInstalledDevelLib libcjson
fixPkgconfig
packageEntries devel $developDir $libDir/cmake
}
TEST()
{
cmake --build build --target test
}