SUMMARY="A Z-Machine interpreter/development library"
DESCRIPTION="Fizmo allows you to play interactive fiction, also known as \
textadventures, which were implemented either by Infocom or created using \
the Inform compiler in a terminal.
You can also develop your own interactive fiction front end in C or any \
C-related language like C++ or Objective-C.

You'll find a huge number of adventures at http://ifarchive.org and \
http://ifdb.tads.org/"
HOMEPAGE="https://christoph-ender.de/fizmo/"
COPYRIGHT="2009–2017 Christoph Ender"
LICENSE="Fizmo"
REVISION="1"
SOURCE_URI="https://christoph-ender.de/fizmo/source/fizmo-$portVersion.tar.gz"
CHECKSUM_SHA256="1c259a29b21c9f401c12fc24d555aca4f4ff171873be56fb44c0c9402c61beaa"

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

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

PROVIDES="
	fizmo$secondaryArchSuffix = $portVersion
	cmd:fizmo_console$commandSuffix = $portVersion
	cmd:fizmo_ncursesw$commandSuffix = $portVersion
	cmd:fizmo_sdl2$commandSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libfreetype$secondaryArchSuffix
	lib:libjpeg$secondaryArchSuffix
	lib:libncurses$secondaryArchSuffix
	lib:libpng16$secondaryArchSuffix
	lib:libSDL2_2.0$secondaryArchSuffix
	lib:libsndfile$secondaryArchSuffix
	lib:libxml2$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libfreetype$secondaryArchSuffix
	devel:libjpeg$secondaryArchSuffix
	devel:libncurses$secondaryArchSuffix
	devel:libpng16$secondaryArchSuffix
	devel:libSDL2_2.0$secondaryArchSuffix
	devel:libsndfile$secondaryArchSuffix
	devel:libxml2$secondaryArchSuffix
	devel:libX11$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoreconf
	cmd:awk
	cmd:find
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	cmd:xargs
	"

BUILD()
{
	autoreconf -vfi
	runConfigure --omit-dirs binDir ./configure \
		--bindir=$commandBinDir \
		--disable-x11

	make $jobArgs
}

INSTALL()
{
	make install
}
