SUMMARY="A C++ library to combine symbolic manipulation with numeric computations"
DESCRIPTION="GiNaC (which is a recursive acronym for GiNaC is Not a CAS) was \
specifically developed to replace the Maple CAS as an engine for xloops. It is \
a C++ library and attempts to bring the features of a typical CAS to the C++ \
language itself. By doing that, it enables symbolic manipulation to be used in \
existing numeric software written in C++."
HOMEPAGE="https://www.ginac.de/"
COPYRIGHT="1999-2016 Johannes Gutenberg University Mainz, Germany"
LICENSE="GNU GPL v2"
REVISION="2"
SOURCE_URI="https://src.fedoraproject.org/repo/pkgs/ginac/ginac-1.7.2.tar.bz2/sha512/5c356beb8e0830b9f5805870f67298d4c19e512db8b8f46a37b490c19179a5c99e4497439e5adb575dd97e7deb5fe0b931a4b6db80e98a8e1e6f46977e33d8cf/ginac-$portVersion.tar.bz2"
CHECKSUM_SHA256="24b75b61c5cb272534e35b3f2cfd64f053b28aee7402af4b0e569ec4de21d8b7"

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

if [ "$targetArchitecture" != x86_gcc2 ]; then
	commandSuffix=$secondaryArchSuffix
	commandBinDir=$binDir
else
	commandSuffix=
	commandBinDir=$prefix/bin
fi

PROVIDES="
	ginac$secondaryArchSuffix = $portVersion
	lib:libginac$secondaryArchSuffix = 5.0.3 compat >= 5
	cmd:ginac_excompiler$commandSuffix = $portVersion
	cmd:ginsh$commandSuffix = $portVersion
	cmd:viewgar$commandSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libcln$secondaryArchSuffix >= 6
	lib:libncurses$secondaryArchSuffix
	lib:libreadline$secondaryArchSuffix
	"

PROVIDES_devel="
	ginac${secondaryArchSuffix}_devel = $portVersion
	devel:libginac$secondaryArchSuffix = 5.0.3 compat >= 5
	"
REQUIRES_devel="
	ginac$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libcln$secondaryArchSuffix >= 6
	devel:libncurses$secondaryArchSuffix
	devel:libreadline$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:diff
	cmd:make
	cmd:python >= 2.7
	cmd:gcc$secondaryArchSuffix
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	runConfigure --omit-dirs binDir ./configure --bindir=$commandBinDir
	make $jobArgs
}

INSTALL()
{
	make install

	rm $libDir/*.la

	prepareInstalledDevelLib libginac

	fixPkgconfig

	packageEntries devel \
		$developDir
}
