Ugly brute-force method for avoiding a double-free segfault on exit.
Better patch welcome.
---- spacerider.cpp.orig 2015-03-31 23:24:17.770966147 -0400
-+++ spacerider.cpp 2015-03-31 23:24:41.592174463 -0400
+--- a/spacerider.cpp.orig 2015-03-31 23:24:17.770966147 -0400
++++ b/spacerider.cpp 2015-03-31 23:24:41.592174463 -0400
@@ -306,8 +306,6 @@
/* free screen */
SDL_FreeSurface(screen);
---- spacerider.cpp.old 2007-02-18 11:25:38.000000000 +0100
-+++ spacerider.cpp 2007-02-18 11:27:00.000000000 +0100
+--- a/spacerider.cpp.old 2007-02-18 11:25:38.000000000 +0100
++++ b/spacerider.cpp 2007-02-18 11:27:00.000000000 +0100
@@ -17,6 +17,7 @@
#include <unistd.h>
}
---- effect.cpp.orig 2015-03-31 22:36:53.336131373 -0400
-+++ effect.cpp 2015-03-31 22:37:04.359755281 -0400
+--- a/effect.cpp.orig 2015-03-31 22:36:53.336131373 -0400
++++ b/effect.cpp 2015-03-31 22:37:04.359755281 -0400
@@ -18,7 +18,7 @@
void Effect::add(const int x, const int y)
{
{
return;
}
---- object.h.orig 2015-03-31 22:35:22.939214561 -0400
-+++ object.h 2015-03-31 22:37:19.654233441 -0400
+--- a/object.h.orig 2015-03-31 22:35:22.939214561 -0400
++++ b/object.h 2015-03-31 22:37:19.654233441 -0400
@@ -172,7 +172,7 @@
return object->next;
}
---- Makefile
-+++ Makefile
+--- a/Makefile
++++ b/Makefile
@@ -3,12 +3,12 @@
BINDIR=/usr/bin/
MANDIR=/usr/share/man/man1/
---- spacerider.cpp.old 2010-10-29 10:12:19.000000000 +0200
-+++ spacerider.cpp 2010-10-29 10:13:47.000000000 +0200
+--- a/spacerider.cpp.old 2010-10-29 10:12:19.000000000 +0200
++++ b/spacerider.cpp 2010-10-29 10:13:47.000000000 +0200
@@ -112,7 +112,7 @@
break;
case 'n':
--- /dev/null
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit desktop
+
+DESCRIPTION="Space-shooter written in C++, using the SDL"
+HOMEPAGE="http://www.hackl.dhs.org/spacerider/"
+SRC_URI="mirror://gentoo/${P}.tar.bz2" # stupid php script
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="media-libs/libsdl[sound,video]
+ media-libs/sdl-gfx
+ media-libs/sdl-mixer
+ media-libs/sdl-image[jpeg]
+ media-libs/sdl-net
+ media-libs/sdl-ttf"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ default
+ eapply "${FILESDIR}/${P}"-gentoo.patch \
+ "${FILESDIR}/${P}"-gcc41.patch \
+ "${FILESDIR}"/${P}-ovflfix.patch \
+ "${FILESDIR}"/${P}-gcc49.patch \
+ "${FILESDIR}"/${P}-font.patch
+ sed -i \
+ -e "s:/usr/share/games/spacerider:/usr/share/${PN}:" \
+ globals.cpp || die
+}
+
+src_install() {
+ dobin ${PN}
+ insinto "/usr/share/${PN}"
+ doins -r data
+ einstalldocs
+ newman ${PN}.{1,6}
+ newicon data/sprites/star_monster1/1.bmp ${PN}.bmp
+ make_desktop_entry ${PN} Spacerider /usr/share/pixmaps/${PN}.bmp
+}