SUMMARY="A JSON implementation in C"
DESCRIPTION="JSON-C implements a reference counting object model that allows \
you to easily construct JSON objects in C, output them as JSON formatted \
strings and parse JSON formatted strings back into the C representation of \
JSON objects."
HOMEPAGE="https://github.com/json-c/json-c/wiki"
COPYRIGHT="2009-2012, 2016-2017 Eric Haszlakiewicz
	2004-2005, 2013 Metaparadigm Pte. Ltd.
	2009-2012 Hewlett-Packard Development Company, L.P.
	2008-2009 Yahoo! Inc.
	2016 Alexandru Ardelean"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://s3.amazonaws.com/json-c_releases/releases/json-c-$portVersion.tar.gz"
CHECKSUM_SHA256="b87e608d4d3f7bfdd36ef78d56d53c74e66ab278d318b71e6002a369d36f4873"
SOURCE_DIR="json-c-$portVersion"

ARCHITECTURES="all ?x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

libVersion="4.0.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"

PROVIDES="
	json_c4$secondaryArchSuffix = $portVersion
	lib:libjson_c$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoreconf
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	autoreconf -fi
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install-strip

	rm $libDir/libjson-c.la

	prepareInstalledDevelLib libjson-c
	fixPkgconfig
	rm -rf $developDir
}

TEST()
{
	make check
}
