summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'games-arcade')
-rw-r--r--games-arcade/snake/ChangeLog7
-rw-r--r--games-arcade/snake/Manifest6
-rw-r--r--games-arcade/snake/files/snake-0.5.1-clean-up-Makefile.patch78
-rw-r--r--games-arcade/snake/files/snake-0.5.1-qa-warnings.patch86
-rw-r--r--games-arcade/snake/snake-0.5.1.ebuild12
5 files changed, 185 insertions, 4 deletions
diff --git a/games-arcade/snake/ChangeLog b/games-arcade/snake/ChangeLog
index 72d2f5c6c..a96176edb 100644
--- a/games-arcade/snake/ChangeLog
+++ b/games-arcade/snake/ChangeLog
@@ -2,6 +2,13 @@
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 23 Aug 2009; Romain Perier (mrpouet) <mrpouet@gentoo.org>
+ snake-0.5.1.ebuild, +files/snake-0.5.1-clean-up-Makefile.patch,
+ +files/snake-0.5.1-qa-warnings.patch:
+ Add ~amd64 into KEYWORDS, Patch to have a standard and clean Makefile, Fix
+ some QA warnings into the source code, define src_compile() to give CC
+ CXXFLAGS and LDFLAGS to emake
+
21 Aug 2009; Lars Hartmann (psychoschlumpf) <lars@chaotika.org>
-snake-0.4.2-r1.ebuild, +snake-0.5.1.ebuild:
Version bump for games-arcade/snake, Thanks to Manuel Lausch
diff --git a/games-arcade/snake/Manifest b/games-arcade/snake/Manifest
index 12b2bda83..dad06af3d 100644
--- a/games-arcade/snake/Manifest
+++ b/games-arcade/snake/Manifest
@@ -1,4 +1,6 @@
+AUX snake-0.5.1-clean-up-Makefile.patch 2288 RMD160 291ced7dd967291a73ea524c53e4e969803f01a2 SHA1 531dfb86197b2c7d8c26611a62d55f6c782afb67 SHA256 ed4878f2c0e6dcdcc285ed8f9a7966d7658787257a98c827c79b8b204fc27ed8
+AUX snake-0.5.1-qa-warnings.patch 2738 RMD160 43567ac54cbbe1604783d9a754525aba7d0f9c51 SHA1 5a4a087a0a9df78e4c98f5686506f947a1664977 SHA256 cfcf64d842a98de40a32e662332960c54ee610cbc82abe5ae8e123fd04cf4047
DIST snake-0.5.1.tar.bz2 173330 RMD160 2da378f1875fa1739be12da5b8680ccac0737268 SHA1 e2386cd9ae9e651f63f6fc63233f66a0c1f63e83 SHA256 0a8427a5dd6017e40b7098ff71b99a5d25104fbaa7371456a36c5a415c27fa87
-EBUILD snake-0.5.1.ebuild 577 RMD160 3609128fcda9ed42d01f78e3c6a8f83f0798fc89 SHA1 088795523703b9ef24c6af04333a7660259c166a SHA256 2af610e2707c3c6287740a950e55d695274c0b63fa10f57c2d384874813e6b48
-MISC ChangeLog 700 RMD160 ac27139377f570adfd391f56f9f0be83f492959d SHA1 685df7fc11f1e947c5aefc7057474d68d6a0be9c SHA256 3bee83bedd62fb75ecc67dee0b6bcf8765b39cfb3fc77fd6ce7670c845df7d54
+EBUILD snake-0.5.1.ebuild 816 RMD160 ed45f43350568373a189b5bd6c0f67a69e960c0b SHA1 3dbed60434e7c376a4837e89c3fb5b460cf3a242 SHA256 49597f3526bff79ecfcba1d2cb480582fd14feb3f39338ac39ad030984fef8d9
+MISC ChangeLog 1049 RMD160 c7cd3c94965b561ada5252974cd50c1be980b5ec SHA1 5ec2a316d3877be456b33d32c3faed86dc41b997 SHA256 47ecf689b96a251bec8f56f0dc6ac926f4342c784286349ba33086cb0733806a
MISC metadata.xml 174 RMD160 4baef080089dfad6ee65bcfb4ec1179e00e696b2 SHA1 83b132ab88e399a7699d991cb9ebb1276101d7bc SHA256 7694ba94603327277230fc9afacee8773445604a8e55a6a6d9a4724fe0625d91
diff --git a/games-arcade/snake/files/snake-0.5.1-clean-up-Makefile.patch b/games-arcade/snake/files/snake-0.5.1-clean-up-Makefile.patch
new file mode 100644
index 000000000..a1f90c9c3
--- /dev/null
+++ b/games-arcade/snake/files/snake-0.5.1-clean-up-Makefile.patch
@@ -0,0 +1,78 @@
+ Makefile | 54 +++++++++++++++++-------------------------------------
+ 1 files changed, 17 insertions(+), 37 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 69e39ea..d1ac825 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,8 +1,11 @@
+-OBJS = main.o snake.o config.o playground.o queue_key.o config-player.o
+-CC = g++
+-DEBUG = -g
+-CFLAGS = -Wall -c -I/usr/include/SDL $(DEBUG)
+-LFLAGS = -Wall -L/usr/lib -lSDL -lpthread -lSDL_image -lSDL_gfx -lSDL_ttf -lSDL_mixer $(DEBUG)
++CC=g++
++my_CXXFLAGS=
++CXXFLAGS=-W -Wall `pkg-config sdl --cflags` $(my_CXXFLAGS)
++LIBS=`pkg-config sdl --libs` -lSDL_image -lSDL_gfx -lSDL_ttf -lSDL_mixer
++LDFLAGS=
++
++SRC=$(wildcard src/*.cpp)
++OBJ=$(SRC:.cpp=.o)
+
+ ifndef GAMES_BINDIR
+ GAMES_BINDIR=/usr/games/bin
+@@ -12,44 +15,21 @@ ifndef GAMES_DATADIR
+ GAMES_DATADIR=/usr/share/games
+ endif
+
+-CFLAGS+=-DBINDIR="\"$(GAMES_BINDIR)\""
+-CFLAGS+=-DDATADIR="\"$(GAMES_DATADIR)\""
+-
+-Release: snake
+-Debug: snake
+-
+-snake : $(OBJS)
+- $(CC) $(LFLAGS) $(OBJS) -o snake
+-
+-main.o : src/main.cpp src/config.h src/snake.h
+- $(CC) $(CFLAGS) src/main.cpp
+-
+-snake.o : src/snake.cpp src/snake.h src/config.h src/definitions.h src/koordinate.h src/playground.h src/queue_key.h
+- $(CC) $(CFLAGS) src/snake.cpp
+-
+-config.o : src/config.cpp src/config.h src/config-player.h
+- $(CC) $(CFLAGS) src/config.cpp
++CXXFLAGS+=-DBINDIR="\"$(GAMES_BINDIR)\""
++CXXFLAGS+=-DDATADIR="\"$(GAMES_DATADIR)\""
+
+-playground.o : src/playground.cpp src/playground.h src/definitions.h src/config.h
+- $(CC) $(CFLAGS) src/playground.cpp
+-
+-queue_key.o : src/queue_key.cpp src/queue_key.h src/definitions.h
+- $(CC) $(CFLAGS) src/queue_key.cpp
+-
+-config-player.o : src/config-player.cpp src/config-player.h src/config.h src/definitions.h
+- $(CC) $(CFLAGS) src/config-player.cpp
++all: snake
+
++snake: $(OBJ)
++ $(CC) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS)
++%.o: src/%.cpp src/%.h
+ clean:
+- rm *.o *~ snake
+-
+-
++ rm -f $(OBJ) *~ snake
+ install:
+ mkdir -p $(DESTDIR)/$(GAMES_BINDIR)/
+ install -g games -m 750 ./snake $(DESTDIR)/$(GAMES_BINDIR)/
+ mkdir -p $(DESTDIR)/$(GAMES_DATADIR)/snake/
+ install -g games -m 640 ./src/res/* $(DESTDIR)/$(GAMES_DATADIR)/snake/
+-
+-
+ uninstall:
+- rm -r $(GAMES_DATADIR)/snake
+- rm $(GAMES_BINDIR)/snake
++ rm -rf $(GAMES_DATADIR)/snake
++ rm -f $(GAMES_BINDIR)/snake
diff --git a/games-arcade/snake/files/snake-0.5.1-qa-warnings.patch b/games-arcade/snake/files/snake-0.5.1-qa-warnings.patch
new file mode 100644
index 000000000..dc7196768
--- /dev/null
+++ b/games-arcade/snake/files/snake-0.5.1-qa-warnings.patch
@@ -0,0 +1,86 @@
+ src/config.cpp | 12 +++++++-----
+ src/config.h | 10 +++++-----
+ src/snake.cpp | 2 +-
+ 3 files changed, 13 insertions(+), 11 deletions(-)
+
+diff --git a/src/config.cpp b/src/config.cpp
+index 815414b..cb66599 100644
+--- a/src/config.cpp
++++ b/src/config.cpp
+@@ -153,17 +153,19 @@ void config::save()
+ configfile.close();
+ }
+
+-const unsigned int config::get_feldbreite() const
++/* In this case a copy of an unsigned int is returned and not a reference or a pointer
++ * so no side effect (so "const unsigned int" doesn't make sense) */
++unsigned int config::get_feldbreite() const
+ {
+ return feldbreite;
+ }
+
+-const unsigned int config::get_feldhohe() const
++unsigned int config::get_feldhohe() const
+ {
+ return feldhohe;
+ }
+
+-const unsigned int config::get_feldgrose() const
++unsigned int config::get_feldgrose() const
+ {
+ return feldbreite * feldhohe;
+ }
+@@ -173,7 +175,7 @@ const std::string & config::get_datapath() const
+ return datapath;
+ }
+
+-const unsigned int config::get_quadsize() const
++unsigned int config::get_quadsize() const
+ {
+ return quadsize;
+ }
+@@ -188,7 +190,7 @@ const std::string & config::get_version() const
+ return version;
+ }
+
+-const unsigned int config::get_maxplayer() const
++unsigned int config::get_maxplayer() const
+ {
+ return maxplayer;
+ }
+diff --git a/src/config.h b/src/config.h
+index 71bb76e..4a93c83 100644
+--- a/src/config.h
++++ b/src/config.h
+@@ -37,13 +37,13 @@ class config
+ public:
+ config();
+ ~config();
+- const unsigned int get_feldbreite() const; //const für den Rückgabetyp entfernen (gcc 4 ungrad warnt)
+- const unsigned int get_feldhohe() const;
+- const unsigned int get_feldgrose() const;
++ unsigned int get_feldbreite() const; //const für den Rückgabetyp entfernen (gcc 4 ungrad warnt)
++ unsigned int get_feldhohe() const;
++ unsigned int get_feldgrose() const;
+ const std::string & get_datapath() const;
+- const unsigned int get_quadsize() const;
++ unsigned int get_quadsize() const;
+ const std::string & get_version() const;
+- const unsigned int get_maxplayer() const;
++ unsigned int get_maxplayer() const;
+ config_player *get_player(int); // Variablenname
+ std::string get_filepath(std::string);
+ void save(); // hier const
+diff --git a/src/snake.cpp b/src/snake.cpp
+index d7d3f91..d930a30 100644
+--- a/src/snake.cpp
++++ b/src/snake.cpp
+@@ -174,7 +174,7 @@ int snake::step()
+ SDL_Surface *font_src = 0;
+ char titel[256];
+ sprintf(titel, "Punkte: %d", punkte);
+- SDL_Color color = {255,255,255};
++ SDL_Color color = {255,255,255, 255};
+ font_src = TTF_RenderText_Solid(pFont, titel, color); // hat irgendwie ein bug
+ // font_src = TTF_RenderText_Blended(pFont, titel, color); // drum den workaround
+ if (font_src == 0)
diff --git a/games-arcade/snake/snake-0.5.1.ebuild b/games-arcade/snake/snake-0.5.1.ebuild
index 75660fd65..db27f85de 100644
--- a/games-arcade/snake/snake-0.5.1.ebuild
+++ b/games-arcade/snake/snake-0.5.1.ebuild
@@ -4,7 +4,7 @@
EAPI="2"
-inherit games
+inherit eutils games toolchain-funcs
DESCRIPTION="snake like game"
HOMEPAGE="http://www.hs.no-ip.info/software/snake.html"
@@ -12,7 +12,7 @@ SRC_URI="http://www.hs.no-ip.info/software/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
-KEYWORDS="~x86"
+KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND="
media-libs/libsdl[alsa,X]
@@ -23,6 +23,14 @@ DEPEND="
"
RDEPEND=${DEPEND}
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-{clean-up-Makefile,qa-warnings}.patch
+}
+src_compile() {
+ emake CC=$(tc-getCXX) \
+ my_CXXFLAGS="${CXXFLAGS}" \
+ LDFLAGS="${LDFLAGS}" || die "emake failed"
+}
src_install() {
emake DESTDIR="${D}" install || die "install failed"
prepgamesdirs