commit:     38c49856cf85f12c1ea9c8ad4ab52bc0582568a6
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  4 23:24:53 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb  4 23:36:58 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38c49856

games-arcade/ri-li: EAPI 8, fix build w/ gcc 11

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

 games-arcade/ri-li/files/ri-li-2.0.1-gcc11.patch   | 47 ++++++++++++++++++++++
 ...ri-li-2.0.1-r1.ebuild => ri-li-2.0.1-r2.ebuild} | 25 +++++++-----
 2 files changed, 63 insertions(+), 9 deletions(-)

diff --git a/games-arcade/ri-li/files/ri-li-2.0.1-gcc11.patch 
b/games-arcade/ri-li/files/ri-li-2.0.1-gcc11.patch
new file mode 100644
index 000000000000..e465978789e1
--- /dev/null
+++ b/games-arcade/ri-li/files/ri-li-2.0.1-gcc11.patch
@@ -0,0 +1,47 @@
+https://bugs.gentoo.org/811501
+https://sourceforge.net/p/ri-li/bugs/2/
+
+From 317a80608a061a0acdf196a6c148bfe63b1eaad5 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <[email protected]>
+Date: Thu, 21 Apr 2022 07:52:46 +0100
+Subject: [PATCH] Fix build on gcc-11
+
+Without the change build fails on ordered comparison on pointers:
+
+tableau.cc:90:9: error: ordered comparison of pointer with integer zero 
('unsigned char*' and 'int')
+   90 |   if(Buf<=0) return false;
+      |      ~~~^~~
+--- a/src/sprite.cc
++++ b/src/sprite.cc
+@@ -351,7 +351,7 @@ bool Sprite::Load(unsigned char *Buf,long &P)
+     // Fabrique la surface
+     
Image[i]=SDL_CreateRGBSurface((Dim[i].bpp-3)*SDL_SRCALPHA,Dim[i].L,Dim[i].H,Dim[i].bpp*8,
+                                 
0xff,0xff00,0xff0000,0xff000000*(Dim[i].bpp-3));
+-    if(Image[i]<=NULL) {
++    if(Image[i]==NULL) {
+       std::cerr <<"Impossible de cr�er une Surface SDL!"<<std::endl;
+       return false;
+     }
+@@ -485,7 +485,7 @@ bool Sprite::Nouveau(int Lx,int Ly)
+   // Fabrique la surface
+   
Image[0]=SDL_CreateRGBSurface((Dim[0].bpp-3)*SDL_SRCALPHA,Dim[0].L,Dim[0].H,Dim[0].bpp*8,
+                               0xff,0xff00,0xff0000,0xff000000*(Dim[0].bpp-3));
+-  if(Image[0]<=NULL) {
++  if(Image[0]==NULL) {
+     std::cerr <<"Impossible de cr�er une Surface SDL!"<<std::endl;
+     return false;
+   }
+--- a/src/tableau.cc
++++ b/src/tableau.cc
+@@ -87,7 +87,7 @@ bool Tableau::Save(void)
+   
+   // Alloue la m�moire
+   Buf=new unsigned char [sizeof(s_Tableau)*N+sizeof(int)+1];
+-  if(Buf<=0) return false;
++  if(Buf==NULL) return false;
+ 
+   // Charge les tableaux
+   Buf[0]=N/256;
+-- 
+2.35.1
+

diff --git a/games-arcade/ri-li/ri-li-2.0.1-r1.ebuild 
b/games-arcade/ri-li/ri-li-2.0.1-r2.ebuild
similarity index 66%
rename from games-arcade/ri-li/ri-li-2.0.1-r1.ebuild
rename to games-arcade/ri-li/ri-li-2.0.1-r2.ebuild
index 1a80ceb4ad1c..10ddfd65cb9a 100644
--- a/games-arcade/ri-li/ri-li-2.0.1-r1.ebuild
+++ b/games-arcade/ri-li/ri-li-2.0.1-r2.ebuild
@@ -1,36 +1,43 @@
 # Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=8
 
 inherit autotools desktop
 
 DESCRIPTION="Drive a toy wood engine and collect all the coaches"
 HOMEPAGE="https://ri-li.sourceforge.net/";
 SRC_URI="mirror://sourceforge/ri-li/Ri-li-${PV}.tar.bz2"
+S="${WORKDIR}/Ri-li-${PV}"
 
 LICENSE="GPL-3"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE=""
 
-DEPEND="media-libs/libsdl[sound,video]
-       media-libs/sdl-mixer[mod]"
+DEPEND="
+       media-libs/libsdl[sound,video]
+       media-libs/sdl-mixer[mod]
+"
 RDEPEND="${DEPEND}"
 
-S="${WORKDIR}/Ri-li-${PV}"
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.0.1-gcc43.patch
+       "${FILESDIR}"/${PN}-2.0.1-gcc11.patch
+)
 
 src_prepare() {
        default
-       eapply "${FILESDIR}"/${P}-gcc43.patch
-       mv configure.{in,ac}
-       rm aclocal.m4
+
+       mv configure.{in,ac} || die
+       rm aclocal.m4 || die
        eautoreconf
 }
 
 src_install() {
        default
-       rm -f "${ED}/usr/share/Ri-li/"*ebuild
+
+       rm -f "${ED}/usr/share/Ri-li/"*ebuild || die
+
        newicon data/Ri-li-icon-48x48.png ${PN}.png
        make_desktop_entry Ri_li Ri-li
 }

Reply via email to