SUMMARY="A light-weight scripting language"
DESCRIPTION="
Squirrel is a light weight programming language featuring higher-order \
functions, classes/inheritance, delegation, tail recursion, generators, \
cooperative threads, exception handling, reference counting and garbage \
collection on demand.  C-like syntax."
HOMEPAGE="http://www.squirrel-lang.org"
COPYRIGHT="2003-2016 Alberto Demichelis"
LICENSE="MIT"
REVISION="2"
SOURCE_URI="https://github.com/albertodemichelis/squirrel/archive/v3.1.tar.gz"
CHECKSUM_SHA256="51942b8638a97b673e34ecf3ca50304996fa99bbdbfa7fe93d9744e6769b2f95"
SOURCE_DIR="squirrel-3.1"

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

PROVIDES="
	squirrel$secondaryArchSuffix = $portVersion
	cmd:sq$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

PROVIDES_devel="
	squirrel${secondaryArchSuffix}_devel = $portVersion
	devel:libsqstdlib$secondaryArchSuffix = $portVersion
	devel:libsquirrel$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	squirrel$secondaryArchSuffix == $portVersion base
	"

BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	cmd:gcc$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	if [ $effectiveTargetArchitecture = x86 ]; then
	make $jobArgs
	else
	make sq64 $jobArgs
	fi
}

INSTALL()
{
	mkdir -p $binDir
	cp -r bin/* $binDir

	mkdir -p $includeDir
	cp -r include/* $includeDir

	mkdir -p $developDocDir
	cp -r doc/* $developDocDir

	mkdir -p $libDir
	cp -r lib/* $develLibDir

	rm -rf $libDir

	packageEntries devel \
				$developDir
}
