public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/gamerlay:master commit in: games-arcade/hurrican/, games-arcade/hurrican/files/
@ 2012-06-09  8:40 Marcel Unbehaun
  0 siblings, 0 replies; only message in thread
From: Marcel Unbehaun @ 2012-06-09  8:40 UTC (permalink / raw
  To: gentoo-commits

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 6772 bytes --]

commit:     bb4b6b33e3f39ee4a0ce812265c9170328bf66dc
Author:     Marcel Unbehaun <marcel <AT> frostworx <DOT> de>
AuthorDate: Sat Jun  9 08:41:58 2012 +0000
Commit:     Marcel Unbehaun <frostworks <AT> gmx <DOT> de>
CommitDate: Sat Jun  9 08:41:58 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gamerlay.git;a=commit;h=bb4b6b33

[games-arcade/hurrican]	initial and ugly hurrican-9999.ebuild

---
 games-arcade/hurrican/files/hurrican-homedir.patch |  105 ++++++++++++++++++++
 games-arcade/hurrican/hurrican-9999.ebuild         |   56 +++++++++++
 games-arcade/hurrican/metadata.xml                 |    5 +
 3 files changed, 166 insertions(+), 0 deletions(-)

diff --git a/games-arcade/hurrican/files/hurrican-homedir.patch b/games-arcade/hurrican/files/hurrican-homedir.patch
new file mode 100644
index 0000000..3f3e27c
--- /dev/null
+++ b/games-arcade/hurrican/files/hurrican-homedir.patch
@@ -0,0 +1,105 @@
+diff -Naur src/Gameplay.cpp src/Gameplay.cpp
+--- src/Gameplay.cpp	2012-06-07 11:40:47.000000000 +0200
++++ src/Gameplay.cpp	2012-06-09 10:35:30.029915087 +0200
+@@ -33,6 +33,7 @@
+ #include "Projectiles.h"
+ #include "Tileengine.h"
+ #include "Timer.h"
++#include <sys/stat.h>
+ 
+ // --------------------------------------------------------------------------------------
+ // Gameplay Variablen
+@@ -71,6 +72,16 @@
+ 
+ int		DisplayHintNr = -1;
+ 
++// file in HOME
++
++std::string homefile(std::string file)
++{
++	std::string home=getenv("HOME");
++	std::string hurrihome=home+"/.config/hurrican/";
++	mkdir(hurrihome.c_str(), 0755);
++	return hurrihome+file;	
++}
++
+ // --------------------------------------------------------------------------------------
+ // Ein neues Spiel initialisieren
+ // --------------------------------------------------------------------------------------
+@@ -683,8 +694,8 @@
+ 	float Sound, Musik;
+ 
+ 	FILE *Datei = NULL;
+-
+-	fopen_s(&Datei, CONFIGFILE, "rb");		// versuchen Datei zu öffnen
++	
++	fopen_s(&Datei, homefile(CONFIGFILE).c_str(), "rb"); // versuchen Datei zu öffnen
+ 
+ 	if (Datei == NULL)
+ 		return false;
+@@ -769,8 +780,8 @@
+ 	float	Sound, Musik;
+ 
+ 	FILE *Datei = NULL;
+-
+-	fopen_s(&Datei, CONFIGFILE, "wb");
++	
++	fopen_s(&Datei, homefile(CONFIGFILE).c_str(), "wb");
+ 	if (Datei == NULL)
+     {
+    		Protokoll.WriteText("Config file saving failed !\n", false);
+diff -Naur src/Gameplay.h src/Gameplay.h
+--- src/Gameplay.h	2012-06-07 11:40:47.000000000 +0200
++++ src/Gameplay.h	2012-06-09 10:35:30.029915087 +0200
+@@ -86,6 +86,7 @@
+ extern const float ShockWaveY;
+ 
+ extern char	StageReihenfolge[256][100];
++extern std::string homefile(std::string file);
+ 
+ #endif
+ 
+diff -Naur src/Main.cpp src/Main.cpp
+--- src/Main.cpp	2012-06-07 11:40:48.000000000 +0200
++++ src/Main.cpp	2012-06-09 10:36:06.479914736 +0200
+@@ -102,7 +102,7 @@
+ #if defined(__AROS__)
+ Logdatei				Protokoll("T:Game_Log.txt");		// Protokoll Datei
+ #else
+-Logdatei				Protokoll("Game_Log.txt");		// Protokoll Datei
++Logdatei				Protokoll(homefile("Game_Log.txt").c_str());		// Protokoll Datei
+ #endif
+ CSoundManager			*pSoundManager =  NULL;			// Sound Manager
+ DirectGraphicsFont		*pDefaultFont = new(DirectGraphicsFont);
+@@ -559,7 +559,7 @@
+ 
+ 	// Kein Fehler im Game? Dann Logfile löschen
+ 	if (Protokoll.delLogFile == true)
+-		DeleteFile("Game_Log.txt");
++		DeleteFile(homefile("Game_Log.txt").c_str());
+ 
+ #if defined(PLATFORM_DIRECTX)
+ 	return(message.wParam);										// Rückkehr zu Windows
+diff -Naur src/Menu.cpp src/Menu.cpp
+--- src/Menu.cpp	2012-06-07 11:40:47.000000000 +0200
++++ src/Menu.cpp	2012-06-09 10:35:30.029915087 +0200
+@@ -2666,8 +2666,8 @@
+ 	// Versuchen, die Highscore Datei zu öffnen
+ 	// falls sie nicht existiert oder es eine Fehler gibt, wird die Standard
+ 	// Highscore gesetzt
+-	fopen_s(&Datei, "Hurrican.hsl", "rb");
+ 
++	fopen_s(&Datei, homefile("Hurrican.hsl").c_str(), "rb");
+ 
+ 	// Fehler beim Öffnen ? Dann standard Highscore setzen
+ 	//
+@@ -2722,7 +2722,8 @@
+ 	FILE *Datei;			// Savegame Datei
+ 
+ 	// Highscore Datei öffnen
+-	fopen_s(&Datei, "Hurrican.hsl", "wb");
++
++	fopen_s(&Datei, homefile("Hurrican.hsl").c_str(), "wb");
+ 
+ 	// Fehler beim Öffnen ? Dann standard Highscore setzen
+ 	//

diff --git a/games-arcade/hurrican/hurrican-9999.ebuild b/games-arcade/hurrican/hurrican-9999.ebuild
new file mode 100644
index 0000000..885b7ef
--- /dev/null
+++ b/games-arcade/hurrican/hurrican-9999.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="3"
+
+inherit eutils games subversion
+
+DESCRIPTION="a free and opensource Remake of the famous Turrican"
+HOMEPAGE="http://http://www.hurrican-game.de"
+ESVN_REPO_URI="svn://svn.code.sf.net/p/${PN}/code/trunk/Hurrican/"
+ESVN_PROJECT="${PN}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS=""
+IUSE="debug"
+
+RDEPEND="media-libs/libmodplug
+	>=media-libs/libsdl-1.2
+	media-libs/sdl-image
+	media-libs/sdl-mixer
+	virtual/opengl"
+
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+	epatch "${FILESDIR}"/${PN}-homedir.patch || die
+	# Respect GAMES_DATADIR
+	sed -i -e "s:hurricanlinux:hurrican:g" -i src/Makefile || die
+	sed -i -e "s:data\/:${GAMES_DATADIR}/${PN}/data\/:g" -i src/Console.cpp || die
+	sed -i -e "s:data\/:${GAMES_DATADIR}/${PN}/data\/:g" -i src/DX8Font.cpp || die
+	sed -i -e "s:data\/:${GAMES_DATADIR}/${PN}/data\/:g" -i src/DX8Sound.cpp || die
+	sed -i -e "s:data\/:${GAMES_DATADIR}/${PN}/data\/:g" -i src/DX8Sprite.cpp || die
+	sed -i -e "s:data\/:${GAMES_DATADIR}/${PN}/data\/:g" -i src/lightmap.cpp || die
+	sed -i -e "s:data\/:${GAMES_DATADIR}/${PN}/data\/:g" -i src/Texts.cpp || die
+	sed -i -e "s:data\/:${GAMES_DATADIR}/${PN}/data\/:g" -i src/Tileengine.cpp || die
+	sed -i -e "s:english.lng:${GAMES_DATADIR}/${PN}/english.lng:g" -i src/Gameplay.cpp || die
+
+}
+
+src_compile() {
+	cd src
+	emake || die "make failed"
+}
+
+src_install() {
+	dogamesbin ${PN}
+	local datadir="${GAMES_DATADIR}"/"${PN}"
+	dodir ${datadir}
+	insinto "${GAMES_DATADIR}"/"${PN}"
+	doins -r data lang english.lng || die
+	make_desktop_entry "${PN}" "${PN}"
+	dodoc readme.txt
+	prepgamesdirs
+}

diff --git a/games-arcade/hurrican/metadata.xml b/games-arcade/hurrican/metadata.xml
new file mode 100644
index 0000000..4a5a466
--- /dev/null
+++ b/games-arcade/hurrican/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>playboys</herd>
+</pkgmetadata>



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-09  8:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-09  8:40 [gentoo-commits] proj/gamerlay:master commit in: games-arcade/hurrican/, games-arcade/hurrican/files/ Marcel Unbehaun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox