1 |
commit: 55a73a4b84fda8347b3e5afdc83af2b164cef7aa |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 3 09:38:43 2021 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 3 09:38:49 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=55a73a4b |
7 |
|
8 |
games-arcade/sdb: tweak for gcc-11 |
9 |
|
10 |
Reported-by: Toralf Förster |
11 |
Closes: https://bugs.gentoo.org/787710 |
12 |
Package-Manager: Portage-3.0.18, Repoman-3.0.3 |
13 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
14 |
|
15 |
games-arcade/sdb/files/sdb-1.0.2-gcc-11.patch | 45 +++++++++++++++++++++++++++ |
16 |
games-arcade/sdb/sdb-1.0.2-r1.ebuild | 21 ++++++++----- |
17 |
2 files changed, 58 insertions(+), 8 deletions(-) |
18 |
|
19 |
diff --git a/games-arcade/sdb/files/sdb-1.0.2-gcc-11.patch b/games-arcade/sdb/files/sdb-1.0.2-gcc-11.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..f0a20657b90 |
22 |
--- /dev/null |
23 |
+++ b/games-arcade/sdb/files/sdb-1.0.2-gcc-11.patch |
24 |
@@ -0,0 +1,45 @@ |
25 |
+https://bugs.gentoo.org/787710 |
26 |
+--- a/src/md2.h |
27 |
++++ b/src/md2.h |
28 |
+@@ -68,7 +68,7 @@ struct tMaterialInfo |
29 |
+ { |
30 |
+ char strName[255]; |
31 |
+ char strFile[255]; |
32 |
+- byte color[3]; |
33 |
++ sdb_byte color[3]; |
34 |
+ int textureId; |
35 |
+ float uTile; |
36 |
+ float vTile; |
37 |
+@@ -151,8 +151,8 @@ struct tMd2Header |
38 |
+ |
39 |
+ struct tMd2AliasTriangle |
40 |
+ { |
41 |
+- byte vertex[3]; |
42 |
+- byte lightNormalIndex; |
43 |
++ sdb_byte vertex[3]; |
44 |
++ sdb_byte lightNormalIndex; |
45 |
+ }; |
46 |
+ |
47 |
+ struct tMd2Triangle |
48 |
+--- a/src/models.h |
49 |
++++ b/src/models.h |
50 |
+@@ -43,7 +43,7 @@ struct tMaterialInfo |
51 |
+ { |
52 |
+ char strName[255]; // The texture name |
53 |
+ char strFile[255]; // The texture file name (If this is set it's a texture map) |
54 |
+- byte color[3]; // The color of the object (R, G, B) |
55 |
++ sdb_byte color[3]; // The color of the object (R, G, B) |
56 |
+ int texureId; // the texture ID |
57 |
+ float uTile; // u tiling of texture |
58 |
+ float vTile; // v tiling of texture |
59 |
+--- a/src/sdb.h |
60 |
++++ b/src/sdb.h |
61 |
+@@ -175,7 +175,7 @@ using namespace std; |
62 |
+ #define MOUSE_BUTTON_2 -2 |
63 |
+ #define MOUSE_BUTTON_3 -3 |
64 |
+ |
65 |
+-typedef unsigned char byte; |
66 |
++typedef unsigned char sdb_byte; |
67 |
+ |
68 |
+ enum TEXTURE_NAMES { |
69 |
+ // Fonts |
70 |
|
71 |
diff --git a/games-arcade/sdb/sdb-1.0.2-r1.ebuild b/games-arcade/sdb/sdb-1.0.2-r1.ebuild |
72 |
index 155c5d3a4e9..6456cfc460c 100644 |
73 |
--- a/games-arcade/sdb/sdb-1.0.2-r1.ebuild |
74 |
+++ b/games-arcade/sdb/sdb-1.0.2-r1.ebuild |
75 |
@@ -1,8 +1,8 @@ |
76 |
-# Copyright 1999-2018 Gentoo Foundation |
77 |
+# Copyright 1999-2021 Gentoo Authors |
78 |
# Distributed under the terms of the GNU General Public License v2 |
79 |
|
80 |
-EAPI=6 |
81 |
-inherit desktop |
82 |
+EAPI=7 |
83 |
+inherit desktop toolchain-funcs |
84 |
|
85 |
DESCRIPTION="A 2D top-down action game; escape a facility full of walking death machines" |
86 |
HOMEPAGE="http://sdb.gamecreation.org/" |
87 |
@@ -19,6 +19,13 @@ DEPEND="virtual/opengl |
88 |
media-libs/sdl-mixer" |
89 |
RDEPEND="${DEPEND}" |
90 |
|
91 |
+PATCHES=( |
92 |
+ "${FILESDIR}"/${P}-endian.patch |
93 |
+ "${FILESDIR}"/${P}-gcc43.patch |
94 |
+ "${FILESDIR}"/${P}-ldflags.patch |
95 |
+ "${FILESDIR}"/${P}-gcc-11.patch |
96 |
+) |
97 |
+ |
98 |
src_prepare() { |
99 |
default |
100 |
sed -i \ |
101 |
@@ -27,16 +34,14 @@ src_prepare() { |
102 |
-e "s:sprites/:/usr/share/${PN}/sprites/:" \ |
103 |
-e "s:levels/:/usr/share/${PN}/levels/:" \ |
104 |
src/sdb.h src/game.cpp || die "setting game paths" |
105 |
- eapply \ |
106 |
- "${FILESDIR}"/${P}-endian.patch \ |
107 |
- "${FILESDIR}"/${P}-gcc43.patch \ |
108 |
- "${FILESDIR}"/${P}-ldflags.patch |
109 |
} |
110 |
|
111 |
src_compile() { |
112 |
emake \ |
113 |
-C src \ |
114 |
- CXXFLAGS="${CXXFLAGS} $(sdl-config --cflags)" |
115 |
+ CXXFLAGS="${CXXFLAGS} $(sdl-config --cflags)" \ |
116 |
+ CC=$(tc-getCC) \ |
117 |
+ CPP=$(tc-getCXX) |
118 |
} |
119 |
|
120 |
src_install() { |