SUMMARY="A NeXT emulator"
DESCRIPTION="
Previous is a Next computer hardware emulator. \
It aims to emulate a Next Cube or a Next Station with all its peripheral.
"
HOMEPAGE="http://previous.alternative-system.com/"
SOURCE_URI="svn://svn.code.sf.net/p/previous/code/trunk#844"
REVISION="2"
#CHECKSUM_MD5=""
COPYRIGHT="2001-2017 Andreas Grabher"
LICENSE="GNU GPL v2"
PATCHES="previous-$portVersion.patchset"

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

PROVIDES="
	previous = $portVersion
	app:Previous = $portVersion
	cmd:previous = $portVersion
	"
REQUIRES="
	haiku${secondaryArchSuffix}
	lib:libpng16$secondaryArchSuffix
	lib:libreadline$secondaryArchSuffix
	lib:libsdl2_2.0$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libpng16$secondaryArchSuffix
	devel:libreadline$secondaryArchSuffix
	devel:libsdl2_2.0$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:cmake
	cmd:make
	cmd:python
	cmd:gcc${secondaryArchSuffix}
	cmd:sdl2_config${secondaryArchSuffix}
	"

BUILD()
{
	mkdir -p build
	cd build
	cmake -DCMAKE_INSTALL_PREFIX=$prefix -DBINDIR=$binDir -DDATADIR=$dataDir/previous -DMANDIR=$manDir/man1 -DDOCDIR=$docDir/previous ..
	make
}

INSTALL()
{
	cd build
	make install
	mv $binDir/Previous $prefix/bin/
	mimeset $prefix/bin/Previous
	addAppDeskbarSymlink /bin/Previous Previous
}
