commit:     cd07875957cb5d98b3a47c36721885ce052b8db6
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Apr  4 04:08:51 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Apr  4 06:32:41 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd078759

games-arcade/blockrage: port to EAPI 7, fix build, games.eclass--

Closes: https://bugs.gentoo.org/669598
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...rage-0.2.3.ebuild => blockrage-0.2.3-r1.ebuild} | 23 +++---
 .../blockrage/files/blockrage-0.2.3-config.patch   |  8 +-
 .../blockrage/files/blockrage-0.2.3-statx.patch    | 92 ++++++++++++++++++++++
 3 files changed, 108 insertions(+), 15 deletions(-)

diff --git a/games-arcade/blockrage/blockrage-0.2.3.ebuild 
b/games-arcade/blockrage/blockrage-0.2.3-r1.ebuild
similarity index 58%
rename from games-arcade/blockrage/blockrage-0.2.3.ebuild
rename to games-arcade/blockrage/blockrage-0.2.3-r1.ebuild
index 62aa1d3692a..5e57e04ca85 100644
--- a/games-arcade/blockrage/blockrage-0.2.3.ebuild
+++ b/games-arcade/blockrage/blockrage-0.2.3-r1.ebuild
@@ -1,8 +1,9 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
-inherit eutils games
+EAPI=7
+
+inherit toolchain-funcs
 
 DESCRIPTION="Falling-blocks arcade game with a 2-player hotseat mode"
 HOMEPAGE="http://blockrage.sourceforge.net/";
@@ -11,19 +12,19 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE=""
 
 DEPEND="media-libs/libsdl[video]"
-RDEPEND=${DEPEND}
+RDEPEND="${DEPEND}"
 
-# Removing error due to wrong detection of cross-compile mode
 DOCS=( ChangeLog KNOWN_BUGS README TODO )
 
-src_prepare() {
-       epatch "${FILESDIR}/${P}"-config.patch
-}
+PATCHES=(
+       # Removing error due to wrong detection of cross-compile mode
+       "${FILESDIR}"/${P}-config.patch
+       "${FILESDIR}"/${P}-statx.patch
+)
 
-src_install() {
+src_configure() {
+       tc-export CC
        default
-       prepgamesdirs
 }

diff --git a/games-arcade/blockrage/files/blockrage-0.2.3-config.patch 
b/games-arcade/blockrage/files/blockrage-0.2.3-config.patch
index dc1875fc28e..f1b3e5bde11 100644
--- a/games-arcade/blockrage/files/blockrage-0.2.3-config.patch
+++ b/games-arcade/blockrage/files/blockrage-0.2.3-config.patch
@@ -1,5 +1,5 @@
---- configure
-+++ configure
+--- a/configure
++++ b/configure
 @@ -40,7 +40,7 @@
  SOUND_OPT=
  
@@ -17,8 +17,8 @@
        fi;;
      
      --bindir=*) bindir="$cfg_optarg";;
---- src/Makefile.in
-+++ src/Makefile.in
+--- a/src/Makefile.in
++++ b/src/Makefile.in
 @@ -1,7 +1,7 @@
  OBJS    = main.o gfxout.o gfxlib.o menus.o keyboard.o bg.o sound.o global.o 
timer.o
  

diff --git a/games-arcade/blockrage/files/blockrage-0.2.3-statx.patch 
b/games-arcade/blockrage/files/blockrage-0.2.3-statx.patch
new file mode 100644
index 00000000000..95459e0984e
--- /dev/null
+++ b/games-arcade/blockrage/files/blockrage-0.2.3-statx.patch
@@ -0,0 +1,92 @@
+Thanks-to: samuel.bauer
+https://bugs.gentoo.org/669598
+--- a/src/main.c
++++ b/src/main.c
+@@ -102,7 +102,7 @@
+ 
+ int immedstart;
+ int quit;
+-static int statx[6],staty[6];
++static int stat_x[6],stat_y[6];
+ int diffx,diffy;   /* coordinates of the difficulty level display box */
+ int ts_x0,ts_x1;   /* x-coordinates of the top-ten names(ts_x0) & 
scores(ts_x1) */
+ int no_of_sets;
+@@ -191,14 +191,14 @@
+ 
+ static void game_drawscore(player_t *p, int bgvcpy) {
+   if(bgvcpy) {
+-    v_drawscrarea(bmp_game[players-1].data,statx[1],staty[1],
++    v_drawscrarea(bmp_game[players-1].data,stat_x[1],stat_y[1],
+                 
strpixlen("0000000",FONT_HIGHLIGHTED),font[FONT_HIGHLIGHTED].ch);
+   }
+   t_align=T_LEFT;
+-  v_printf(statx[1],staty[1],FONT_HIGHLIGHTED,"%07d",p->score);
++  v_printf(stat_x[1],stat_y[1],FONT_HIGHLIGHTED,"%07d",p->score);
+   
+   if(bgvcpy) {
+-    virt_cpyarea(statx[1],staty[1],
++    virt_cpyarea(stat_x[1],stat_y[1],
+                
strpixlen("00000000",FONT_HIGHLIGHTED),font[FONT_HIGHLIGHTED].ch);
+   }
+ }
+@@ -206,28 +206,28 @@
+ static void game_drawlevelnum(int bgvcpy) {
+ 
+   if(bgvcpy) {
+-    v_drawscrarea(bmp_game[players-1].data,statx[3],staty[3],
++    v_drawscrarea(bmp_game[players-1].data,stat_x[3],stat_y[3],
+                 strpixlen("00",FONT_HIGHLIGHTED),font[FONT_HIGHLIGHTED].ch);
+   }
+   t_align=T_LEFT;
+-  v_printf(statx[3],staty[3],FONT_HIGHLIGHTED,"%02d",level);
++  v_printf(stat_x[3],stat_y[3],FONT_HIGHLIGHTED,"%02d",level);
+   
+   if(bgvcpy) {
+-    virt_cpyarea(statx[3],staty[3],
++    virt_cpyarea(stat_x[3],stat_y[3],
+                strpixlen("00",FONT_HIGHLIGHTED),font[FONT_HIGHLIGHTED].ch);
+   }
+ }
+ 
+ static void game_drawblocksleft(int bgvcpy) {
+   if(bgvcpy) {
+-    v_drawscrarea(bmp_game[players-1].data,statx[5],staty[5],
++    v_drawscrarea(bmp_game[players-1].data,stat_x[5],stat_y[5],
+                 strpixlen("00",FONT_HIGHLIGHTED),font[FONT_HIGHLIGHTED].ch);
+   }
+   t_align=T_LEFT;
+-  v_printf(statx[5],staty[5],FONT_HIGHLIGHTED,"%02d",blocksleft);
++  v_printf(stat_x[5],stat_y[5],FONT_HIGHLIGHTED,"%02d",blocksleft);
+   
+   if(bgvcpy) {
+-    virt_cpyarea(statx[5],staty[5],
++    virt_cpyarea(stat_x[5],stat_y[5],
+                strpixlen("00",FONT_HIGHLIGHTED),font[FONT_HIGHLIGHTED].ch);
+   }
+ }
+@@ -371,9 +371,9 @@
+ void game_statistics_draw(void) {
+   if(players==1) {
+     t_align=T_LEFT;
+-    v_print(statx[0],staty[0],FONT_NORMAL,"Score:");
+-    v_print(statx[2],staty[2],FONT_NORMAL,"Level:");
+-    v_print(statx[4],staty[4],FONT_NORMAL,"Blocks:");
++    v_print(stat_x[0],stat_y[0],FONT_NORMAL,"Score:");
++    v_print(stat_x[2],stat_y[2],FONT_NORMAL,"Level:");
++    v_print(stat_x[4],stat_y[4],FONT_NORMAL,"Blocks:");
+     game_drawlevelnum(0);
+     game_drawblocksleft(0);
+     game_drawscore(&(player[0]),0);
+@@ -1530,9 +1530,9 @@
+   fscanf(f,"%d %d %d %d %d %d",&nx_x0[0],&nx_y0[0],
+   &nx_x0[1],&nx_y0[1],&nx_x0[2],&nx_y0[2]);
+   
+-  fscanf(f,"%d %d %d %d",&statx[0],&staty[0],&statx[1],&staty[1]);
+-  fscanf(f,"%d %d %d %d",&statx[2],&staty[2],&statx[3],&staty[3]);
+-  fscanf(f,"%d %d %d %d",&statx[4],&staty[4],&statx[5],&staty[5]);
++  fscanf(f,"%d %d %d %d",&stat_x[0],&stat_y[0],&stat_x[1],&stat_y[1]);
++  fscanf(f,"%d %d %d %d",&stat_x[2],&stat_y[2],&stat_x[3],&stat_y[3]);
++  fscanf(f,"%d %d %d %d",&stat_x[4],&stat_y[4],&stat_x[5],&stat_y[5]);
+   
+   fscanf(f,"%d %d",&diffx,&diffy);
+   fscanf(f,"%d %d",&ts_x0,&ts_x1);

Reply via email to