SUMMARY="2D real time strategy simulation with an emphasis on economy and city building"
DESCRIPTION="Unknown Horizons is a 2D realtime strategy simulation with an \
emphasis on economy and city building. Expand your small settlement to a \
strong and wealthy colony, collect taxes and supply your inhabitants with \
valuable goods. Increase your power with a well balanced economy and with \
strategic trade and diplomacy."
HOMEPAGE="http://www.unknown-horizons.org/"
COPYRIGHT="2008-2015 The Unknown Horizons Team"
LICENSE="GNU GPL v2"
REVISION="2"
SOURCE_URI="https://github.com/unknown-horizons/unknown-horizons/archive/2014.1.tar.gz"
CHECKSUM_SHA256="9dbecd07198232487ccc3f90a5117b416d7d4162115560577078a1e39adfe2eb"
SOURCE_DIR="unknown-horizons-$portVersion"
PATCHES="unknown-horizons-$portVersion.patchset"

ARCHITECTURES="any"

PROVIDES="
	unknown_horizons = $portVersion
	"
REQUIRES="
	fife
	pyenet
	pyyaml
	cmd:python
	"

BUILD_REQUIRES="
	cmd:intltool_merge
	cmd:msgfmt
	cmd:python
	"

BUILD()
{
	python -B setup.py build_i18n
}

INSTALL()
{
	# This basically mirrors the "run from source" situation. It doesn't
	# actually use setup.py to install the python parts into global directories
	# as that doesn't really seem necessary (as it is an end user application
	# and not a library used by other python programs).

	local APP_DIR="$appsDir/Unknown Horizons"
	mkdir -p "$APP_DIR"

	# Gather implementation and content files.
	cp -r horizons content run_uh.py "$APP_DIR"

	# Remove platform specific content.
	rm -r "$APP_DIR/horizons/network/libs" "$APP_DIR/content/packages"

	addattr -t icon -f "content/gui/images/logos/uh_icon.hvif" "BEOS:ICON" \
		"$APP_DIR/run_uh.py"

	addAppDeskbarSymlink "$APP_DIR/run_uh.py" "Unknown Horizons"
}
