public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: games-arcade/njam/, games-arcade/njam/files/
@ 2018-04-23 19:17 Pacho Ramos
  0 siblings, 0 replies; only message in thread
From: Pacho Ramos @ 2018-04-23 19:17 UTC (permalink / raw
  To: gentoo-commits

commit:     1a624d419888b1eeebae9486a65c167e2ddb6c82
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 23 17:59:20 2018 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Mon Apr 23 19:16:53 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1a624d41

games-arcade/njam: Drop games.eclass, fix format-security (#542124)

Package-Manager: Portage-2.3.31, Repoman-2.3.9

 .../njam/files/njam-1.25-format-security.patch     | 13 ++++++
 games-arcade/njam/files/njam-1.25-gcc45.patch      |  4 +-
 games-arcade/njam/njam-1.25-r1.ebuild              | 52 ++++++++++++++++++++++
 3 files changed, 67 insertions(+), 2 deletions(-)

diff --git a/games-arcade/njam/files/njam-1.25-format-security.patch b/games-arcade/njam/files/njam-1.25-format-security.patch
new file mode 100644
index 00000000000..66c8b17085b
--- /dev/null
+++ b/games-arcade/njam/files/njam-1.25-format-security.patch
@@ -0,0 +1,13 @@
+diff -up njam-1.25-src/src/njamgame.cpp~ njam-1.25-src/src/njamgame.cpp
+--- njam-1.25-src/src/njamgame.cpp~	2005-12-13 12:56:42.000000000 +0100
++++ njam-1.25-src/src/njamgame.cpp	2014-06-14 11:54:12.320854217 +0200
+@@ -227,8 +227,7 @@ void NjamEngine::StartGame(GameType Gt)
+ 	 	SDL_Surface *temp = IMG_Load(filename);
+ 	 	if (!temp)
+ 	 	{
+-			printf("Loading file: %s", filename);
+-			printf(SDL_GetError());
++			printf("Error loading file %s: %s\n", filename, SDL_GetError());
+ 			return;
+ 	 	}
+ 

diff --git a/games-arcade/njam/files/njam-1.25-gcc45.patch b/games-arcade/njam/files/njam-1.25-gcc45.patch
index b74bc3dac10..c6515ef0aaa 100644
--- a/games-arcade/njam/files/njam-1.25-gcc45.patch
+++ b/games-arcade/njam/files/njam-1.25-gcc45.patch
@@ -2,8 +2,8 @@ Fix buiding with gcc 4.5
 
 http://bugs.gentoo.org/show_bug.cgi?id=318411
 
---- src/njamedit.cpp
-+++ src/njamedit.cpp
+--- a/src/njamedit.cpp
++++ b/src/njamedit.cpp
 @@ -114,7 +114,7 @@
  				key = SDLK_a;
  			else if (CheckForSave())

diff --git a/games-arcade/njam/njam-1.25-r1.ebuild b/games-arcade/njam/njam-1.25-r1.ebuild
new file mode 100644
index 00000000000..2bdb8acf9b9
--- /dev/null
+++ b/games-arcade/njam/njam-1.25-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit desktop flag-o-matic
+
+MY_P="${P}-src"
+DESCRIPTION="Multi or single-player network Pacman-like game in SDL"
+HOMEPAGE="http://njam.sourceforge.net/"
+SRC_URI="mirror://sourceforge/njam/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="media-libs/sdl-mixer
+	media-libs/sdl-image
+	media-libs/libsdl
+	media-libs/sdl-net"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+	default
+	sed -i \
+		-e "s:hiscore.dat:/var/${PN}/\0:" \
+		src/njam.cpp \
+		|| die "sed failed"
+	sed -i \
+		-e "/hiscore.dat/ s:\$(DEFAULT_LIBDIR):/var:" \
+		Makefile.in \
+		|| die "sed failed"
+
+	eapply "${FILESDIR}"/${P}-gcc45.patch
+	eapply "${FILESDIR}"/${P}-format-security.patch #542124
+
+	# njam segfaults on startup with -Os
+	replace-flags "-Os" "-O2"
+}
+
+src_install() {
+	default
+
+	HTML_DOCS="${ED}/usr/share/njam/html/*"
+	rm -rf "${ED}/usr/share/njam/html/"
+	rm -f "${ED}"/README "${ED}"/levels/readme.txt
+
+	newicon data/njamicon.bmp njam.bmp
+	make_desktop_entry njam Njam /usr/share/pixmaps/njam.bmp
+}


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

only message in thread, other threads:[~2018-04-23 19:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-23 19:17 [gentoo-commits] repo/gentoo:master commit in: games-arcade/njam/, games-arcade/njam/files/ Pacho Ramos

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