summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Heaven <nyhm@gentoo.org>2009-07-15 13:11:01 +0000
committerTristan Heaven <nyhm@gentoo.org>2009-07-15 13:11:01 +0000
commit74410eff4a258344401844667ab63c8ed420fcbb (patch)
tree24a646879ee71d38090b9154b5e448d4608de9c6 /games-arcade/cdogs-sdl
parentstable x86, bug 247622 (diff)
downloadgentoo-2-74410eff4a258344401844667ab63c8ed420fcbb.tar.gz
gentoo-2-74410eff4a258344401844667ab63c8ed420fcbb.tar.bz2
gentoo-2-74410eff4a258344401844667ab63c8ed420fcbb.zip
Fix crash on amd64, bug #270899
(Portage version: 2.2_rc33/cvs/Linux x86_64)
Diffstat (limited to 'games-arcade/cdogs-sdl')
-rw-r--r--games-arcade/cdogs-sdl/ChangeLog8
-rw-r--r--games-arcade/cdogs-sdl/cdogs-sdl-0.4-r1.ebuild58
-rw-r--r--games-arcade/cdogs-sdl/files/cdogs-sdl-0.4-64bit.patch48
3 files changed, 113 insertions, 1 deletions
diff --git a/games-arcade/cdogs-sdl/ChangeLog b/games-arcade/cdogs-sdl/ChangeLog
index 37a2a70e99c4..7d1dd62a21c7 100644
--- a/games-arcade/cdogs-sdl/ChangeLog
+++ b/games-arcade/cdogs-sdl/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for games-arcade/cdogs-sdl
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-arcade/cdogs-sdl/ChangeLog,v 1.3 2009/02/26 21:47:21 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-arcade/cdogs-sdl/ChangeLog,v 1.4 2009/07/15 13:11:00 nyhm Exp $
+
+*cdogs-sdl-0.4-r1 (15 Jul 2009)
+
+ 15 Jul 2009; Tristan Heaven <nyhm@gentoo.org> +cdogs-sdl-0.4-r1.ebuild,
+ +files/cdogs-sdl-0.4-64bit.patch:
+ Fix crash on amd64, bug #270899
*cdogs-sdl-0.4 (26 Feb 2009)
diff --git a/games-arcade/cdogs-sdl/cdogs-sdl-0.4-r1.ebuild b/games-arcade/cdogs-sdl/cdogs-sdl-0.4-r1.ebuild
new file mode 100644
index 000000000000..96eb2a89bd3a
--- /dev/null
+++ b/games-arcade/cdogs-sdl/cdogs-sdl-0.4-r1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-arcade/cdogs-sdl/cdogs-sdl-0.4-r1.ebuild,v 1.1 2009/07/15 13:11:00 nyhm Exp $
+
+EAPI=2
+inherit eutils games
+
+CDOGS_DATA="cdogs-data-2007-07-06"
+DESCRIPTION="A port of the old DOS arcade game C-Dogs"
+HOMEPAGE="http://lumaki.com/code/cdogs"
+SRC_URI="http://icculus.org/cdogs-sdl/files/src/${P}.tar.bz2
+ http://icculus.org/cdogs-sdl/files/data/${CDOGS_DATA}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="media-libs/libsdl
+ media-libs/sdl-mixer"
+
+S=${WORKDIR}/${P}/src
+
+src_unpack() {
+ unpack ${A}
+ mv ${CDOGS_DATA} ${P}/data || die "Failed moving data around"
+}
+
+src_prepare() {
+ sed -i \
+ -e "/^CF_OPT/d" \
+ -e "/^CC/d" \
+ Makefile \
+ || die "sed failed"
+ sed -i \
+ -e "/\bopen(/s/)/, 0666)/" \
+ files.c \
+ || die "sed failed"
+ epatch "${FILESDIR}"/${P}-64bit.patch
+}
+
+src_compile() {
+ emake I_AM_CONFIGURED=yes \
+ SYSTEM="\"linux\"" \
+ STRIP=true \
+ DATADIR="${GAMES_DATADIR}/${PN}" \
+ cdogs || die "emake failed"
+}
+
+src_install() {
+ dogamesbin cdogs || die "dogamesbin failed"
+ insinto "${GAMES_DATADIR}/${PN}"
+ doins -r ../data/* || die "doins failed"
+ newicon ../data/cdogs_icon.png ${PN}.png
+ dodoc ../doc/{README,AUTHORS,ChangeLog,README_DATA,TODO,original_readme.txt}
+ make_desktop_entry "cdogs -fullscreen" C-Dogs
+ prepgamesdirs
+}
diff --git a/games-arcade/cdogs-sdl/files/cdogs-sdl-0.4-64bit.patch b/games-arcade/cdogs-sdl/files/cdogs-sdl-0.4-64bit.patch
new file mode 100644
index 000000000000..bcab13c0ebfd
--- /dev/null
+++ b/games-arcade/cdogs-sdl/files/cdogs-sdl-0.4-64bit.patch
@@ -0,0 +1,48 @@
+--- src/grafx.c
++++ src/grafx.c
+@@ -216,12 +216,6 @@
+ SDL_VideoQuit();
+ }
+
+-typedef struct _Pic {
+- short int w;
+- short int h;
+- char *data;
+-} Pic;
+-
+ int ReadPics(const char *filename, void **pics, int maxPics,
+ color * palette)
+ {
+@@ -241,12 +235,12 @@
+ fread(&size, sizeof(size), 1, f);
+ swap16(&size);
+ if (size) {
+- Pic *p = sys_mem_alloc(size);
++ unsigned char *p = sys_mem_alloc(size);
+
+- f_read16(f, &p->w, 2);
+- f_read16(f, &p->h, 2);
++ f_read16(f, &p[0], 2); // w
++ f_read16(f, &p[2], 2); // h
+
+- f_read(f, &p->data, size - 4);
++ f_read(f, &p[4], size - 4); // data
+
+ pics[i] = p;
+
+@@ -278,11 +272,11 @@
+ fread(&size, sizeof(size), 1, f);
+ swap16(&size);
+ if (size) {
+- Pic *p = sys_mem_alloc(size);
++ unsigned char *p = sys_mem_alloc(size);
+
+- f_read16(f, &p->w, 2);
+- f_read16(f, &p->h, 2);
+- f_read(f, &p->data, size - 4);
++ f_read16(f, &p[0], 2); // w
++ f_read16(f, &p[2], 2); // h
++ f_read(f, &p[4], size - 4); // data
+
+ pics[i] = p;
+