SUMMARY="A C library for parsing and emitting YAML"
DESCRIPTION="LibYAML covers presenting and parsing processes. Thus LibYAML \
defines the following two processors:
* Parser, which takes an input stream of bytes and produces a sequence of \
parsing events.
* Emitter, which takes a sequence of events and produces a stream of bytes."
HOMEPAGE="https://pyyaml.org/wiki/LibYAML"
COPYRIGHT="2017-2018 Ingy döt Net
	2006-2016 Kirill Simonov"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://pyyaml.org/download/libyaml/yaml-$portVersion.tar.gz"
CHECKSUM_SHA256="c642ae9b75fee120b2d96c712538bd2cf283228d2337df2cf2988e3c02678ef4"
SOURCE_DIR="yaml-$portVersion"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

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

PROVIDES="
	libyaml$secondaryArchSuffix = $portVersion
	lib:libyaml_0$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	libyaml${secondaryArchSuffix}_devel = $portVersion
	devel:libyaml$secondaryArchSuffix = $libVersionCompat
	devel:libyaml_0$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES_devel="
	libyaml$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:awk
	cmd:cmp
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	"

defineDebugInfoPackage libyaml$secondaryArchSuffix \
	"$libDir"/libyaml-0.so.$libVersion

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

INSTALL()
{
	make install

	rm -f "$libDir"/*.la

	prepareInstalledDevelLibs libyaml libyaml-0
	fixPkgconfig

	# devel package
	packageEntries devel \
		"$developDir"
}

TEST()
{
	make check
}
