SUMMARY="A free, single-player dungeon exploration game"
DESCRIPTION="Angband is a free, single-player dungeon exploration game. \
You play an adventurer: seeking riches, fighting monsters, and preparing \
for a final battle with Morgoth, the Lord of Darkness."
HOMEPAGE="http://rephial.org/"
COPYRIGHT="1985 Robert Alan Koeneke
	1989 James E. Wilson
	1990 Alex Cutler and Andy Astrand
	1991-1992 Sean Marsh, Geoff Hill, Charles Teague
	1993 Charles Swiger
	1994-1999 Ben Harrison
	2000-2014 Robert Ruehlmann"
LICENSE="GNU GPL v2"
REVISION="1"
SOURCE_URI="https://github.com/angband/angband/archive/$portVersion.tar.gz"
SOURCE_FILENAME="angband-$portVersion.tar.gz"
CHECKSUM_SHA256="8cf30b0f5c4d096e18a2896b81e5a8fa82215ebdcd3037502673fb70a6c30779"
PATCHES="angband-$portVersion.patchset"

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

GLOBAL_WRITABLE_FILES="
	settings/angband/customize/font-gcu.prf keep-old
	settings/angband/customize/font-sdl.prf keep-old
	settings/angband/customize/font-sdl2.prf keep-old
	settings/angband/customize/font-win.prf keep-old
	settings/angband/customize/font-x11.prf keep-old
	settings/angband/customize/font.prf keep-old
	settings/angband/customize/keys-gcu.prf  keep-old
	settings/angband/customize/message.prf  keep-old
	settings/angband/customize/pref.prf keep-old
	settings/angband/customize/sound.prf keep-old
	settings/angband/customize/user.prf keep-old
	settings/angband/gamedata/activation.txt keep-old
	settings/angband/gamedata/artifact.txt keep-old
	settings/angband/gamedata/blow_effects.txt keep-old
	settings/angband/gamedata/blow_methods.txt keep-old
	settings/angband/gamedata/body.txt keep-old
	settings/angband/gamedata/brand.txt keep-old
	settings/angband/gamedata/chest_trap.txt keep-old
	settings/angband/gamedata/class.txt keep-old
	settings/angband/gamedata/constants.txt keep-old
	settings/angband/gamedata/curse.txt keep-old
	settings/angband/gamedata/dungeon_profile.txt keep-old
	settings/angband/gamedata/ego_item.txt keep-old
	settings/angband/gamedata/flavor.txt keep-old
	settings/angband/gamedata/hints.txt keep-old
	settings/angband/gamedata/history.txt keep-old
	settings/angband/gamedata/monster.txt keep-old
	settings/angband/gamedata/monster_base.txt keep-old
	settings/angband/gamedata/monster_spell.txt keep-old
	settings/angband/gamedata/names.txt keep-old
	settings/angband/gamedata/object.txt keep-old
	settings/angband/gamedata/object_base.txt keep-old
	settings/angband/gamedata/object_property.txt keep-old
	settings/angband/gamedata/p_race.txt keep-old
	settings/angband/gamedata/pain.txt keep-old
	settings/angband/gamedata/pit.txt keep-old
	settings/angband/gamedata/player_property.txt keep-old
	settings/angband/gamedata/player_timed.txt keep-old
	settings/angband/gamedata/projection.txt keep-old
	settings/angband/gamedata/quest.txt keep-old
	settings/angband/gamedata/realm.txt keep-old
	settings/angband/gamedata/room_template.txt keep-old
	settings/angband/gamedata/shape.txt keep-old
	settings/angband/gamedata/slay.txt keep-old
	settings/angband/gamedata/store.txt keep-old
	settings/angband/gamedata/summon.txt keep-old
	settings/angband/gamedata/terrain.txt keep-old
	settings/angband/gamedata/trap.txt keep-old
	settings/angband/gamedata/ui_entry.txt keep-old
	settings/angband/gamedata/ui_entry_base.txt keep-old
	settings/angband/gamedata/ui_entry_renderer.txt keep-old
	settings/angband/gamedata/vault.txt keep-old
	settings/angband/gamedata/visuals.txt keep-old
	settings/angband/gamedata/world.txt keep-old
	"

PROVIDES="
	angband$secondaryArchSuffix = $portVersion
	cmd:angband$secondaryArchSuffix
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libncursesw$secondaryArchSuffix
	lib:libSDL_1.2$secondaryArchSuffix
	lib:libSDL_image_1.2$secondaryArchSuffix
	lib:libSDL_mixer_1.2$secondaryArchSuffix
	lib:libSDL_ttf_2.0$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libncurses$secondaryArchSuffix
	devel:libSDL_1.2$secondaryArchSuffix
	devel:libSDL_image_1.2$secondaryArchSuffix
	devel:libSDL_mixer_1.2$secondaryArchSuffix
	devel:libSDL_ttf_2.0$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:awk
	cmd:find
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	./autogen.sh
	runConfigure ./configure --enable-sdl --enable-sdl-mixer
	make $jobArgs
}

INSTALL()
{
	make install
}
