SUMMARY="Flexible command-line scientific calculator"
DESCRIPTION="Wcalc is a very capable calculator.

It supports abitrary precision, has standard functions (sin, asin, and sinh \
for example, in either radians or degrees), many pre-defined constants \
(pi, e, c, etc.), support for using variables, \"active\" variables, a \
command history, hex/octal/binary input and output, unit conversions, \
embedded comments, and an expandable expression entry field. It evaluates \
expressions using the standard order of operations.

Wcalc uses intuitive expressions and implicit multiplication. For example, \
Wcalc will evaluate: 5sin 4!-7*2(4%6)^2 to be -221.96631678. Wcalc will also \
understand basic UTF-8 entities, and so will evaluate √7×2÷π−ε0×σ+α+γ+R∞×Mτ-Φ0\
to be 2.26885."
HOMEPAGE="http://w-calc.sourceforge.net/"
COPYRIGHT="2002-2015 Kyle Wheeler"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://downloads.sourceforge.net/w-calc/wcalc-$portVersion.tar.bz2"
CHECKSUM_SHA256="0e2c17c20f935328dcdc6cb4c06250a6732f9ee78adf7a55c01133960d6d28ee"

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

PROVIDES="
	wcalc$secondaryArchSuffix = $portVersion
	cmd:wcalc = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libgmp$secondaryArchSuffix
	lib:libmpfr$secondaryArchSuffix
	"

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

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

INSTALL()
{
	make install
}

TEST()
{
	make check
}
