From ce8225979fe2035a41eb03041ad3e268680930b8 Mon Sep 17 00:00:00 2001 From: Marcel Unbehaun Date: Mon, 11 Oct 2010 07:58:53 +0200 Subject: [games-rpg/zeldaolb] initial zeldaolb-3.6.ebuild [games-rpg/zeldaolb] new Manifest [games-rpg/zeldaolb] new files/zeldaolb-homedir.patch [games-rpg/zeldaolb] new metadata.xml --- games-rpg/zeldaolb/Manifest | 4 + games-rpg/zeldaolb/files/zeldaolb-homedir.patch | 151 ++++++++++++++++++++++++ games-rpg/zeldaolb/metadata.xml | 9 ++ games-rpg/zeldaolb/zeldaolb-3.6.ebuild | 50 ++++++++ 4 files changed, 214 insertions(+) create mode 100644 games-rpg/zeldaolb/Manifest create mode 100644 games-rpg/zeldaolb/files/zeldaolb-homedir.patch create mode 100644 games-rpg/zeldaolb/metadata.xml create mode 100644 games-rpg/zeldaolb/zeldaolb-3.6.ebuild (limited to 'games-rpg/zeldaolb') diff --git a/games-rpg/zeldaolb/Manifest b/games-rpg/zeldaolb/Manifest new file mode 100644 index 0000000..edccfc2 --- /dev/null +++ b/games-rpg/zeldaolb/Manifest @@ -0,0 +1,4 @@ +AUX zeldaolb-homedir.patch 4609 RMD160 175c9737a1b5a4bb44a946908c905b86ce2e1238 SHA1 9110fed4cb3a0bcfcb61a6ec33fa2ff1250a1d31 SHA256 8a066449468b63d9e18c018d387254eb4caf9f5f1dbc859aa90f96a4902f0b89 +DIST ZeldaOLB_US-src-linux.zip 2599576 RMD160 9d0b705849dc168967dbc8aaf754d87bb1670d4b SHA1 4e687663b306ed3bc00fe314ce426ccfea1baadd SHA256 57b48f3e9e7432283e71a54f02106f93b859b0012c41b78b5be8e88086ae4bd6 +EBUILD zeldaolb-3.6.ebuild 1198 RMD160 babadb167754904f746d63450fdeb66c2a1c527b SHA1 4b257f032e6ab057bfdacc742cdb4a0bc6a37e24 SHA256 16b2b14682e841a314520d21a36417b39fedd667ae50c8e2250db706e829b5a1 +MISC metadata.xml 249 RMD160 220cde0fc1a8d7d355705f0f6772bd8d77cdc17a SHA1 34b33eb8d24cd8bfef2ddfb8e80334fd77cc9488 SHA256 3875fd5008d7f5bfe7f3cf7bf330c209a5034f5988d37c1699fb3be35a7be906 diff --git a/games-rpg/zeldaolb/files/zeldaolb-homedir.patch b/games-rpg/zeldaolb/files/zeldaolb-homedir.patch new file mode 100644 index 0000000..87dbf73 --- /dev/null +++ b/games-rpg/zeldaolb/files/zeldaolb-homedir.patch @@ -0,0 +1,151 @@ +diff -Naur ZeldaOLB_US-src-linux/src/Joueur.cpp ZeldaOLB_US-src-linux/src/Joueur.cpp +--- ZeldaOLB_US-src-linux/src/Joueur.cpp 2009-03-15 13:49:57.000000000 +0100 ++++ ZeldaOLB_US-src-linux/src/Joueur.cpp 2010-10-10 11:52:17.000000000 +0200 +@@ -18,6 +18,9 @@ + #include "Projectile.h" + #include "Jeu.h" + #include "Keyboard.h" ++#include ++ ++ + + Joueur::Joueur(Jeu* jeu, int nmsv) : Personnage(), numSave(nmsv), temps(0), xdep2(0), + ydep2(0), dirdep2(S), magie(0), +@@ -133,9 +136,24 @@ + //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,"/.zeldaolb/"); ++ ++ FILE *pathcheck = fopen(savepath,"r"); ++ if(!pathcheck) ++ { ++ mkdir(savepath, 0755); ++ } ++ ++ strcat(savepath, "olb"); ++// end of user home ++ + ostringstream im; + im << numSave; +- ofstream f(("data/save/olb" + 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)); +@@ -188,9 +206,24 @@ + + void Joueur::load() { + int zone; ++ ++// read saves from users home ++ char savepath[500]; ++ strcpy(savepath, getenv("HOME")); ++ strcat(savepath,"/.zeldaolb/"); ++ ++ FILE *pathcheck = fopen(savepath,"r"); ++ if(!pathcheck) ++ { ++ mkdir(savepath, 0755); ++ } ++ ++ strcat(savepath, "olb"); ++// end of user home ++ + ostringstream im; + im << numSave; +- ifstream f(("data/save/olb" + 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 ZeldaOLB_US-src-linux/src/Keyboard.cpp ZeldaOLB_US-src-linux/src/Keyboard.cpp +--- ZeldaOLB_US-src-linux/src/Keyboard.cpp 2009-03-15 13:46:19.000000000 +0100 ++++ ZeldaOLB_US-src-linux/src/Keyboard.cpp 2010-10-10 12:14:24.000000000 +0200 +@@ -13,6 +13,7 @@ + #include + + #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), +@@ -28,7 +29,23 @@ + } + + 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,"/.zeldaolb/"); ++ ++ 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)); +@@ -37,7 +54,23 @@ + } + + 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,"/.zeldaolb/"); ++ ++ 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)); +@@ -622,8 +655,23 @@ + 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,"/.zeldaolb/"); ++ ++ FILE *pathcheck = fopen(savepath,"r"); ++ if(!pathcheck) ++ { ++ mkdir(savepath, 0755); ++ } ++ ++ strcat(savepath, "olb"); ++ ++ // end of user home ++ + ostringstream oss; oss << (ligne+1); +- remove(("data/save/olb" + 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/zeldaolb/metadata.xml b/games-rpg/zeldaolb/metadata.xml new file mode 100644 index 0000000..4e4714e --- /dev/null +++ b/games-rpg/zeldaolb/metadata.xml @@ -0,0 +1,9 @@ + + + + + frostworks@gmx.de + Marcel Unbehaun + +games + diff --git a/games-rpg/zeldaolb/zeldaolb-3.6.ebuild b/games-rpg/zeldaolb/zeldaolb-3.6.ebuild new file mode 100644 index 0000000..c2dc9ce --- /dev/null +++ b/games-rpg/zeldaolb/zeldaolb-3.6.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/zeldaolb/zeldaolb-3.6.ebuild,v 1.0 2010/10/10 09:17:32 frostwork Exp $ + +EAPI="2" + +MY_PN="ZeldaOLB_US-src-linux" + +inherit games + +DESCRIPTION="The Legend of Zelda - Onilink Begins" +HOMEPAGE="http://www.zeldaroth.fr/us/zolb.php" +SRC_URI="http://www.zeldaroth.fr/us/files/OLB/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:ZeldaOLB:"${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/graal.ico ${PN}.png + make_desktop_entry ${PN} + + prepgamesdirs +} + + -- cgit v1.2.3-65-gdbad