SUMMARY="A regular expression library"
DESCRIPTION="Oniguruma is a regular expressions library. \
The characteristics of this library is that different character encoding \
for every regular expression object can be specified."
HOMEPAGE="https://github.com/kkos/oniguruma"
COPYRIGHT="2016 K.Kosako"
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="https://github.com/kkos/oniguruma/releases/download/v$portVersion/onig-$portVersion.tar.gz"
CHECKSUM_SHA256="ab5992a76b7ab2185b55f3aacc1b0df81132c947b3d594f82eb0b41cf219725f"
SOURCE_DIR="onig-$portVersion"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	oniguruma$secondaryArchSuffix = $portVersion
	lib:libonig$secondaryArchSuffix = 5.0.0 compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	oniguruma${secondaryArchSuffix}_devel = $portVersion
	cmd:onig_config$secondaryArchSuffix = $portVersion
	devel:libonig$secondaryArchSuffix = 5.0.0 compat >= 5
	"
REQUIRES_devel="
	oniguruma$secondaryArchSuffix == $portVersion base
	"

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

BUILD()
{
	touch NEWS ChangeLog
	autoreconf -vfi
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	rm $libDir/libonig.la $libDir/libonig.a

	prepareInstalledDevelLib libonig
	fixPkgconfig

	packageEntries devel \
		$developDir \
		$binDir/onig-config
}

TEST()
{
	make check
}
