SUMMARY="A library that simplifies the drawing of beautiful curves"
DESCRIPTION="LibSpiro is a shared library designed to give programs the \
ability to create smooth continuous curves based on a given set of codes and \
X,Y constraints.

The main user(s) of Libspiro are Font editing programs such as FontForge, and \
forked copies have been seen in more artistic programs such as InkScape, or \
in libraries such as GEGL. There may be other possible uses in future, and \
this library has strong potential in graphical and vector type programs."
HOMEPAGE="https://homepage/of/projectx.org"
COPYRIGHT="2007 Raph Levien
	George Williams"
LICENSE="GNU GPL v3"
REVISION="1"
srcGitRev="8c7a31eda7dbd097fd0fae19ca7c7a67bc489d02"
SOURCE_URI="https://github.com/fontforge/libspiro/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="79afdbbc15a30a0acc822123476c7713c800776a6e91bd9042ddc19950172cf0"
SOURCE_FILENAME="libspiro-$srcGitRev.tar.gz"
SOURCE_DIR="libspiro-$srcGitRev"

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

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

PROVIDES="
	libspiro$secondaryArchSuffix = $portVersion
	lib:libspiro$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

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

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

defineDebugInfoPackage libspiro$secondaryArchSuffix \
	$libDir/libspiro.so.$libVersion

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

INSTALL()
{
	make install

	# remove libtool file
	rm $libDir/*.la

	prepareInstalledDevelLib libspiro
	fixPkgconfig

	packageEntries devel \
		$developDir
}

TEST()
{
	make check
}
