commit:     b7deab8b7bc7d1579ee883d855a1cbcd0627b787
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 28 19:32:05 2021 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue Sep 28 19:36:27 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7deab8b

games-puzzle/fbg: EAPI6->8, fix runtime

Haven't tried with it, but this likely been
broken since gcc-8 or so.

Also added --without-x so it doesn't try to
link with libXt that it does not actually use.

Closes: https://bugs.gentoo.org/815259
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../fbg/{fbg-0.9-r2.ebuild => fbg-0.9-r3.ebuild}   | 36 +++++++++++++---------
 .../fbg/files/fbg-0.9-missing-return.patch         |  8 +++++
 2 files changed, 29 insertions(+), 15 deletions(-)

diff --git a/games-puzzle/fbg/fbg-0.9-r2.ebuild 
b/games-puzzle/fbg/fbg-0.9-r3.ebuild
similarity index 52%
rename from games-puzzle/fbg/fbg-0.9-r2.ebuild
rename to games-puzzle/fbg/fbg-0.9-r3.ebuild
index b0c84fa8eec..5da0c050885 100644
--- a/games-puzzle/fbg/fbg-0.9-r2.ebuild
+++ b/games-puzzle/fbg/fbg-0.9-r3.ebuild
@@ -1,41 +1,47 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=8
+
 inherit desktop
 
-DESCRIPTION="A Tetris clone written in OpenGL"
+DESCRIPTION="Tetris clone written in OpenGL"
 HOMEPAGE="http://fbg.sourceforge.net/";
 SRC_URI="mirror://sourceforge/fbg/${P}.tar.gz"
 
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE=""
 
-DEPEND="virtual/opengl
-       virtual/glu
+RDEPEND="
        dev-games/physfs
-       media-libs/libsdl[opengl,video]
        media-libs/libmikmod
-       x11-libs/libXt"
-RDEPEND="${DEPEND}"
+       media-libs/libsdl[opengl,video]
+       virtual/glu
+       virtual/opengl"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-missing-return.patch
+)
 
 src_prepare() {
        default
-       sed -i \
-               -e "/FBGDATADIR=/s:\".*\":\"/usr/share/${PN}\":" \
+
+       sed -e "/FBGDATADIR=/s|=.*|=\"${EPREFIX}/usr/share/${PN}\"|" \
                -e '/^datadir=/d' \
-               configure || die
+               -i configure || die
 }
 
 src_configure() {
-       econf --disable-fbglaunch
+       econf --disable-fbglaunch --without-x
 }
 
 src_install() {
        default
+
        newicon startfbg/icon.xpm ${PN}.xpm
-       make_desktop_entry ${PN} "Falling Block Game" ${PN}
-       rm -rf "${ED}/usr/doc"
+       make_desktop_entry ${PN} "Falling Block Game"
+
+       rm -r "${ED}"/usr/doc || die
 }

diff --git a/games-puzzle/fbg/files/fbg-0.9-missing-return.patch 
b/games-puzzle/fbg/files/fbg-0.9-missing-return.patch
new file mode 100644
index 00000000000..86b0b551957
--- /dev/null
+++ b/games-puzzle/fbg/files/fbg-0.9-missing-return.patch
@@ -0,0 +1,8 @@
+Lack of return leads to segmentation fault on startup.
+https://bugs.gentoo.org/815259
+--- a/src/glTGAImage.cc
++++ b/src/glTGAImage.cc
+@@ -180,2 +180,3 @@
+       glTexImage2D(GL_TEXTURE_2D, 0, type, getWidth(), getHeight(), 0, type, 
GL_UNSIGNED_BYTE, getImageData());
++      return true;
+ }

Reply via email to