# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games MY_PN=${PN%-demo} DESCRIPTION="Heroes of Might and Magic III - turn-based 2D medieval combat" HOMEPAGE="http://www.lokigames.com/products/heroes3/" SRC_URI="mirror://lokigames/loki_demos/${PN}.run" LICENSE="as-is" SLOT="0" # Should also work on amd64 & ppc KEYWORDS="~x86" IUSE="" RESTRICT="strip" DEPEND="games-util/loki_patch" RDEPEND="x86? ( || ( x11-libs/libX11 virtual/x11 ) ) amd64? ( app-emulation/emul-linux-x86-xlibs app-emulation/emul-linux-x86-compat >=sys-libs/lib-compat-loki-0.2 )" S=${WORKDIR} src_unpack() { unpack_makeself } src_install() { # Apply patch loki_patch patch.dat data/ || die "loki patch failed" local dir="${GAMES_PREFIX_OPT}/${PN}" local demo="data/demos/${MY_PN}_demo" local exe_stub="${MY_PN}_demo" if use ppc ; then exe="${exe_stub}.ppc" else exe="${exe_stub}.x86" fi insinto "${dir}" exeinto "${dir}" doins -r "${demo}"/* || die "doins ${demo} failed" rm "${D}/${dir}"/{${exe_stub}*,*.sh} || die "rm executables failed" doexe "${demo}/${exe}" || die "doexe ${exe} failed" games_make_wrapper ${PN} "./${exe}" "${dir}" newicon "${demo}/icon.xpm" ${PN}.png || die "newicon icon.xpm failed" make_desktop_entry ${PN} "Heroes of Might and Magic III (Demo)" ${PN}.png prepgamesdirs }