Gentoo Archives: gentoo-commits

From: Ronny Gutbrod <gentoo@××××××××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: games-action/blackvoxel/files/, games-action/blackvoxel/
Date: Mon, 03 May 2021 01:29:59
Message-Id: 1620005220.e2ea6e4b2f789206d798e4f909b21dc6d8c6dfa1.tastytea@gentoo
1 commit: e2ea6e4b2f789206d798e4f909b21dc6d8c6dfa1
2 Author: Ronny (tastytea) Gutbrod <gentoo <AT> tastytea <DOT> de>
3 AuthorDate: Mon May 3 00:19:00 2021 +0000
4 Commit: Ronny Gutbrod <gentoo <AT> tastytea <DOT> de>
5 CommitDate: Mon May 3 01:27:00 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=e2ea6e4b
7
8 games-action/blackvoxel: Remove hardcoded tools, set CXX, CC and AR.
9
10 Changes proposed upstream:
11 <https://github.com/Blackvoxel/Blackvoxel/pull/35>.
12
13 Closes: https://bugs.gentoo.org/787074
14 Signed-off-by: Ronny (tastytea) Gutbrod <gentoo <AT> tastytea.de>
15
16 games-action/blackvoxel/blackvoxel-2.42.ebuild | 8 +-
17 .../files/blackvoxel-2.42-makefile.patch | 179 +++++++++++++++++++--
18 2 files changed, 172 insertions(+), 15 deletions(-)
19
20 diff --git a/games-action/blackvoxel/blackvoxel-2.42.ebuild b/games-action/blackvoxel/blackvoxel-2.42.ebuild
21 index aac110c09..8c2a6db25 100644
22 --- a/games-action/blackvoxel/blackvoxel-2.42.ebuild
23 +++ b/games-action/blackvoxel/blackvoxel-2.42.ebuild
24 @@ -1,9 +1,9 @@
25 -# Copyright 2020 Gentoo Authors
26 +# Copyright 2020-2021 Gentoo Authors
27 # Distributed under the terms of the GNU General Public License v2
28
29 EAPI=7
30
31 -inherit desktop xdg
32 +inherit desktop toolchain-funcs xdg
33
34 DESCRIPTION="Blackvoxel Video Game"
35 HOMEPAGE="https://www.blackvoxel.com/"
36 @@ -32,6 +32,10 @@ PATCHES=(
37 )
38
39 src_compile() {
40 + export CXX="$(tc-getCXX)"
41 + export CC="$(tc-getCC)"
42 + export AR="$(tc-getAR)"
43 +
44 emake blackvoxeldatadir="/usr/share/${PN}" bindir="/usr/bin"
45 }
46
47
48 diff --git a/games-action/blackvoxel/files/blackvoxel-2.42-makefile.patch b/games-action/blackvoxel/files/blackvoxel-2.42-makefile.patch
49 index c8e826c68..f6f857212 100644
50 --- a/games-action/blackvoxel/files/blackvoxel-2.42-makefile.patch
51 +++ b/games-action/blackvoxel/files/blackvoxel-2.42-makefile.patch
52 @@ -1,30 +1,183 @@
53 +From a4fbc416e1c9884353f743f84ca98207f792b502 Mon Sep 17 00:00:00 2001
54 +From: tastytea <tastytea@××××××××.de>
55 +Date: Mon, 3 May 2021 02:26:12 +0200
56 +Subject: [PATCH] Don't overwrite build-flags, replace hardcoded tools with
57 + variables.
58 +
59 +---
60 + Makefile | 29 ++++++++++++++---------------
61 + src/sc_Squirrel3/sq/Makefile | 8 ++++----
62 + src/sc_Squirrel3/sqstdlib/Makefile | 16 ++++++++--------
63 + src/sc_Squirrel3/squirrel/Makefile | 16 ++++++++--------
64 + 4 files changed, 34 insertions(+), 35 deletions(-)
65 +
66 +diff --git a/Makefile b/Makefile
67 +index 3fac7f3..a85dd7e 100644
68 --- a/Makefile
69 +++ b/Makefile
70 -@@ -11,7 +11,7 @@
71 - CC=g++
72 - LD=g++
73 +@@ -8,10 +8,9 @@ ifndef bindir
74 + endif
75 +
76 + # Base options
77 +-CC=g++
78 +-LD=g++
79 ++CXX?=g++
80 PROGNAME=blackvoxel
81 -CFLAGS=-I "src/sc_Squirrel3/include" -DCOMPILEOPTION_DEMO=0 -DDEVELOPPEMENT_ON=0 -DCOMPILEOPTION_SPECIAL=0 -DCOMPILEOPTION_DATAFILESPATH="\"$(blackvoxeldatadir)\""
82 -+CFLAGS+=-I "src/sc_Squirrel3/include" -DCOMPILEOPTION_DEMO=0 -DDEVELOPPEMENT_ON=0 -DCOMPILEOPTION_SPECIAL=0 -DCOMPILEOPTION_DATAFILESPATH="\"$(blackvoxeldatadir)\""
83 ++CXXFLAGS+=-I "src/sc_Squirrel3/include" -DCOMPILEOPTION_DEMO=0 -DDEVELOPPEMENT_ON=0 -DCOMPILEOPTION_SPECIAL=0 -DCOMPILEOPTION_DATAFILESPATH="\"$(blackvoxeldatadir)\""
84 SRC= $(wildcard src/*.cpp) $(wildcard src/z/*.cpp)
85 OBJ= $(SRC:src/%.cpp=obj/%.o)
86
87 -@@ -28,8 +28,7 @@
88 +@@ -19,8 +18,8 @@ OBJ= $(SRC:src/%.cpp=obj/%.o)
89 +
90 + ifeq ($(OS),Windows_NT)
91 + CPU_BITS=32
92 +- CFLAGS+= -O3 -c -fmessage-length=0 -march=i686
93 +- LDFLAGS= -s -Xlinker --large-address-aware -mwindows -L"src/sc_Squirrel3/lib" -lmingw32 -lSDLmain -lSDL -llibglew32 -lglu32 -lopengl32 -llibglut -lsquirrel -lsqstdlib
94 ++ CXXFLAGS+= -O3 -c -fmessage-length=0 -march=i686
95 ++ LDFLAGS+= -s -Xlinker --large-address-aware -mwindows -L"src/sc_Squirrel3/lib" -lmingw32 -lSDLmain -lSDL -llibglew32 -lglu32 -lopengl32 -llibglut -lsquirrel -lsqstdlib
96 + else
97 + # Unix like operating systems
98 + CPU_BITS= $(shell getconf LONG_BIT)
99 +@@ -28,31 +27,31 @@ else
100 KERNELNAME =$(shell uname -s)
101
102 ifeq ($(KERNELNAME),Linux)
103 - CFLAGS+= -O3 -c -fmessage-length=0
104 - LDFLAGS=-s -zrelro -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
105 -+ LDFLAGS+= -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
106 ++ CXXFLAGS+= -O3 -c -fmessage-length=0
107 ++ LDFLAGS+=-s -zrelro -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
108 else ifeq ($(KERNELNAME), FreeBSD)
109 # To be done...
110 - CFLAGS+= -O3 -c -fmessage-length=0
111 -@@ -57,7 +56,7 @@
112 +- CFLAGS+= -O3 -c -fmessage-length=0
113 +- LDFLAGS=-s -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
114 ++ CXXFLAGS+= -O3 -c -fmessage-length=0
115 ++ LDFLAGS+=-s -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
116 + else ifeq ($(KERNELNAME), Darwin)
117 +- CFLAGS+= -O3 -c -fmessage-length=0
118 +- LDFLAGS=-s -L"src/sc_Squirrel3/lib" -L"/usr/local/Cellar/glew" -L"/usr/local/Cellar/sdl" -I"/usr/local/Cellar/glew" -I"/usr/local/Cellar/sdl" -framework Cocoa -framework OpenGL -lSDLmain -lSDL -lGLEW -lsquirrel -lsqstdlib
119 ++ CXXFLAGS+= -O3 -c -fmessage-length=0
120 ++ LDFLAGS+=-s -L"src/sc_Squirrel3/lib" -L"/usr/local/Cellar/glew" -L"/usr/local/Cellar/sdl" -I"/usr/local/Cellar/glew" -I"/usr/local/Cellar/sdl" -framework Cocoa -framework OpenGL -lSDLmain -lSDL -lGLEW -lsquirrel -lsqstdlib
121 + else
122 + # Unknow kernel... trying default flags
123 +- CFLAGS+= -O3 -c -fmessage-length=0
124 +- LDFLAGS=-s -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
125 ++ CXXFLAGS+= -O3 -c -fmessage-length=0
126 ++ LDFLAGS+=-s -L"src/sc_Squirrel3/lib" -lGLU -lSDL -lGLEW -lGL -lsquirrel -lsqstdlib
127 + endif
128 + endif
129 +
130 +
131 + obj/%.o: src/%.cpp
132 + @mkdir -p obj/z
133 +- $(CC) -o $@ -c $< $(CFLAGS)
134 ++ $(CXX) -o $@ -c $< $(CXXFLAGS)
135 +
136 + all: $(PROGNAME)
137 +
138 + $(PROGNAME): $(OBJ) squirrel
139 +- $(LD) -o $(PROGNAME) $(OBJ) $(LDFLAGS)
140 ++ $(CXX) -o $(PROGNAME) $(OBJ) $(LDFLAGS)
141
142
143 - squirrel:
144 -- cd src/sc_Squirrel3 ; make sq$(CPU_BITS)
145 -+ +make -C src/sc_Squirrel3 sq$(CPU_BITS)
146
147 - clean:
148 - @rm -rf obj
149 +diff --git a/src/sc_Squirrel3/sq/Makefile b/src/sc_Squirrel3/sq/Makefile
150 +index c2cfc7e..08fb2ef 100644
151 +--- a/src/sc_Squirrel3/sq/Makefile
152 ++++ b/src/sc_Squirrel3/sq/Makefile
153 +@@ -12,16 +12,16 @@ SRCS= sq.c
154 +
155 +
156 + sq32:
157 +- g++ -O2 -s -fno-exceptions -fno-rtti -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
158 ++ $(CXX) -O2 -s -fno-exceptions -fno-rtti -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
159 +
160 + sqprof:
161 +- g++ -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
162 ++ $(CXX) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
163 +
164 + sq64:
165 +- g++ -O2 -s -m64 -fno-exceptions -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
166 ++ $(CXX) -O2 -s -m64 -fno-exceptions -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
167 +
168 + sq64d:
169 +- g++ -O0 -g3 -m64 -fno-exceptions -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
170 ++ $(CXX) -O0 -g3 -m64 -fno-exceptions -fno-rtti -D_SQ64 -o $(OUT) $(SRCS) $(INCZ) $(LIBZ) $(LIB)
171 +
172 + .PHONY: clean mrproper
173 +
174 +diff --git a/src/sc_Squirrel3/sqstdlib/Makefile b/src/sc_Squirrel3/sqstdlib/Makefile
175 +index 643d7fc..41ee3f7 100644
176 +--- a/src/sc_Squirrel3/sqstdlib/Makefile
177 ++++ b/src/sc_Squirrel3/sqstdlib/Makefile
178 +@@ -26,23 +26,23 @@ SRCS= \
179 +
180 +
181 + sq32:
182 +- gcc -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
183 +- ar rc $(OUT) *.o
184 ++ $(CC) -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
185 ++ $(AR) rc $(OUT) *.o
186 + rm *.o
187 +
188 + sqprof:
189 +- gcc -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
190 +- ar rc $(OUT) *.o
191 ++ $(CC) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
192 ++ $(AR) rc $(OUT) *.o
193 + rm *.o
194 +
195 + sq64:
196 +- gcc -O2 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
197 +- ar rc $(OUT) *.o
198 ++ $(CC) -O2 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
199 ++ $(AR) rc $(OUT) *.o
200 + rm *.o
201 +
202 + sq64d:
203 +- gcc -O0 -g3 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
204 +- ar rc $(OUT) *.o
205 ++ $(CC) -O0 -g3 -m64 -fno-exceptions -D_SQ64 -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ)
206 ++ $(AR) rc $(OUT) *.o
207 +
208 + .PHONY: clean mrproper
209 +
210 +diff --git a/src/sc_Squirrel3/squirrel/Makefile b/src/sc_Squirrel3/squirrel/Makefile
211 +index b03257b..be2c281 100644
212 +--- a/src/sc_Squirrel3/squirrel/Makefile
213 ++++ b/src/sc_Squirrel3/squirrel/Makefile
214 +@@ -37,23 +37,23 @@ SRCS= \
215 +
216 +
217 + sq32:
218 +- gcc -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
219 +- ar rc $(OUT) *.o
220 ++ $(CC) -O2 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
221 ++ $(AR) rc $(OUT) *.o
222 + rm *.o
223 +
224 + sqprof:
225 +- gcc -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
226 +- ar rc $(OUT) *.o
227 ++ $(CC) -O2 -pg -fno-exceptions -fno-rtti -pie -gstabs -g3 -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
228 ++ $(AR) rc $(OUT) *.o
229 + rm *.o
230 +
231 + sq64:
232 +- gcc -O2 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
233 +- ar rc $(OUT) *.o
234 ++ $(CC) -O2 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
235 ++ $(AR) rc $(OUT) *.o
236 + rm *.o
237 +
238 + sq64d:
239 +- gcc -O0 -g3 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
240 +- ar rc $(OUT) *.o
241 ++ $(CC) -O0 -g3 -m64 -D_SQ64 -fno-exceptions -fno-rtti -Wall -fno-strict-aliasing -c $(SRCS) $(INCZ) $(DEFS)
242 ++ $(AR) rc $(OUT) *.o
243 +
244 + .PHONY: clean mrproper
245 +
246 +--
247 +2.26.3
248 +