SUMMARY="Arithmetics of complex numbers with arbitrarily high precision"
DESCRIPTION="GNU Mpc is a C library for the arithmetic of complex numbers \
with arbitrarily high precision and correct rounding of the result. It \
extends the principles of the IEEE-754 standard for fixed precision real \
floating point numbers to complex numbers, providing well-defined semantics \
for every operation. At the same time, speed of operation at high precision \
is a major design goal."
HOMEPAGE="http://www.multiprecision.org/mpc/"
COPYRIGHT="2006-2020 INRIA"
LICENSE="GNU LGPL v3"
REVISION="1"
SOURCE_URI="https://ftpmirror.gnu.org/mpc/mpc-$portVersion.tar.gz"
CHECKSUM_SHA256="17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"

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

PROVIDES="
	mpc$secondaryArchSuffix = $portVersion
	lib:libmpc$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libgmp$secondaryArchSuffix
	lib:libmpfr$secondaryArchSuffix >= 6
	"

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

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libgmp$secondaryArchSuffix
	devel:libmpfr$secondaryArchSuffix >= 6
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:make
	"

defineDebugInfoPackage mpc$secondaryArchSuffix \
	$libDir/libmpc.so.$libVersion

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

INSTALL()
{
	make install
	rm $libDir/libmpc.la

	if [ -n "$secondaryArchSuffix" ]; then
		rm -rf $infoDir
	fi

	prepareInstalledDevelLib libmpc
	packageEntries devel $developDir
}

TEST()
{
	make check
}
