SUMMARY="SWI Prolog. Stable and free standard Prolog implementation"
DESCRIPTION="
SWI-Prolog is an open source implementation of the programming language Prolog, \
commonly used for teaching and semantic web applications. It has a rich set of \
features, libraries for constraint logic programming, multithreading, unit \
testing, GUI, interfacing to Java, ODBC and others, literate programming, a web \
server, SGML, RDF, RDFS, developer tools (including an IDE with a GUI debugger \
and GUI profiler), and extensive documentation."
HOMEPAGE="https://www.swi-prolog.org/"
COPYRIGHT="1985-2012, University of Amsterdam, VU University Amsterdam"
LICENSE="GNU LGPL v2.1
	SWI-Prolog"
REVISION="3"
SOURCE_URI="https://www.swi-prolog.org/download/stable/src/pl-6.6.6.tar.gz"
CHECKSUM_SHA256="9f80bb274e2f31fd68b0acbe35982c012d5f8311dbe44ec1d8d04351a776996d"
SOURCE_DIR="pl-6.6.6"
PATCHES="swi_prolog-6.2.0.patch"

ARCHITECTURES="!x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	swi_prolog$secondaryArchSuffix = $portVersion
	cmd:swipl$secondaryArchSuffix
	cmd:swipl_ld$secondaryArchSuffix
	cmd:swipl_rc$secondaryArchSuffix
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libgmp$secondaryArchSuffix >= 10
	lib:libncurses$secondaryArchSuffix
	lib:libreadline$secondaryArchSuffix >= 6
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libgmp$secondaryArchSuffix >= 10
	devel:libncurses$secondaryArchSuffix
	devel:libreadline$secondaryArchSuffix >= 6
	"
BUILD_PREREQUIRES="
	cmd:autoreconf
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	"

BUILD()
{
	cd src
	libtoolize -fci
	autoreconf
	LDFLAGS="-L/system/lib -L/system/develop/lib" CFLAGS="-I/system/develop/include -I/system/include" ./configure $configureDirArgs
	#runConfigure ./configure
	make
}

INSTALL()
{
	cd src
	make install
}

TEST()
{
	cd src
	make check
}
