SUMMARY="A free, single-player dungeon exploration game"
HOMEPAGE="http://rephial.org/"
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.
"
REVISION="2"
ARCHITECTURES="x86_gcc2"
LICENSE="GNU GPL v2"
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"
SOURCE_URI="http://rephial.org/downloads/3.5/angband-v3.5.0.tar.gz"
CHECKSUM_SHA256="3d3c3a8839ef97613d5e29c116c5e88c93b913485768106ad4906c75069085ec"
SOURCE_DIR="angband-v3.5.0"

PROVIDES="
	angband = $portVersion
	cmd:angband
"

REQUIRES="
	haiku
	lib:libSDL_1.2
	lib:libSDL_image_1.2
	lib:libSDL_mixer_1.2
	lib:libSDL_ttf_2.0
	lib:libncursesw
"

GLOBAL_WRITABLE_FILES="
settings/angband/edit/artifact.txt keep-old
settings/angband/edit/ego_item.txt keep-old
settings/angband/edit/flavor.txt keep-old
settings/angband/edit/hints.txt keep-old
settings/angband/edit/limits.txt keep-old
settings/angband/edit/monster.txt keep-old
settings/angband/edit/monster_base.txt keep-old
settings/angband/edit/names.txt keep-old
settings/angband/edit/object.txt keep-old
settings/angband/edit/object_base.txt keep-old
settings/angband/edit/p_class.txt keep-old
settings/angband/edit/p_hist.txt keep-old
settings/angband/edit/p_race.txt keep-old
settings/angband/edit/pain.txt keep-old
settings/angband/edit/pit.txt keep-old
settings/angband/edit/room_template.txt keep-old
settings/angband/edit/spell.txt keep-old
settings/angband/edit/store.txt keep-old
settings/angband/edit/terrain.txt keep-old
settings/angband/edit/vault.txt keep-old
settings/angband/pref/flvr-dvg.prf keep-old
settings/angband/pref/flvr-new.prf keep-old
settings/angband/pref/flvr-nmd.prf keep-old
settings/angband/pref/flvr-shb.prf keep-old
settings/angband/pref/flvr-xxx.prf keep-old
settings/angband/pref/font-gcu.prf keep-old
settings/angband/pref/font-sdl.prf keep-old
settings/angband/pref/font-win.prf keep-old
settings/angband/pref/font-x11.prf keep-old
settings/angband/pref/font-xxx.prf keep-old
settings/angband/pref/font.prf keep-old
settings/angband/pref/graf-dvg.prf keep-old
settings/angband/pref/graf-new.prf keep-old
settings/angband/pref/graf-nmd.prf keep-old
settings/angband/pref/graf-shb.prf keep-old
settings/angband/pref/graf-xxx.prf keep-old
settings/angband/pref/graf.prf keep-old
settings/angband/pref/keys-gcu.prf keep-old
settings/angband/pref/message.prf keep-old
settings/angband/pref/pref.prf keep-old
settings/angband/pref/user.prf keep-old
settings/angband/pref/xtra-dvg.prf keep-old
settings/angband/pref/xtra-new.prf keep-old
settings/angband/pref/xtra-nmd.prf keep-old
settings/angband/pref/xtra-shb.prf keep-old
settings/angband/pref/xtra-xxx.prf keep-old
"

BUILD_REQUIRES="
	devel:libncurses
	devel:libsdl
	devel:libsdl_image
	devel:libsdl_mixer
	devel:libsdl_ttf
"

BUILD_PREREQUIRES="
	haiku_devel
	cmd:autoconf
	cmd:awk
	cmd:find
	cmd:gcc
	cmd:make
"

PATCHES="angband-${portVersion}.patchset"
BUILD()
{
	autoconf
	runConfigure ./configure --enable-sdl --enable-sdl-mixer
	make $jobArgs
}

INSTALL()
{
	make install
}
