summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'games-arcade/snake3d')
-rw-r--r--games-arcade/snake3d/Manifest1
-rw-r--r--games-arcade/snake3d/files/snake3d-0.9-amd64.patch37
-rw-r--r--games-arcade/snake3d/files/snake3d-0.9-build.patch24
-rw-r--r--games-arcade/snake3d/metadata.xml13
-rw-r--r--games-arcade/snake3d/snake3d-0.9.ebuild38
5 files changed, 113 insertions, 0 deletions
diff --git a/games-arcade/snake3d/Manifest b/games-arcade/snake3d/Manifest
new file mode 100644
index 000000000000..28c8ebb9459e
--- /dev/null
+++ b/games-arcade/snake3d/Manifest
@@ -0,0 +1 @@
+DIST snake3d-0.9.tar.gz 62900 SHA256 38f7a8020044f331da2b718df5ec65d9cca95eaa1866acce3ea8772ac27ec16b SHA512 2bc2d3e68fd782d58c5f702727a8a72fb67096e7ff78e1e00f3a79767bad627fe3a2ceec05a621e8d5b4b3ba009a01814c93b7d21f180512b13411bf61ac1065 WHIRLPOOL 4fb6d6d0632cfa3bc869618f616f687a5dcdc9f92f4bf03b0e73af100f32d7edee331660a88ec52679c3974cfdfc2f4974b49b0df6a050fb9d6c541ab037fe93
diff --git a/games-arcade/snake3d/files/snake3d-0.9-amd64.patch b/games-arcade/snake3d/files/snake3d-0.9-amd64.patch
new file mode 100644
index 000000000000..d2b5f2c79acd
--- /dev/null
+++ b/games-arcade/snake3d/files/snake3d-0.9-amd64.patch
@@ -0,0 +1,37 @@
+--- src/functions.cpp.old 2007-03-31 11:04:10.000000000 +0200
++++ src/functions.cpp 2007-03-31 11:11:52.000000000 +0200
+@@ -107,8 +107,8 @@
+ pointer = end;
+ }
+
+- memcpy(str, i, (int)pointer - (int)i);
+- str[(int)pointer - (int)i] = 0;
++ memcpy(str, i, ssize_t(pointer - i));
++ str[pointer - i] = 0;
+
+ drawString(x, y, str);
+
+@@ -501,15 +501,21 @@
+
+ Uint32 timer(Uint32 interval, void* value) {
+
++ union {
++ void *value;
++ int p_mode;
++ } p_modeConv;
++ p_modeConv.value = value;
++
+ //if ((int)value != gameModeValue)
+- if ((int)value != p_mode)
++ if (p_modeConv.p_mode != p_mode)
+ return 0;
+
+ SDL_Event event;
+ SDL_UserEvent userevent;
+
+ userevent.type = SDL_USEREVENT;
+- userevent.code = (int)value;
++ userevent.code = p_modeConv.p_mode;
+ userevent.data1 = NULL;
+ userevent.data2 = NULL;
+
diff --git a/games-arcade/snake3d/files/snake3d-0.9-build.patch b/games-arcade/snake3d/files/snake3d-0.9-build.patch
new file mode 100644
index 000000000000..f7d8c4404df4
--- /dev/null
+++ b/games-arcade/snake3d/files/snake3d-0.9-build.patch
@@ -0,0 +1,24 @@
+--- src/Makefile
++++ src/Makefile
+@@ -1,10 +1,10 @@
+ OBJ = board.o snake.o game.o menu.o snake3d.o global.o consts.o cube.o functions.o preferences.o rooms2.o network.o userInput.o server.o packets.o client.o classic2d.o
+-CXXFLAGS = -g -Wall -I/usr/X11R6/include/ `sdl-config --cflags`
++CXXFLAGS += -Wall $(shell sdl-config --cflags)
+ CXX = g++
+ CC = g++
+ #LDFLAGSMAC = -framework GLUT -framework OpenGL -framework Cocoa -bind_at_load -L/sw/lib/ -lSDL -lSDLmain
+ LDFLAGSMAC = `sdl-config --libs` -framework GLUT -framework OpenGL -lSDL_net
+-LDFLAGS = -L/usr/X11R6/lib/ -lGL -lglut -lGLU -lSDL -lSDL_net
++LIBS = -lGL -lglut -lGLU $(shell sdl-config --libs) -lSDL_net
+
+ all: snake3d
+
+@@ -18,7 +18,7 @@
+ g++ $(LDFLAGSMAC) $(OBJ) -o ../snake3d
+
+ snake3d.linux: $(OBJ)
+- g++ $(LDFLAGS) $(OBJ) -o ../snake3d
++ $(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJ) $(LIBS) -o ../snake3d
+
+
+ clean:
diff --git a/games-arcade/snake3d/metadata.xml b/games-arcade/snake3d/metadata.xml
new file mode 100644
index 000000000000..41a8199548e9
--- /dev/null
+++ b/games-arcade/snake3d/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>games</herd>
+ <longdescription lang="en">
+snake3d is a variant of the snake game. You are a snake in a 3d world trying to
+eat as many icosahedrons as possible, which makes your tail longer. There are
+other snakes (network players) in the world which will try to fail you.
+</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">worms3d</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/games-arcade/snake3d/snake3d-0.9.ebuild b/games-arcade/snake3d/snake3d-0.9.ebuild
new file mode 100644
index 000000000000..6ac93aa8bb98
--- /dev/null
+++ b/games-arcade/snake3d/snake3d-0.9.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+EAPI=5
+inherit eutils toolchain-funcs games
+
+DESCRIPTION="variant of the snake game"
+HOMEPAGE="http://sourceforge.net/projects/worms3d/"
+SRC_URI="mirror://sourceforge/worms3d/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="media-libs/sdl-net
+ virtual/opengl
+ media-libs/freeglut
+ virtual/glu
+ media-libs/libsdl"
+RDEPEND="${DEPEND}"
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-amd64.patch \
+ "${FILESDIR}"/${P}-build.patch
+}
+
+src_compile() {
+ emake CXX=$(tc-getCXX) -C src snake3d.linux
+}
+
+src_install() {
+ dogamesbin ${PN}
+ dodoc ChangeLog README TODO
+ prepgamesdirs
+}