# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=3 inherit eutils games DESCRIPTION="Cave Story, a platform-adventure game by Studio Pixel" HOMEPAGE="http://www.cavestory.org http://www.humblebundle.com" SRC_URI="CaveStoryPlus_LinuxBuilds.zip" RESTRICT="fetch strip" LICENSE="as-is" SLOT="0" KEYWORDS="-* ~amd64 ~x86" IUSE="" DEPEND="" RDEPEND="${DEPEND} =media-libs/libsdl-1.2* virtual/glu" pkg_nofetch() { echo elog "Download and place ${SRC_URI} in ${DISTDIR}" echo } src_prepare() { if [[ "${ARCH}" == "amd64" ]]; then S="${WORKDIR}/CaveStory+_LinuxBuilds/CaveStoryx64" else S="${WORKDIR}/CaveStory+_LinuxBuilds/CaveStoryx86" fi find "${S}" -name '.DS_Store' -delete } src_install() { local exename="doukutsu" local instdir="${GAMES_PREFIX_OPT}/${PN}" cat <<- EOF > launcher #!/bin/sh CONFDIR=\${HOME}/.${PN} if [ ! -d "\${CONFDIR}" ]; then mkdir -p "\${CONFDIR}" ln -s "${instdir}/lib" "\${CONFDIR}/lib" ln -s "${instdir}/data" "\${CONFDIR}/data" fi cd "\${CONFDIR}" exec "${instdir}/${exename}" EOF newgamesbin launcher "${exename}" || die insinto "${instdir}" #rm -f lib/libsdl.so.1.2 lib/libGLU.so.1 doins -r data lib || die exeinto "${instdir}" || die doexe "${exename}" || die make_desktop_entry "${exename}" "Cave Story+" "" "Game" || die prepgamesdirs }