summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Heaven <nyhm@gentoo.org>2007-07-06 22:18:36 +0000
committerTristan Heaven <nyhm@gentoo.org>2007-07-06 22:18:36 +0000
commitfe970a898fd0fcb8f4c103836b70fa5d853ed3db (patch)
tree904ffb6f8eb78edc5408cfcb2f44aff00af935a3 /games-puzzle/quadra
parentupstream has changed source directory layout, adjusted ebuilds (#184146). Tha... (diff)
downloadgentoo-2-fe970a898fd0fcb8f4c103836b70fa5d853ed3db.tar.gz
gentoo-2-fe970a898fd0fcb8f4c103836b70fa5d853ed3db.tar.bz2
gentoo-2-fe970a898fd0fcb8f4c103836b70fa5d853ed3db.zip
Patch for gcc-4.2
(Portage version: 2.1.3_rc6)
Diffstat (limited to 'games-puzzle/quadra')
-rw-r--r--games-puzzle/quadra/ChangeLog8
-rw-r--r--games-puzzle/quadra/files/quadra-1.1.8-gcc42.patch272
-rw-r--r--games-puzzle/quadra/quadra-1.1.8.ebuild18
3 files changed, 288 insertions, 10 deletions
diff --git a/games-puzzle/quadra/ChangeLog b/games-puzzle/quadra/ChangeLog
index b26c2157deea..f7943674cd24 100644
--- a/games-puzzle/quadra/ChangeLog
+++ b/games-puzzle/quadra/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for games-puzzle/quadra
-# Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-puzzle/quadra/ChangeLog,v 1.15 2006/12/06 17:18:47 wolf31o2 Exp $
+# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/games-puzzle/quadra/ChangeLog,v 1.16 2007/07/06 22:18:36 nyhm Exp $
+
+ 06 Jul 2007; Tristan Heaven <nyhm@gentoo.org>
+ +files/quadra-1.1.8-gcc42.patch, quadra-1.1.8.ebuild:
+ Patch for gcc-4.2
06 Dec 2006; Chris Gianelloni <wolf31o2@gentoo.org> quadra-1.1.8.ebuild:
Remove old virtual/x11 dependency.
diff --git a/games-puzzle/quadra/files/quadra-1.1.8-gcc42.patch b/games-puzzle/quadra/files/quadra-1.1.8-gcc42.patch
new file mode 100644
index 000000000000..eb64e2ec2443
--- /dev/null
+++ b/games-puzzle/quadra/files/quadra-1.1.8-gcc42.patch
@@ -0,0 +1,272 @@
+--- skelton/common/bitmap.cpp
++++ skelton/common/bitmap.cpp
+@@ -145,11 +145,11 @@
+
+ // Special cases: vertical and horizontal lines.
+ if(y1 == y2) {
+- hline(y1, min(x1, x2), deltax, color);
++ hline(y1, MIN(x1, x2), deltax, color);
+ return;
+ }
+ if(x1 == x2) {
+- vline(x1, min(y1, y2), deltay, color);
++ vline(x1, MIN(y1, y2), deltay, color);
+ return;
+ }
+
+--- skelton/common/clipable.cpp
++++ skelton/common/clipable.cpp
+@@ -31,16 +31,16 @@
+ int Clipable::clip_w;
+
+ bool Clipable::clip(const int x, const int y, const int w, const int h) const {
+- clip_x1=max(0, x);
++ clip_x1=MAX(0, x);
+ if(clip_x1>=width)
+ return true;
+- clip_x2=min(width-1, x+w-1);
++ clip_x2=MIN(width-1, x+w-1);
+ if(clip_x2<0)
+ return true;
+- clip_y1=max(0, y);
++ clip_y1=MAX(0, y);
+ if(clip_y1>=height)
+ return true;
+- clip_y2=min(height-1, y+h-1);
++ clip_y2=MIN(height-1, y+h-1);
+ if(clip_y2<0)
+ return true;
+ clip_w = clip_x2-clip_x1+1;
+--- skelton/common/cursor_self.cpp
++++ skelton/common/cursor_self.cpp
+@@ -68,7 +68,7 @@
+ }
+
+ void Cursor_Self::set_speed(const Byte s) {
+- speed = max(1, s);
++ speed = MAX(1, s);
+ pool_x = pool_y = 0;
+ }
+
+--- skelton/common/inter.cpp
++++ skelton/common/inter.cpp
+@@ -420,7 +420,7 @@
+ void Zone_panel::resize() {
+ if(pan)
+ delete pan;
+- pan = Video_bitmap::New(x+2, y+2, max(w-4, 0), max(h-4, 0));
++ pan = Video_bitmap::New(x+2, y+2, MAX(w-4, 0), MAX(h-4, 0));
+ dirt();
+ }
+
+@@ -537,10 +537,10 @@
+ int total_x = inter->font->width(st);
+ sx = inter->font->width(st, curpos);
+ if(sx - panx > w-8) {
+- panx = min(panx + (w>>2), total_x - (w-8));
++ panx = MIN(panx + (w>>2), total_x - (w-8));
+ }
+ if(sx - panx < 0) {
+- panx = max(0, panx - (w>>2));
++ panx = MAX(0, panx - (w>>2));
+ }
+ inter->font->draw(st, pan, -panx, 0);
+
+--- skelton/common/net.cpp
++++ skelton/common/net.cpp
+@@ -1156,7 +1156,7 @@
+ delete packet;
+ packet=NULL;
+ skelton_msgbox(" bad packet\n ");
+- Word size=min(nb->len(), 128);
++ Word size=MIN(nb->len(), 128);
+ nb->reset();
+ int i;
+ for(i=0; i<size; i++)
+--- skelton/common/res_compress.cpp
++++ skelton/common/res_compress.cpp
+@@ -91,7 +91,7 @@
+
+ void Res_compress::write(const void *b, int nb) {
+ if(write_pos + nb > ressize) {
+- ressize = ressize + max(nb, 16384);
++ ressize = ressize + MAX(nb, 16384);
+ _buf = (Byte *) realloc(_buf, ressize);
+ if(_buf == NULL)
+ (void) new Error("Unable to reallocate buffer (need %i bytes)\n", ressize);
+--- skelton/common/sprite.cpp
++++ skelton/common/sprite.cpp
+@@ -101,7 +101,7 @@
+ tmp = new Bitmap(w, h, rw);
+ res.read((*tmp)[0], rw*h);
+ spr[i] = new Sprite(*tmp, 0, 0, 0);
+- pre_width[i] = max(spr[i]->width - shrink, 3);
++ pre_width[i] = MAX(spr[i]->width - shrink, 3);
+ delete tmp;
+ } else {
+ spr[i] = NULL;
+--- skelton/include/array.h
++++ skelton/include/array.h
+@@ -23,11 +23,11 @@
+ #include <vector>
+ #include <algorithm>
+
+-#ifndef max
+-#define max(a,b) (((a) > (b)) ? (a) : (b))
++#ifndef MAX
++#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+ #endif
+-#ifndef min
+-#define min(a,b) (((a) < (b)) ? (a) : (b))
++#ifndef MIN
++#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+ #endif
+
+ template <class T>
+--- skelton/include/types.h
++++ skelton/include/types.h
+@@ -21,11 +21,11 @@
+ #ifndef _HEADER_TYPES
+ #define _HEADER_TYPES
+
+-#ifndef max
+-#define max(a,b) (((a) > (b)) ? (a) : (b))
++#ifndef MAX
++#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+ #endif
+-#ifndef min
+-#define min(a,b) (((a) < (b)) ? (a) : (b))
++#ifndef MIN
++#define MIN(a,b) (((a) < (b)) ? (a) : (b))
+ #endif
+
+ #ifndef NULL
+--- source/canvas.cpp
++++ source/canvas.cpp
+@@ -387,7 +387,7 @@
+ bflash[y][x]=32;
+ dirted[y][x]=2;
+ }
+- tmp=min(255, tmp+time);
++ tmp=MIN(255, tmp+time);
+ blinded[y][x] = tmp;
+ }
+ }
+@@ -434,7 +434,7 @@
+ if(nb+bonus > 20)
+ nb = 20-bonus;
+ nc--;
+- int normal = max(nb - nc, 0);
++ int normal = MAX(nb - nc, 0);
+ int fucked = nb - normal;
+ if(game->net_version()>=23) {
+ for(x=0; x<nb; x++) {
+@@ -540,7 +540,7 @@
+ alive_count-=4;
+ else
+ alive_count=0;
+- i = max(0, depth-1-alive_count);
++ i = MAX(0, depth-1-alive_count);
+ // this is a bug, it should have been done like net_version >= 24 (below)
+ // but it must remain as is for network compatibility
+ enough=i? true:false;
+@@ -864,10 +864,10 @@
+ h1 = (y1+h1+17)/18;
+ x1 = x1/18;
+ y1 = y1/18;
+- x1 = max(0,x1);
+- y1 = max(0,y1);
+- w1 = min(10,w1);
+- h1 = min(20,h1);
++ x1 = MAX(0,x1);
++ y1 = MAX(0,y1);
++ w1 = MIN(10,w1);
++ h1 = MIN(20,h1);
+ for(j=y1; j<h1; j++)
+ for(i=x1; i<w1; i++)
+ dirted[j+12][i+4]=2;
+--- source/quadra.cpp
++++ source/quadra.cpp
+@@ -970,8 +970,8 @@
+ p.y=canvas->bloc->by;
+ p.player=canvas->num_player;
+ if(game->net_version()<23) {
+- i = max(overmind.framecount - canvas->frame_start - 50, 0);
+- p.score=max(0, 100 - i) >> 1;
++ i = MAX(overmind.framecount - canvas->frame_start - 50, 0);
++ p.score=MAX(0, 100 - i) >> 1;
+ }
+ else
+ p.score=0;
+@@ -1621,7 +1621,7 @@
+ }
+
+ // adjust handicap_crowd considering crowdedness of the game (i.e. number of players alive)
+- int max_handicap_crowd = max(0, int(game->net_list.count_alive())-4);
++ int max_handicap_crowd = MAX(0, int(game->net_list.count_alive())-4);
+ max_handicap_crowd *= Canvas::stamp_per_handicap;
+ if(canvas->handicap_crowd < max_handicap_crowd)
+ ++canvas->handicap_crowd;
+@@ -2049,7 +2049,7 @@
+ if(!strcmp(temp, "blind") || !strcmp(temp, "fullblind")) {
+ if(param) {
+ int p=atoi(param);
+- p=min(max(1, p), 255);
++ p=MIN(MAX(1, p), 255);
+ ret.param=p;
+ }
+ }
+@@ -2077,7 +2077,7 @@
+ res="help_fr.txt"; break;
+ }
+ Res_doze cmdline(res);
+- Dword size = min(sizeof(st)-1, cmdline.size());
++ Dword size = MIN(sizeof(st)-1, cmdline.size());
+ strncpy(st, (char *)cmdline.buf(), size);
+ st[size] = 0;
+ if(video)
+@@ -2090,7 +2090,7 @@
+ Res_dos script(fn);
+ if(script.exist) {
+ //-2 because Stringtable is strange
+- Dword size = min(sizeof(st)-2, script.size());
++ Dword size = MIN(sizeof(st)-2, script.size());
+ strncpy(st, (char *)script.buf(), size);
+ st[size] = 0;
+ Stringtable str((Byte *)st, size);
+@@ -2258,7 +2258,7 @@
+ p.set_preset(PRESET_BLIND);
+ char *temp = command_get_param("blind <n>", "30");
+ Dword time=atoi(temp);
+- time=min(max(time, 0), 255);
++ time=MIN(MAX(time, 0), 255);
+ p.normal_attack.param=time;
+ p.clean_attack.param=time;
+ }
+@@ -2266,7 +2266,7 @@
+ p.set_preset(PRESET_FULLBLIND);
+ char *temp = command_get_param("fullblind <n>", "12");
+ Dword time=atoi(temp);
+- time=min(max(time, 0), 255);
++ time=MIN(MAX(time, 0), 255);
+ p.normal_attack.param=time;
+ p.clean_attack.param=time;
+ }
+@@ -2293,7 +2293,7 @@
+ if(command.token("level")) {
+ char *temp = command_get_param("level <level number>");
+ p.level_start = atoi(temp);
+- p.level_start = min(max(p.level_start, 1), 40);
++ p.level_start = MIN(MAX(p.level_start, 1), 40);
+ }
+ if(command.token("name")) {
+ char *temp = command_get_param("name <game name>");
+@@ -2315,7 +2315,7 @@
+ if(p.game_end != END_NEVER) {
+ char *temp = command_get_param("endfrag/endtime/endpoints <number>");
+ p.game_end_value = atoi(temp);
+- p.game_end_value = min(max(p.game_end_value, 1), p.game_end<=END_TIME? 9999:99999);
++ p.game_end_value = MIN(MAX(p.game_end_value, 1), p.game_end<=END_TIME? 9999:99999);
+ }
+ if(command.token("public"))
+ p.game_public = true;
diff --git a/games-puzzle/quadra/quadra-1.1.8.ebuild b/games-puzzle/quadra/quadra-1.1.8.ebuild
index bc7c43a67245..dc045023c0a1 100644
--- a/games-puzzle/quadra/quadra-1.1.8.ebuild
+++ b/games-puzzle/quadra/quadra-1.1.8.ebuild
@@ -1,8 +1,8 @@
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/games-puzzle/quadra/quadra-1.1.8.ebuild,v 1.15 2006/12/06 17:18:47 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/games-puzzle/quadra/quadra-1.1.8.ebuild,v 1.16 2007/07/06 22:18:36 nyhm Exp $
-inherit eutils toolchain-funcs games
+inherit eutils games
DESCRIPTION="A tetris clone with multiplayer support"
HOMEPAGE="http://quadra.sourceforge.net/"
@@ -22,9 +22,11 @@ DEPEND="${RDEPEND}
src_unpack() {
unpack ${A}
cd "${S}"
- [ $(gcc-major-version) -ge 3 ] && epatch "${FILESDIR}/${P}-gcc3.patch"
- epatch "${FILESDIR}/libpng-1.2.5.patch"
- use amd64 && epatch "${FILESDIR}/${P}-amd64.patch"
+ epatch \
+ "${FILESDIR}"/${P}-gcc3.patch \
+ "${FILESDIR}"/libpng-1.2.5.patch \
+ "${FILESDIR}"/${P}-amd64.patch \
+ "${FILESDIR}"/${P}-gcc42.patch
sed -i \
-e 's:-pedantic::' config/vars.mk \
|| die "sed config/vars.mk failed"
@@ -50,9 +52,9 @@ src_compile() {
src_install() {
dogamesbin ${PN}
if use svga; then
- dogameslib.so ${PN}-svga.so
+ dogameslib.so ${PN}-svga.so || die "dogameslib.so failed"
fi
- insinto ${GAMES_DATADIR}/${PN}
+ insinto "${GAMES_DATADIR}"/${PN}
doins ${PN}.res
doicon images/${PN}.xpm
make_desktop_entry ${PN} "Quadra" ${PN}.xpm