SUMMARY="Clean, elegant, and pragmatic dialect of Forth"
DESCRIPTION="Retro is a clean, elegant, and pragmatic dialect of Forth. \
It provides a simple alternative for those willing to make a break from legacy \
systems.

The language draws influences from many sources including traditional \
Forth systems, cmForth, colorForth, Factor, and Parable. It was \
designed to be easy to grasp and adapt to specific uses."
HOMEPAGE="https://forthworks.com/retro/"
COPYRIGHT="2008-2021, Charles Childers"
LICENSE="ISC"
REVISION="1"
SOURCE_URI="https://forthworks.com/retro/r/RETRO12-$portVersion.tar.gz"
CHECKSUM_SHA256="9d43aae72527e7b18fdbd3b4237d425b79ad95bb3d0dee6655264970478524b0"
SOURCE_DIR="RETRO12-$portVersion"

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

PROVIDES="
	retro$secondaryArchSuffix = $portVersion
	cmd:retro = $portVersion
	cmd:retro_describe = $portVersion
	cmd:retro_document = $portVersion
	cmd:retro_embedimage = $portVersion
	cmd:retro_extend = $portVersion
	cmd:retro_muri = $portVersion
	cmd:retro_unu = $portVersion
	cmd:retro_tags = $portVersion
	cmd:retro_locate = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

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

BUILD()
{
	local optionArg
	if [ $targetArchitecture = x86_64 ]; then
		optionArg="OPTIONS=-DBIT64"
	fi
	make $jobArgs $optionArg LDFLAGS=-lnetwork
}

INSTALL()
{
	make install PREFIX=$prefix DATADIR=$dataDir/retro DOCSDIR=$docDir \
		MANDIR=$manDir/man1 EXAMPLESDIR=$docDir
}

TEST()
{
	make test
}
