SUMMARY="A library for making brush strokes"
DESCRIPTION="Libmypaint is the brush library used by MyPaint and a \
number of other painting programs."
HOMEPAGE="https://github.com/mypaint/libmypaint"
COPYRIGHT="2008-2011 Martin Renold and contributors"
LICENSE="ISC"
REVISION="1"
SOURCE_URI="https://github.com/mypaint/libmypaint/archive/refs/tags/v$portVersion.tar.gz"
CHECKSUM_SHA256="9d888a0f13deeba06f2d63949426f4a5e4656f451b9052e4d8f7fd372a6f274e"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

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

PROVIDES="
	libmypaint$secondaryArchSuffix = $portVersion
	lib:libmypaint$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libglib_2.0$secondaryArchSuffix
#	lib:libgirepository_1.0$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	lib:libjson_c$secondaryArchSuffix
	"

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

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libglib_2.0$secondaryArchSuffix
#	devel:libgirepository_1.0$secondaryArchSuffix
	devel:libjson_c$secondaryArchSuffix
	"

BUILD_PREREQUIRES="
	cmd:autoconf
	cmd:automake
	cmd:gcc$secondaryArchSuffix
	cmd:intltool_update
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	cmd:python3.7
	"

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

BUILD()
{
	./autogen.sh
	runConfigure ./configure --disable-introspection
	make $jobArgs
}

INSTALL()
{
	make install

	rm -f $libDir/libmypaint.la

	# prepare devel/lib
	prepareInstalledDevelLib libmypaint
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}

TEST()
{
	make check
}