commit:     ea52f2f2b1535f5a93289fb2c81110ba5c9fe4a2
Author:     Brahmajit Das <brahmajit.xyz <AT> gmail <DOT> com>
AuthorDate: Tue Oct  3 19:17:45 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 11 23:37:49 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea52f2f2

games-fps/blackshades: Fix C++17 does not allow register storage class

And update EAPI 7 -> 8 and HOMEPAGE

Closes: https://bugs.gentoo.org/895978
Signed-off-by: Brahmajit Das <brahmajit.xyz <AT> gmail.com>
Signed-off-by: Brahmajit Das <listout <AT> listout.xyz>
Part-of: https://github.com/gentoo/gentoo/pull/33172
Closes: https://github.com/gentoo/gentoo/pull/33172
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../blackshades/blackshades-20070723-r2.ebuild     | 77 ++++++++++++++++++++++
 .../blackshades-20070723-clang16-build-fix.patch   | 77 ++++++++++++++++++++++
 2 files changed, 154 insertions(+)

diff --git a/games-fps/blackshades/blackshades-20070723-r2.ebuild 
b/games-fps/blackshades/blackshades-20070723-r2.ebuild
new file mode 100644
index 000000000000..d16db8e042ab
--- /dev/null
+++ b/games-fps/blackshades/blackshades-20070723-r2.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit desktop toolchain-funcs
+
+DESCRIPTION="You control a psychic bodyguard, and try to protect the VIP"
+HOMEPAGE="https://www.wolfire.com/black-shades/
+       https://www.icculus.org/blackshades/";
+SRC_URI="http://filesingularity.timedoctor.org/Textures.tar.bz2
+       mirror://gentoo/${P}.tar.bz2"
+S="${WORKDIR}"/${PN}
+
+LICENSE="blackshades"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="
+       media-libs/freealut
+       media-libs/libsdl
+       media-libs/libvorbis
+       media-libs/openal
+       virtual/glu
+       virtual/opengl"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-datadir.patch
+       "${FILESDIR}"/${P}-gcc-11.patch
+       "${FILESDIR}"/${P}-clang16-build-fix.patch
+)
+
+src_prepare() {
+       default
+
+       rm -rf Data/Textures || die
+       rm -f ../Textures/{,Blood/}._* || die
+       mv -f ../Textures Data || die "mv failed"
+
+       sed -i \
+               -e "s/-O2 \(-Wall\) -g/${CXXFLAGS} \1/" \
+               -e "/^LINKER/s:$: ${LDFLAGS}:" \
+               Makefile \
+               || die "sed Makefile failed"
+
+       sed -i \
+               -e "s/CC := gcc/CC ?= gcc/" \
+               -e "s/CXX := g++/CXX ?= g++/" \
+               -e "s/LINKER := g++/LINKER ?= g++/" \
+               -e "s/LDFLAGS := /LDFLAGS := ${LDFLAGS} /" \
+               Makefile || die
+
+       sed -i "s:@DATADIR@:/usr/share/${PN}:" \
+               Source/Main.cpp \
+               || die "sed Main.cpp failed"
+}
+
+src_compile() {
+       tc-export CC CXX
+
+       export LINKER="${CXX}"
+
+       emake bindir
+       emake
+}
+
+src_install() {
+       newbin objs/blackshades ${PN}
+
+       insinto /usr/share/${PN}
+       doins -r Data
+
+       dodoc IF_THIS_IS_A_README_YOU_HAVE_WON Readme TODO uDevGame_Readme
+
+       make_desktop_entry ${PN} "Black Shades"
+}

diff --git 
a/games-fps/blackshades/files/blackshades-20070723-clang16-build-fix.patch 
b/games-fps/blackshades/files/blackshades-20070723-clang16-build-fix.patch
new file mode 100644
index 000000000000..a8fec33e0c8b
--- /dev/null
+++ b/games-fps/blackshades/files/blackshades-20070723-clang16-build-fix.patch
@@ -0,0 +1,77 @@
+Bug: https://bugs.gentoo.org/895978
+--- a/Source/GameDraw.cpp
++++ b/Source/GameDraw.cpp
+@@ -765,7 +765,7 @@ int Game::DrawGLScene(void)
+ 
+                               GLfloat LightAmbient[]= { fogcolorr/4, 
fogcolorg/4, fogcolorb/4, 1.0f};
+ 
+-                              GLfloat LightDiffuse[]= { fogcolorr*1.6, 
fogcolorg*1.6, fogcolorr*1.6, 1.0f };
++                              GLfloat LightDiffuse[]= { 
static_cast<GLfloat>(fogcolorr*1.6), static_cast<GLfloat>(fogcolorg*1.6), 
static_cast<GLfloat>(fogcolorr*1.6), 1.0f };
+ 
+                               glLightfv(GL_LIGHT0, GL_AMBIENT, LightAmbient); 
        
+ 
+@@ -775,9 +775,9 @@ int Game::DrawGLScene(void)
+ 
+                       if(environment!=sunny_environment){
+ 
+-                              GLfloat LightAmbient[]= { fogcolorr*.8, 
fogcolorg*.8, fogcolorb*.8, 1.0f};
++                              GLfloat LightAmbient[]= { 
static_cast<GLfloat>(fogcolorr*.8), static_cast<GLfloat>(fogcolorg*.8), 
static_cast<GLfloat>(fogcolorb*.8), 1.0f};
+ 
+-                              GLfloat LightDiffuse[]= { fogcolorr*.8, 
fogcolorg*.8, fogcolorr*.8, 1.0f };
++                              GLfloat LightDiffuse[]= { 
static_cast<GLfloat>(fogcolorr*.8), static_cast<GLfloat>(fogcolorg*.8), 
static_cast<GLfloat>(fogcolorr*.8), 1.0f };
+ 
+                               glLightfv(GL_LIGHT0, GL_AMBIENT, LightAmbient); 
        
+ 
+@@ -809,7 +809,7 @@ int Game::DrawGLScene(void)
+ 
+                       GLfloat LightAmbient[]=         { 0, 0, 0, 1.0f};
+ 
+-                      GLfloat LightDiffuse[]=         { .1+sinefluct/5, 0, 0, 
1.0f };
++                      GLfloat LightDiffuse[]=         { 
static_cast<GLfloat>(.1+sinefluct/5), 0, 0, 1.0f };
+ 
+                       
+ 
+--- a/Source/Maths.cpp
++++ b/Source/Maths.cpp
+@@ -1,7 +1,7 @@
+ /**> HEADER FILES <**/
+ #include "Maths.h"
+ 
+-double fast_sqrt (register double arg)
++double fast_sqrt (double arg)
+ {     
+ #ifdef OS9 
+       // Can replace with slower return std::sqrt(arg);
+--- a/Source/Maths.h
++++ b/Source/Maths.h
+@@ -5,7 +5,7 @@
+ /**> HEADER FILES <**/
+ #include <cmath>
+ 
+-double fast_sqrt (register double arg);
++double fast_sqrt (double arg);
+ 
+ #endif
+ 
+--- a/Source/Quaternions.cpp
++++ b/Source/Quaternions.cpp
+@@ -283,7 +283,7 @@ void Normalise(XYZ *vectory) {
+       vectory->z /= d;
+ }
+ 
+-float fast_sqrt (register float arg)
++float fast_sqrt (float arg)
+ {     
+ #ifdef OS9 
+       // Can replace with slower return std::sqrt(arg);
+--- a/Source/Quaternions.h
++++ b/Source/Quaternions.h
+@@ -69,7 +69,7 @@ XYZ Quat2Vector(quaternion Quat);
+ void CrossProduct(XYZ P, XYZ Q, XYZ *V);
+ void Normalise(XYZ *vectory);
+ float normaldotproduct(XYZ point1, XYZ point2);
+-float fast_sqrt (register float arg);
++float fast_sqrt (float arg);
+ bool PointInTriangle(XYZ *p, XYZ normal, XYZ *p1, XYZ *p2, XYZ *p3);
+ bool LineFacet(XYZ p1,XYZ p2,XYZ pa,XYZ pb,XYZ pc,XYZ *p);
+ float LineFacetd(XYZ p1,XYZ p2,XYZ pa,XYZ pb,XYZ pc,XYZ *p);

Reply via email to