From d90369d49b089b6aa5c3b5fdfba08b8d225e76c3 Mon Sep 17 00:00:00 2001 From: Marcel Unbehaun Date: Mon, 11 Oct 2010 08:00:03 +0200 Subject: [games-rpg/zeldaroth] initial zeldaroth-6.11.ebuild [games-rpg/zeldaroth] new Manifest [games-rpg/zeldaroth] new files/zeldaroth-homedir.patch [games-rpg/zeldaroth] new metadata.xml --- games-rpg/zeldaroth/Manifest | 4 + games-rpg/zeldaroth/files/zeldaroth-homedir.patch | 141 ++++++++++++++++++++++ games-rpg/zeldaroth/metadata.xml | 9 ++ games-rpg/zeldaroth/zeldaroth-6.11.ebuild | 50 ++++++++ 4 files changed, 204 insertions(+) create mode 100644 games-rpg/zeldaroth/Manifest create mode 100644 games-rpg/zeldaroth/files/zeldaroth-homedir.patch create mode 100644 games-rpg/zeldaroth/metadata.xml create mode 100644 games-rpg/zeldaroth/zeldaroth-6.11.ebuild (limited to 'games-rpg') diff --git a/games-rpg/zeldaroth/Manifest b/games-rpg/zeldaroth/Manifest new file mode 100644 index 0000000..1055eba --- /dev/null +++ b/games-rpg/zeldaroth/Manifest @@ -0,0 +1,4 @@ +AUX zeldaroth-homedir.patch 4633 RMD160 d5c53355f546f7930fb07f5d71cbb618bd28b323 SHA1 5e5d42f58f5af46337f4f306b2e66cf0ad1ed98f SHA256 5d397704bb3e7646236f62fd9c0d853c0ce87fb8f4d20d3724649560a2594078 +DIST ZeldaROTH_US-src-linux.zip 1552688 RMD160 6c232ae7dc86650cab27170849ece7004d56621d SHA1 b6a04bbde59b1b1447d5db6a92315253b7b1bac1 SHA256 9919a7fb0d2781f6323bfa27a7929fea68f4b0f26786ba9b6880b1f6a3e6f684 +EBUILD zeldaroth-6.11.ebuild 1217 RMD160 5ec0267af6f43d8190f2f1c7e70110288595fff4 SHA1 891e493d20e42ff0d52f355b0fe15edde4935bf9 SHA256 deb3ccb18cf76242d05d9ac73ebb8c4555569ab528296bdcdd567ccdb422330e +MISC metadata.xml 249 RMD160 220cde0fc1a8d7d355705f0f6772bd8d77cdc17a SHA1 34b33eb8d24cd8bfef2ddfb8e80334fd77cc9488 SHA256 3875fd5008d7f5bfe7f3cf7bf330c209a5034f5988d37c1699fb3be35a7be906 diff --git a/games-rpg/zeldaroth/files/zeldaroth-homedir.patch b/games-rpg/zeldaroth/files/zeldaroth-homedir.patch new file mode 100644 index 0000000..9fd8d67 --- /dev/null +++ b/games-rpg/zeldaroth/files/zeldaroth-homedir.patch @@ -0,0 +1,141 @@ +diff -Naur ZeldaROTH_US-src-linux/src/Joueur.cpp ZeldaROTH_US-src-linux/src/Joueur.cpp +--- ZeldaROTH_US-src-linux/src/Joueur.cpp 2009-02-18 23:59:34.000000000 +0100 ++++ ZeldaROTH_US-src-linux/src/Joueur.cpp 2010-10-10 11:48:46.000000000 +0200 +@@ -17,6 +17,7 @@ + #include "Texte.h" + #include "Projectile.h" + #include "Jeu.h" ++#include // for mkdir + + Joueur::Joueur(Jeu* jeu, int nmsv) : Personnage(), numSave(nmsv), temps(0), xdep2(0), + ydep2(0), dirdep2(S), magie(0), +@@ -114,9 +115,23 @@ + if (!gpJeu->isDonjon()) {zone = 21; xd = 86; yd = 24; dird = S;} + int tps = temps + ((SDL_GetTicks()-TimeB)/1000); + if (tps > 359999) tps = 359999; ++ // write the saves into users home ++ char savepath[500]; ++ strcpy(savepath, getenv("HOME")); ++ strcat(savepath,"/.zeldaroth/"); ++ ++ FILE *pathcheck = fopen(savepath,"r"); ++ if(!pathcheck) ++ { ++ mkdir(savepath, 0755); ++ } ++ ++ strcat(savepath, "roth"); ++ // end of user home ++ + ostringstream im; + im << numSave; +- ofstream f(("data/save/roth" + im.str() + ".dat").c_str(),ios::out | ios::binary); ++ ofstream f((savepath + im.str() + ".dat").c_str(),ios::out | ios::binary); + f.write((char *)&tps,sizeof(int)); + f.write((char *)&zone,sizeof(int)); + f.write((char *)&xd,sizeof(int)); +@@ -157,9 +172,22 @@ + + void Joueur::load() { + int zone; ++ // write the saves into users home ++ char savepath[500]; ++ strcpy(savepath, getenv("HOME")); ++ strcat(savepath,"/.zeldaroth/"); ++ ++ FILE *pathcheck = fopen(savepath,"r"); ++ if(!pathcheck) ++ { ++ mkdir(savepath, 0755); ++ } ++ ++ strcat(savepath, "roth"); ++ // end of user home + ostringstream im; + im << numSave; +- ifstream f(("data/save/roth" + im.str() + ".dat").c_str(),ios::in | ios::binary); ++ ifstream f((savepath + im.str() + ".dat").c_str(),ios::in | ios::binary); + if(!f.is_open()) return; + f.read((char *)&temps,sizeof(int)); + f.read((char *)&zone,sizeof(int)); gpJeu->setZone(zone); +diff -Naur ZeldaROTH_US-src-linux/src/Keyboard.cpp ZeldaROTH_US-src-linux/src/Keyboard.cpp +--- ZeldaROTH_US-src-linux/src/Keyboard.cpp 2009-02-18 23:56:22.000000000 +0100 ++++ ZeldaROTH_US-src-linux/src/Keyboard.cpp 2010-10-10 11:49:55.000000000 +0200 +@@ -19,6 +19,7 @@ + #include "Projectile.h" + #include "Jeu.h"*/ + #include "Keyboard.h" ++#include // for mkdir + + Keyboard::Keyboard(Jeu* jeu, Carte* carte, Encyclopedie* encycl, SDL_Surface* screen, int m) : + gpJeu(jeu), gpCarte(carte), gpEncyclopedie(encycl), mode(m), gFullScreen(1), +@@ -33,7 +34,21 @@ + } + + void Keyboard::saveP() { +- ofstream f("data/save/system.dat",ios::out | ios::binary); ++ // write the saves into users home ++ char savepath[500]; ++ strcpy(savepath, getenv("HOME")); ++ strcat(savepath,"/.zeldaroth/"); ++ ++ FILE *pathcheck = fopen(savepath,"r"); ++ if(!pathcheck) ++ { ++ mkdir(savepath, 0755); ++ } ++ ++ strcat(savepath, "system.dat"); ++// end of user home ++ ++ ofstream f(savepath,ios::out | ios::binary); + f.write((char *)&volume,sizeof(int)); + f.write((char *)&volson,sizeof(int)); + f.write((char *)&temps,sizeof(int)); +@@ -42,7 +57,21 @@ + } + + void Keyboard::loadP() { +- ifstream f("data/save/system.dat",ios::in | ios::binary); ++ // write the saves into users home ++ char savepath[500]; ++ strcpy(savepath, getenv("HOME")); ++ strcat(savepath,"/.zeldaroth/"); ++ ++ FILE *pathcheck = fopen(savepath,"r"); ++ if(!pathcheck) ++ { ++ mkdir(savepath, 0755); ++ } ++ ++ strcat(savepath, "system.dat"); ++ // end of user home ++ ++ ifstream f(savepath,ios::in | ios::binary); + if(!f.is_open()) return; + f.read((char *)&volume,sizeof(int)); + f.read((char *)&volson,sizeof(int)); +@@ -564,8 +593,22 @@ + case 9 : + if (keys[SDLK_RETURN] && tmp == 0) { + if (ligneVal==0) { ++ // write the saves into users home ++ char savepath[500]; ++ strcpy(savepath, getenv("HOME")); ++ strcat(savepath,"/.zeldaroth/"); ++ ++ FILE *pathcheck = fopen(savepath,"r"); ++ if(!pathcheck) ++ { ++ mkdir(savepath, 0755); ++ } ++ ++ strcat(savepath, "roth"); ++ // end of user home ++ + ostringstream oss; oss << (ligne+1); +- remove(("data/save/roth" + oss.str() + ".dat").c_str()); ++ remove((savepath + oss.str() + ".dat").c_str()); + mode = 4; gpJeu->getGenerique()->initSelection(); + gpJeu->getAudio()->playSound(2); + } diff --git a/games-rpg/zeldaroth/metadata.xml b/games-rpg/zeldaroth/metadata.xml new file mode 100644 index 0000000..4e4714e --- /dev/null +++ b/games-rpg/zeldaroth/metadata.xml @@ -0,0 +1,9 @@ + + + + + frostworks@gmx.de + Marcel Unbehaun + +games + diff --git a/games-rpg/zeldaroth/zeldaroth-6.11.ebuild b/games-rpg/zeldaroth/zeldaroth-6.11.ebuild new file mode 100644 index 0000000..0029610 --- /dev/null +++ b/games-rpg/zeldaroth/zeldaroth-6.11.ebuild @@ -0,0 +1,50 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/games-rpg/zeldaroth/zeldaroth-6.11.ebuild,v 1.0 2010/10/10 09:17:32 frostwork Exp $ + +EAPI="2" + +MY_PN="ZeldaROTH_US-src-linux" + +inherit games + +DESCRIPTION="The Legend of Zelda - Return of the Hylian" +HOMEPAGE="http://www.zeldaroth.fr/us/zroth.php" +SRC_URI="http://www.zeldaroth.fr/us/files/ROTH/Linux/${MY_PN}.zip" + +LICENSE="" +SLOT="0" +KEYWORDS="~x86" +IUSE="" + +RDEPEND=" + media-libs/libsdl + media-libs/sdl-gfx + media-libs/sdl-image + media-libs/sdl-mixer[midi] +" + +src_prepare() { + epatch "${FILESDIR}/${PN}-homedir.patch" + sed -i -e "s:ZeldaROTH_US:"${PN}":g" -i ${MY_PN}/src/Makefile + sed -i -e "s:CFLAGS =:#CFLAGS =:g" -i ${MY_PN}/src/Makefile + for i in `find ${MY_PN}/src -name *.cpp`; do sed -i "$i" -e "s:data/:"${GAMES_DATADIR}"/"${PN}/data/":g"; done +} + +src_compile() { + cd ${MY_PN}/src + emake || die "emake failed" +} + + +src_install() { + dogamesbin ${MY_PN}/src/${PN} + insinto "${GAMES_DATADIR}"/${PN} + doins -r ${MY_PN}/src/data || die "data install failed" + newicon ${MY_PN}/src/data/images/logos/triforce.ico ${PN}.png + make_desktop_entry ${PN} + + prepgamesdirs +} + + -- cgit v1.2.3-18-g5258