+EAPI=3
+
+inherit eutils games
+
+MY_P="cavestoryplus-linux-1324519044"
+
+DESCRIPTION="An updated version of Cave Story by Studio Pixel"
+HOMEPAGE="http://www.nicalis.com/games.php?game=cavestory"
+SRC_URI="${MY_P}.tar.gz"
+RESTRICT="fetch"
+
+QA_PRESTRIPPED="${GAMES_PREFIX_OPT}/${PN}/CaveStory+"'\(_64\)\?'
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE=""
+
+DEPEND="media-gfx/imagemagick[png]"
+RDEPEND="media-libs/libsdl[opengl]"
+
+S="${WORKDIR}/CaveStory+"
+
+pkg_nofetch() {
+ ewarn
+ ewarn "Download ${A} to ${DISTDIR}."
+ ewarn
+}
+
+src_compile() {
+ convert "data/icon.bmp" "${PN}.png" || die "failed to convert icon."
+}
+
+src_install() {
+ local dir="${GAMES_PREFIX_OPT}/${PN}"
+ local exe="CaveStory+$(usex amd64 '_64' '')"
+
+ exeinto "${dir}"
+ doexe "CaveStory+$(usex amd64 '_64' '')"
+
+ insinto "${dir}"
+ doins -r data
+
+ doicon "${PN}.png"
+ make_desktop_entry "${PN}" "Cave Story+"
+ games_make_wrapper "${PN}" "${dir}/${exe}" "${dir}"
+
+ prepgamesdirs
+}