diff options
author | Tristan Heaven <nyhm@gentoo.org> | 2010-07-08 13:13:07 +0000 |
---|---|---|
committer | Tristan Heaven <nyhm@gentoo.org> | 2010-07-08 13:13:07 +0000 |
commit | 77050ad1b875f0d339603ece3fa2eec206f9efba (patch) | |
tree | 88a78f9871d18322c9240f847d95b32104a3a292 /games-arcade/epiar | |
parent | Version bump (diff) | |
download | gentoo-2-77050ad1b875f0d339603ece3fa2eec206f9efba.tar.gz gentoo-2-77050ad1b875f0d339603ece3fa2eec206f9efba.tar.bz2 gentoo-2-77050ad1b875f0d339603ece3fa2eec206f9efba.zip |
Fix segfault caused by our patch, bug #326861
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'games-arcade/epiar')
-rw-r--r-- | games-arcade/epiar/ChangeLog | 10 | ||||
-rw-r--r-- | games-arcade/epiar/epiar-0.5-r1.ebuild | 52 | ||||
-rw-r--r-- | games-arcade/epiar/files/epiar-0.5-paths.patch | 86 |
3 files changed, 146 insertions, 2 deletions
diff --git a/games-arcade/epiar/ChangeLog b/games-arcade/epiar/ChangeLog index d886b88e86ff..b621a87c0bc6 100644 --- a/games-arcade/epiar/ChangeLog +++ b/games-arcade/epiar/ChangeLog @@ -1,9 +1,15 @@ # ChangeLog for games-arcade/epiar # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-arcade/epiar/ChangeLog,v 1.14 2010/01/07 21:52:18 josejx Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-arcade/epiar/ChangeLog,v 1.15 2010/07/08 13:13:07 nyhm Exp $ + +*epiar-0.5-r1 (08 Jul 2010) + + 08 Jul 2010; Tristan Heaven <nyhm@gentoo.org> +epiar-0.5-r1.ebuild, + +files/epiar-0.5-paths.patch: + Fix segfault caused by our patch, bug #326861 07 Jan 2010; Joseph Jezak <josejx@gentoo.org> epiar-0.5.ebuild: - Marked ppc stable for bug #295639. + Marked ppc stable for bug #294554. 26 Nov 2009; Markus Meier <maekke@gentoo.org> epiar-0.5.ebuild: x86 stable, bug #294554 diff --git a/games-arcade/epiar/epiar-0.5-r1.ebuild b/games-arcade/epiar/epiar-0.5-r1.ebuild new file mode 100644 index 000000000000..828a6cbb2514 --- /dev/null +++ b/games-arcade/epiar/epiar-0.5-r1.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/games-arcade/epiar/epiar-0.5-r1.ebuild,v 1.1 2010/07/08 13:13:07 nyhm Exp $ + +EAPI=2 +inherit flag-o-matic eutils games + +DESCRIPTION="A space adventure/combat game" +HOMEPAGE="http://epiar.net/" +SRC_URI="mirror://sourceforge/epiar/${P}.0-src.zip" + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +KEYWORDS="~ppc ~x86 ~x86-fbsd" +IUSE="" + +RDEPEND="media-libs/libsdl[video] + media-libs/sdl-image[png]" +DEPEND="${RDEPEND} + x11-libs/libX11 + virtual/opengl + app-arch/unzip" + +S=${WORKDIR} + +src_prepare() { + sed -i \ + -e "/^CFLAGS/s:-pg -g:${CFLAGS} ${LDFLAGS}:" \ + Makefile.linux \ + || die "sed failed" + epatch \ + "${FILESDIR}"/${P}-paths.patch \ + "${FILESDIR}"/${P}-gcc41.patch \ + "${FILESDIR}"/${P}-Makefile.linux.patch + sed -i \ + -e "s:GENTOO_DATADIR:${GAMES_DATADIR}/${PN}/:" \ + src/main.c \ + || die "sed failed" +} + +src_compile() { + emake -f Makefile.linux || die "emake failed" +} + +src_install() { + dogamesbin epiar || die "dogamesbin failed" + insinto "${GAMES_DATADIR}"/${PN} + doins -r missions *.eaf || die "doins failed" + keepdir "${GAMES_DATADIR}"/${PN}/plugins + dodoc AUTHORS ChangeLog README + prepgamesdirs +} diff --git a/games-arcade/epiar/files/epiar-0.5-paths.patch b/games-arcade/epiar/files/epiar-0.5-paths.patch new file mode 100644 index 000000000000..41266c7272b1 --- /dev/null +++ b/games-arcade/epiar/files/epiar-0.5-paths.patch @@ -0,0 +1,86 @@ +--- src/input/input.c ++++ src/input/input.c +@@ -240,7 +240,10 @@ + *
+ ******************************************************************************/
+ int load_input_cfg(void) {
+- FILE *fp = fopen("./.epiar-input.ecf", "rb");
++ char filename[PATH_MAX]; ++ FILE *fp; ++ snprintf(filename, sizeof(filename), "%s/.epiar-input.ecf", getenv("HOME")); ++ fp = fopen(filename, "rb");
+
+ /* make sure all keys are enabled */
+ unlock_keys();
+@@ -282,7 +285,7 @@ + } else {
+ float file_version = 0.0f;
+ /* read the file into the struct */
+- fp = fopen("./.epiar-input.ecf", "rb");
++ fp = fopen(filename, "rb");
+
+ if (fp == NULL) {
+ fprintf(stdout, "Could not open \"./.epiar-input.ecf\" for reading, assuming default bindings.\n");
+@@ -472,10 +475,12 @@ + }
+
+ void save_keybindings(void) {
++ char filename[PATH_MAX]; + float file_version = 0.2f;
+ FILE *fp;
+
+- fp = fopen("./.epiar-input.ecf", "wb");
++ snprintf(filename, sizeof(filename), "%s/.epiar-input.ecf", getenv("HOME")); ++ fp = fopen(filename, "wb");
+ if (fp == NULL) {
+ fprintf(stdout, "Could not create '~/.epiar-input.ecf' to save keybindings\n");
+ return;
+--- src/main.c ++++ src/main.c +@@ -16,7 +16,7 @@ + unsigned char view_mode = 0;
+ int ship_to_follow = 0;
+ int desired_bpp = 16;
+-char *game_path;
++const char * const game_path = "GENTOO_DATADIR";
+ unsigned char use_ogl = 0;
+ unsigned char skip_intro = 0;
+ FILE *epiar_eaf = NULL, *main_eaf = NULL;
+@@ -78,8 +78,6 @@ +
+ parse_commandline(argc, argv);
+
+- get_absolute_path(argv[0]);
+-
+ init(desired_bpp);
+
+ menu();
+--- src/main.h ++++ src/main.h +@@ -1,2 +1,2 @@ + extern char epiar_version[6];
+-extern char *game_path;
++extern const char * const game_path;
+--- src/system/init.c ++++ src/system/init.c +@@ -89,9 +89,6 @@ + main_eaf = NULL;
+ }
+
+- assert(game_path != NULL);
+- free(game_path);
+- game_path = NULL;
+
+ if (average_loop_time == 0) average_loop_time = 18; /* in case they quit on menu */
+ #ifndef NDEBUG
+--- src/system/path.c ++++ src/system/path.c +@@ -45,7 +45,7 @@ + }
+ #endif
+
+-#ifdef LINUX
++#if 0
+ char *strip_path_of_binary(char *argv) {
+ int len = 0, i, blen = 0;
+ char *stripped = NULL;
|