summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'games-puzzle')
-rw-r--r--games-puzzle/tong/ChangeLog13
-rw-r--r--games-puzzle/tong/files/tong-1.0-fps.patch4
-rw-r--r--games-puzzle/tong/files/tong-1.0-makefile.patch4
-rw-r--r--games-puzzle/tong/files/tong-1.2-datadir.patch41
-rw-r--r--games-puzzle/tong/files/tong-1.2-fps.patch25
-rw-r--r--games-puzzle/tong/files/tong-1.2-makefile.patch28
-rw-r--r--games-puzzle/tong/tong-1.2.ebuild44
7 files changed, 152 insertions, 7 deletions
diff --git a/games-puzzle/tong/ChangeLog b/games-puzzle/tong/ChangeLog
index 84446011c476..5150bd560998 100644
--- a/games-puzzle/tong/ChangeLog
+++ b/games-puzzle/tong/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for games-puzzle/tong
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-puzzle/tong/ChangeLog,v 1.7 2009/04/06 21:57:42 mr_bones_ Exp $
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/games-puzzle/tong/ChangeLog,v 1.8 2013/01/23 22:28:10 mr_bones_ Exp $
+
+*tong-1.2 (23 Jan 2013)
+
+ 23 Jan 2013; Michael Sterrett <mr_bones_@gentoo.org>
+ +files/tong-1.2-datadir.patch, +files/tong-1.2-fps.patch,
+ +files/tong-1.2-makefile.patch, +tong-1.2.ebuild, files/tong-1.0-fps.patch,
+ files/tong-1.0-makefile.patch:
+ version bump (bug #452282)
06 Apr 2009; Michael Sterrett <mr_bones_@gentoo.org>
+files/tong-1.0-fps.patch, -files/1.0-makefile.patch,
@@ -27,4 +35,3 @@
01 Feb 2005; Michael Sterrett <mr_bones_@gentoo.org> +metadata.xml,
+tong-1.0.ebuild:
initial commit - ebuild submitted by eGore via bug #76950
-
diff --git a/games-puzzle/tong/files/tong-1.0-fps.patch b/games-puzzle/tong/files/tong-1.0-fps.patch
index 59c1244d3537..d7f14dc8bc28 100644
--- a/games-puzzle/tong/files/tong-1.0-fps.patch
+++ b/games-puzzle/tong/files/tong-1.0-fps.patch
@@ -1,5 +1,5 @@
---- tong.cpp.ori 2007-10-15 19:27:54.000000000 +0200
-+++ tong.cpp 2007-10-15 19:36:51.000000000 +0200
+--- tong.cpp.ori
++++ tong.cpp
@@ -54,6 +54,8 @@
#define MENUMOUSE_THRESHOLD 40
#define DEMO_TIME 8000
diff --git a/games-puzzle/tong/files/tong-1.0-makefile.patch b/games-puzzle/tong/files/tong-1.0-makefile.patch
index 4c7fc65fc103..b131f1d38aeb 100644
--- a/games-puzzle/tong/files/tong-1.0-makefile.patch
+++ b/games-puzzle/tong/files/tong-1.0-makefile.patch
@@ -1,5 +1,5 @@
---- Makefile.orig 2005-02-01 11:49:23.000000000 -0500
-+++ Makefile 2005-02-01 11:51:07.000000000 -0500
+--- Makefile.orig
++++ Makefile
@@ -1,11 +1,10 @@
#hello world
#my first attempt at making a makefile
diff --git a/games-puzzle/tong/files/tong-1.2-datadir.patch b/games-puzzle/tong/files/tong-1.2-datadir.patch
new file mode 100644
index 000000000000..d0279ac3b874
--- /dev/null
+++ b/games-puzzle/tong/files/tong-1.2-datadir.patch
@@ -0,0 +1,41 @@
+--- tong.cpp.orig
++++ tong.cpp
+@@ -202,7 +202,6 @@
+ Tetrad *tetrad, *nexttetrad;
+ Paddle *paddle;
+ Ball *ball;
+- char datadir[256];
+ input_t input;
+ int volume = MIX_MAX_VOLUME;
+
+@@ -210,7 +209,6 @@
+ volume = 24;
+ #endif
+ memset(&input, 0, sizeof(input_t));
+- strcpy(datadir, GAME_DATA_DIR);
+ if(argc>1) {
+ if(!strcmp(argv[1], "-v") || !strcmp(argv[1], "--version")) {
+ printf("%s\n", GAME_ID);
+@@ -219,10 +217,6 @@
+ "warranty; not even for MERCHANTABILITY or"
+ " FITNESS FOR A PARTICULAR PURPOSE.\n");
+ return 0;
+- } else if(!strncmp(argv[1], "-p=", 3)) {
+- strcpy(datadir, argv[1]+(3*sizeof(char)));
+- } else if(!strncmp(argv[1], "--path=", 7)) {
+- strcpy(datadir, argv[1]+(7*sizeof(char)));
+ } else {
+ printf("Usage: %s [OPTION]\n", argv[0]);
+ printf("Play TONG, a Free Software game (Tetris meets Pong)\n");
+@@ -237,11 +231,6 @@
+ #ifdef WII
+ fatInitDefault();
+ #endif
+- if (chdir(datadir)) {
+- printf("Could not chdir to %s (attempting to use current dir)\n",
+- datadir);
+- }
+-
+ if(SDL_Init(SDL_INIT_AUDIO
+ |SDL_INIT_VIDEO
+ |SDL_INIT_TIMER
diff --git a/games-puzzle/tong/files/tong-1.2-fps.patch b/games-puzzle/tong/files/tong-1.2-fps.patch
new file mode 100644
index 000000000000..8ce66ebf1d31
--- /dev/null
+++ b/games-puzzle/tong/files/tong-1.2-fps.patch
@@ -0,0 +1,25 @@
+--- tong.cpp.orig
++++ tong.cpp
+@@ -64,6 +64,8 @@
+
+ #define DEMO_TIME 8000
+
++#define MIN_TIME 45
++
+ #define GP2X_BUTTON_UP 0
+ #define GP2X_BUTTON_UPLEFT 1
+ #define GP2X_BUTTON_LEFT 2
+@@ -1854,6 +1856,13 @@
+ SDL_Flip(screen);
+ lastlastupdate=lastupdate;
+ lastupdate=SDL_GetTicks();
++
++ // limit to 1000/MIN_TIME fps
++ if (lastupdate-lastlastupdate < MIN_TIME) {
++ SDL_Delay(MIN_TIME - (lastupdate - lastlastupdate));
++ }
++ lastupdate = SDL_GetTicks();
++
+ } //main game loop
+
+ Mix_FreeMusic(music);
diff --git a/games-puzzle/tong/files/tong-1.2-makefile.patch b/games-puzzle/tong/files/tong-1.2-makefile.patch
new file mode 100644
index 000000000000..68b4547d9427
--- /dev/null
+++ b/games-puzzle/tong/files/tong-1.2-makefile.patch
@@ -0,0 +1,28 @@
+--- Makefile.orig
++++ Makefile
+@@ -1,11 +1,10 @@
+ # TONG! makefile, tweak as you see fit
+
+-SDL_CFLAGS := $(shell sdl-config --cflags)
++CXXFLAGS += $(shell sdl-config --cflags)
+ SDL_LDFLAGS := $(shell sdl-config --libs)
+ MIXER_FLAGS := -lSDL_mixer -lpthread
+ IMG_FLAGS := -lSDL_image
+ GAME_DATA_DIR := .
+-CC = g++ -O3 -Wall #-ggdb3
+ SOURCES = tetris.cpp pong.cpp text.cpp option.cpp media.cpp
+ # these sources need to be linked to SDL libs, so may have special flag settings
+ SDL_SOURCES = tong.cpp
+@@ -29,11 +28,7 @@
+
+ # builds all, builds the target
+ all: $(OBJS)
+- $(CC) $(SDL_LDFLAGS) $(MIXER_FLAGS) $(IMG_FLAGS) $(OBJS) -o $(TARGET)
+-%.o: %.cpp
+- $(CC) $(SDL_CFLAGS) -c -o $@ $<
+-tong.o: $(SDL_SOURCES)
+- $(CC) -DGAME_DATA_DIR=\"$(GAME_DATA_DIR)\" $(SDL_CFLAGS) -c -o $@ $<
++ $(CXX) $(LDFLAGS) $(OBJS) $(SDL_LDFLAGS) $(MIXER_FLAGS) $(IMG_FLAGS) -o $(TARGET)
+
+ # clean out the mess
+ clean:
diff --git a/games-puzzle/tong/tong-1.2.ebuild b/games-puzzle/tong/tong-1.2.ebuild
new file mode 100644
index 000000000000..18c977729d3e
--- /dev/null
+++ b/games-puzzle/tong/tong-1.2.ebuild
@@ -0,0 +1,44 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-puzzle/tong/tong-1.2.ebuild,v 1.1 2013/01/23 22:28:10 mr_bones_ Exp $
+
+EAPI=2
+inherit eutils games
+
+DESCRIPTION="Tetris and Pong in the same place at the same time"
+HOMEPAGE="http://www.nongnu.org/tong/"
+SRC_URI="http://www.nongnu.org/tong/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+DEPEND="media-libs/libsdl[audio,joystick,video]
+ media-libs/sdl-image[png]
+ media-libs/sdl-mixer[vorbis]"
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}/${P}-makefile.patch" \
+ "${FILESDIR}/${P}-fps.patch" \
+ "${FILESDIR}/${P}-datadir.patch"
+ sed -i \
+ -e "s:\"media/:\"${GAMES_DATADIR}/${PN}/media/:" \
+ media.cpp option.cpp option.h pong.cpp tetris.cpp text.cpp \
+ || die
+ cp media/icon.png "${T}/${PN}.png" || die
+}
+
+src_install() {
+ dogamesbin tong || die
+ dodir "${GAMES_DATADIR}/${PN}"
+ cp -r media/ "${D}/${GAMES_DATADIR}/${PN}" || die
+ dodoc CHANGELOG README making-of.txt CREDITS
+
+ make_desktop_entry tong TONG
+ doicon "${T}/${PN}.png"
+ prepgamesdirs
+}