1 |
commit: 3144840d8387b9c7f8b60c6381ad9c0060878296 |
2 |
Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 6 06:27:56 2022 +0000 |
4 |
Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 6 08:37:54 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3144840d |
7 |
|
8 |
games-roguelike/dwarf-fortress: misc ebuild adjustments |
9 |
|
10 |
No fundamental changes, but some extras for the accumulated PR: |
11 |
- adjust patches (scrubbed, fixed some malformation wrt missing files |
12 |
headers and a blank line, and included right line terminators so |
13 |
sed/dos2unix isn't needed) |
14 |
- added basic icon for .desktop |
15 |
- remove duplicate pkgconfig DEPEND (only needed in BDEPEND) |
16 |
- add missing quotes for dobin's FILESDIR |
17 |
- use prefixify_ro, failed to hprefixify as it did not exist in WORKDIR |
18 |
- move DOC_CONTENTS to src_install and respect variable scope |
19 |
- add libglvnd[X] and glib:2 to RDEPEND (injected by pkg-config) |
20 |
- make libsdl[opengl] unconditional, don't see much worth as optfeature |
21 |
given currently need GL libraries either way |
22 |
(could argue audio may well be unconditional too, but left alone) |
23 |
- add [-minimal] to libsndfile optfeature or it gives confusing |
24 |
"not found" errors |
25 |
- further misc style adjustments |
26 |
|
27 |
Thanks to everyone that worked on this. |
28 |
|
29 |
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org> |
30 |
|
31 |
games-roguelike/dwarf-fortress/Manifest | 1 + |
32 |
.../dwarf-fortress/dwarf-fortress-0.47.05.ebuild | 95 ++++++++++------------ |
33 |
... => dwarf-fortress-0.47.05-missing-cmath.patch} | 11 +-- |
34 |
...=> dwarf-fortress-0.47.05-segfault-fixes.patch} | 65 ++++++--------- |
35 |
4 files changed, 77 insertions(+), 95 deletions(-) |
36 |
|
37 |
diff --git a/games-roguelike/dwarf-fortress/Manifest b/games-roguelike/dwarf-fortress/Manifest |
38 |
index 8b96ead81a7a..84e82c2074f3 100644 |
39 |
--- a/games-roguelike/dwarf-fortress/Manifest |
40 |
+++ b/games-roguelike/dwarf-fortress/Manifest |
41 |
@@ -1,2 +1,3 @@ |
42 |
DIST df_47_05_linux.tar.bz2 12725420 BLAKE2B 80987f05de2db2796a53cc8767ee7aa5c78674dff725efc0dafe07dc4118e56c7814cbf92507fe9b76a385e182405c7d6759cb6bcc942385110df1dc1a3b3af4 SHA512 9ea46fa12a80266cd09363f1aea8cdd059a5ebeefb453c4a46ffbb1115486409003c3caca95a1b6010da4040d04b781182c59e57a6cc033cd7de4507299f7534 |
43 |
DIST df_47_05_linux32.tar.bz2 13487455 BLAKE2B be604dd2fd480c5609da801013dfdae26964760c0a92c4b3d2d8369800eee7ca9c1b1c2313cc67357feee3c6d425bf7f9f67cab53d2e771ab59055bc4c3329d0 SHA512 e9b9cf6995c24b403347159a35cfe4b57603bdb777c78639beb2799d9bf31317edec54fb92b17dbb90df6001b905d43285a35e9446768d12a746492b2fd34fe7 |
44 |
+DIST dwarf-fortress.png 271 BLAKE2B cbc14917de1556b25d3817298215beedc4cb01075b8454e38b2d314bdf22f8c20c4bf2332f0d731c7e4c6d6a60056361565221ce3db2c7a15fdf934bff01df54 SHA512 08bdc0e084f861b6e6a8b12e3bc93b9703f2a4cbc133d62d1c2931daf81ccd70b728853d5c05bed19a1ef477cf4ad10fce263bbab7d9cad3b60658f17063acf6 |
45 |
|
46 |
diff --git a/games-roguelike/dwarf-fortress/dwarf-fortress-0.47.05.ebuild b/games-roguelike/dwarf-fortress/dwarf-fortress-0.47.05.ebuild |
47 |
index 8df73a95939f..e94ca7db6dd6 100644 |
48 |
--- a/games-roguelike/dwarf-fortress/dwarf-fortress-0.47.05.ebuild |
49 |
+++ b/games-roguelike/dwarf-fortress/dwarf-fortress-0.47.05.ebuild |
50 |
@@ -3,95 +3,90 @@ |
51 |
|
52 |
EAPI=8 |
53 |
|
54 |
-inherit prefix optfeature toolchain-funcs desktop readme.gentoo-r1 |
55 |
+inherit desktop flag-o-matic optfeature prefix readme.gentoo-r1 toolchain-funcs |
56 |
|
57 |
-MY_PV=$(ver_rs 1- _ "$(ver_cut 2-)") |
58 |
-MY_P=df_${MY_PV} |
59 |
+MY_P="df_$(ver_rs 1- _ $(ver_cut 2-))" |
60 |
|
61 |
-DESCRIPTION="A single-player fantasy game" |
62 |
-HOMEPAGE="https://www.bay12games.com/dwarves" |
63 |
-SRC_URI="amd64? ( https://www.bay12games.com/dwarves/${MY_P}_linux.tar.bz2 ) |
64 |
- x86? ( https://www.bay12games.com/dwarves/${MY_P}_linux32.tar.bz2 )" |
65 |
-S="${WORKDIR}"/df_linux |
66 |
- |
67 |
-PATCHES=( |
68 |
- "${FILESDIR}/${P}-fix-cmath.patch" |
69 |
- "${FILESDIR}/${P}-segfault-fix-729002.patch" |
70 |
-) |
71 |
+DESCRIPTION="Single-player fantasy game" |
72 |
+HOMEPAGE="https://www.bay12games.com/dwarves/" |
73 |
+SRC_URI=" |
74 |
+ amd64? ( https://www.bay12games.com/dwarves/${MY_P}_linux.tar.bz2 ) |
75 |
+ x86? ( https://www.bay12games.com/dwarves/${MY_P}_linux32.tar.bz2 ) |
76 |
+ https://dev.gentoo.org/~ionen/distfiles/${PN}.png" |
77 |
+S="${WORKDIR}/df_linux" |
78 |
|
79 |
LICENSE="free-noncomm BSD BitstreamVera" |
80 |
SLOT="0" |
81 |
KEYWORDS="-* ~amd64 ~x86" |
82 |
IUSE="debug" |
83 |
|
84 |
-RDEPEND="media-libs/glew:0= |
85 |
- media-libs/libsdl[joystick,video] |
86 |
+RDEPEND=" |
87 |
+ dev-libs/glib:2 |
88 |
+ media-libs/glew:0= |
89 |
+ media-libs/libglvnd[X] |
90 |
+ media-libs/libsdl[joystick,opengl,video] |
91 |
media-libs/sdl-image[png] |
92 |
media-libs/sdl-ttf |
93 |
sys-libs/zlib:= |
94 |
virtual/glu |
95 |
x11-libs/gtk+:2" |
96 |
-# Yup, libsndfile, openal and ncurses are only needed at compile-time; the code |
97 |
-# dlopens them at runtime if requested. |
98 |
-DEPEND="${RDEPEND} |
99 |
+# libsndfile, openal and ncurses are only needed at compile-time, |
100 |
+# optfeature through dlopen() at runtime if requested |
101 |
+DEPEND=" |
102 |
+ ${RDEPEND} |
103 |
media-libs/libsndfile |
104 |
media-libs/openal |
105 |
- sys-libs/ncurses-compat:5[unicode] |
106 |
- virtual/pkgconfig" |
107 |
+ sys-libs/ncurses-compat:5[unicode]" |
108 |
BDEPEND="virtual/pkgconfig" |
109 |
|
110 |
-QA_PREBUILT="/opt/${PN}/libs/Dwarf_Fortress" |
111 |
+QA_PREBUILT="opt/${PN}/libs/Dwarf_Fortress" |
112 |
|
113 |
-DOC_CONTENTS="Dwarf Fortress has been installed to /opt/${PN}. This is |
114 |
- symlinked to ~/.dwarf-fortress when dwarf-fortress is run. |
115 |
- For more information on what exactly is replaced, see ${EROOT}/usr/bin/dwarf-fortress. |
116 |
- Note: This means that the primary entry point is ${EROOT}/usr/bin/dwarf-fortress. |
117 |
- Do not run /opt/${PN}/libs/Dwarf_Fortress." |
118 |
+PATCHES=( |
119 |
+ "${FILESDIR}"/${P}-missing-cmath.patch |
120 |
+ "${FILESDIR}"/${P}-segfault-fixes.patch |
121 |
+) |
122 |
|
123 |
src_prepare() { |
124 |
- # fix line endings so the patches can apply properly |
125 |
- sed -i \ |
126 |
- -e 's/\r$//' \ |
127 |
- g_src/ttf_manager.cpp \ |
128 |
- g_src/music_and_sound_openal.cpp \ |
129 |
- || die |
130 |
- |
131 |
default |
132 |
|
133 |
- # dwarf fortress includes prebuilt libraries such as libstdc++ we won't use |
134 |
- rm -f libs/*.so* || die |
135 |
-} |
136 |
- |
137 |
-src_configure() { |
138 |
- hprefixify "${WORKDIR}/dwarf-fortress" |
139 |
- |
140 |
- CXXFLAGS+=" -D$(use debug || echo N)DEBUG" |
141 |
+ # remove prebuilt libraries that are provided by the system |
142 |
+ rm libs/*.so* || die |
143 |
} |
144 |
|
145 |
src_compile() { |
146 |
tc-export CXX PKG_CONFIG |
147 |
|
148 |
- emake -f "${FILESDIR}/Makefile.native" |
149 |
+ # -DDEBUG is recognized to give additional debug output |
150 |
+ append-cppflags -D$(usev !debug N)DEBUG |
151 |
+ |
152 |
+ emake -f "${FILESDIR}"/Makefile.native |
153 |
} |
154 |
|
155 |
src_install() { |
156 |
insinto /opt/${PN} |
157 |
- doins -r raw data libs |
158 |
+ doins -r data libs raw |
159 |
|
160 |
- dobin ${FILESDIR}/dwarf-fortress |
161 |
+ fperms +x /opt/${PN}/libs/Dwarf_Fortress |
162 |
|
163 |
- readme.gentoo_create_doc |
164 |
- dodoc README.linux *.txt |
165 |
+ dobin "$(prefixify_ro "${FILESDIR}"/dwarf-fortress)" |
166 |
|
167 |
- fperms 755 /opt/${PN}/libs/Dwarf_Fortress |
168 |
+ doicon "${DISTDIR}"/${PN}.png |
169 |
+ make_desktop_entry dwarf-fortress "Dwarf Fortress" |
170 |
|
171 |
- make_desktop_entry dwarf-fortress "Dwarf Fortress" "dwarf-fortress" Game |
172 |
+ dodoc README.linux *.txt |
173 |
+ |
174 |
+ local DOC_CONTENTS=" |
175 |
+ Dwarf Fortress has been installed to ${EPREFIX}/opt/${PN}. This is |
176 |
+ symlinked to ~/.${PN} when ${PN} is run. For more information on what |
177 |
+ exactly is replaced, see ${EPREFIX}/usr/bin/${PN}. Note: This means |
178 |
+ that the primary entry point is ${EPREFIX}/usr/bin/${PN}, do not run |
179 |
+ ${EPREFIX}/opt/${PN}/libs/Dwarf_Fortress." |
180 |
+ readme.gentoo_create_doc |
181 |
} |
182 |
|
183 |
pkg_postinst() { |
184 |
readme.gentoo_print_elog |
185 |
|
186 |
optfeature "text PRINT_MODE" sys-libs/ncurses-compat:5[unicode] |
187 |
- optfeature "audio output" "media-libs/openal media-libs/libsndfile" |
188 |
- optfeature "OpenGL PRINT_MODE" media-libs/libsdl[opengl] |
189 |
+ optfeature "audio output" "media-libs/openal media-libs/libsndfile[-minimal]" |
190 |
} |
191 |
|
192 |
diff --git a/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-fix-cmath.patch b/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-missing-cmath.patch |
193 |
similarity index 50% |
194 |
rename from games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-fix-cmath.patch |
195 |
rename to games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-missing-cmath.patch |
196 |
index 21017f6b41b1..a3028764afac 100644 |
197 |
--- a/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-fix-cmath.patch |
198 |
+++ b/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-missing-cmath.patch |
199 |
@@ -1,11 +1,8 @@ |
200 |
Fixes compilation due to missing <cmath> header required in this file. |
201 |
|
202 |
-diff --git a/g_src/ttf_manager.cpp b/g_src/ttf_manager.cpp |
203 |
-@@ -1,6 +1,7 @@ |
204 |
- #include "ttf_manager.hpp" |
205 |
+--- a/g_src/ttf_manager.cpp |
206 |
++++ b/g_src/ttf_manager.cpp |
207 |
+@@ -2,2 +2,3 @@ |
208 |
#include "init.h" |
209 |
- #include <iostream> |
210 |
+#include <cmath> |
211 |
- |
212 |
- using namespace std; |
213 |
- |
214 |
+ #include <iostream> |
215 |
|
216 |
diff --git a/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-segfault-fix-729002.patch b/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-segfault-fixes.patch |
217 |
similarity index 54% |
218 |
rename from games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-segfault-fix-729002.patch |
219 |
rename to games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-segfault-fixes.patch |
220 |
index 0f0a9a672874..24c43be41188 100644 |
221 |
--- a/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-segfault-fix-729002.patch |
222 |
+++ b/games-roguelike/dwarf-fortress/files/dwarf-fortress-0.47.05-segfault-fixes.patch |
223 |
@@ -1,49 +1,38 @@ |
224 |
-Fixes a bug due to OpenAL soft crashing the game on startup: https://www.bay12games.com/dwarves/mantisbt/view.php?id=11564 |
225 |
-Fixes a bug regarding an infinite loop on anything higher than -O1: https://www.bay12games.com/dwarves/mantisbt/view.php?id=11564 |
226 |
+Fixes segfault / infinite loop with OpenAL and anything higher |
227 |
+than -O1 mostly due to missing return values. |
228 |
|
229 |
+https://bugs.gentoo.org/703384 |
230 |
+https://bugs.gentoo.org/703386 |
231 |
https://bugs.gentoo.org/729002 |
232 |
- |
233 |
-diff --git a/g_src/enabler.cpp b/g_src/enabler.cpp |
234 |
+https://www.bay12games.com/dwarves/mantisbt/view.php?id=11564 |
235 |
--- a/g_src/enabler.cpp |
236 |
+++ b/g_src/enabler.cpp |
237 |
-@@ -590,6 +590,10 @@ int enablerst::loop(string cmdline) { |
238 |
- |
239 |
+@@ -591,4 +591,6 @@ |
240 |
// Clean up graphical resources |
241 |
delete renderer; |
242 |
+ |
243 |
+ return 0; |
244 |
} |
245 |
- |
246 |
- void enablerst::override_grid_size(int x, int y) { |
247 |
-diff --git a/g_src/music_and_sound_openal.cpp b/g_src/music_and_sound_openal.cpp |
248 |
+ |
249 |
--- a/g_src/music_and_sound_openal.cpp |
250 |
+++ b/g_src/music_and_sound_openal.cpp |
251 |
-@@ -250,7 +250,11 @@ void musicsoundst::deinitsound() { |
252 |
- alDeleteBuffers(1, &buffer); |
253 |
- } |
254 |
- // Deinit OpenAL |
255 |
-- alcMakeContextCurrent(NULL); |
256 |
-+ |
257 |
-+ //alcMakeContextCurrent(NULL); |
258 |
-+ |
259 |
- alcDestroyContext(context); |
260 |
- alcCloseDevice(device); |
261 |
- |
262 |
-@@ -480,7 +484,9 @@ static bool init_openal() { |
263 |
- |
264 |
- void alEnable( ALenum capability ) { _alEnable(capability); } |
265 |
- void alDisable( ALenum capability ) { _alDisable(capability); } |
266 |
--ALboolean alIsEnabled( ALenum capability ) { _alIsEnabled(capability); } |
267 |
-+ALboolean alIsEnabled( ALenum capability ) { return _alIsEnabled(capability); } |
268 |
- const ALchar* alGetString( ALenum param ) { return _alGetString(param); } |
269 |
- void alGetBooleanv( ALenum param, ALboolean* data ) { _alGetBooleanv(param, data); } |
270 |
- void alGetIntegerv( ALenum param, ALint* data ) { _alGetIntegerv(param, data); } |
271 |
-@@ -490,7 +496,9 @@ ALboolean alGetBoolean( ALenum param ) { return _alGetBoolean(param); } |
272 |
- ALint alGetInteger( ALenum param ) { return _alGetInteger(param); } |
273 |
- ALfloat alGetFloat( ALenum param ) { return _alGetFloat(param); } |
274 |
- ALdouble alGetDouble( ALenum param ) { return _alGetDouble(param); } |
275 |
--ALenum alGetError( void ) { _alGetError(); } |
276 |
-+ALenum alGetError( void ) { return _alGetError(); } |
277 |
- ALboolean alIsExtensionPresent( const ALchar* extname ) { return _alIsExtensionPresent(extname); } |
278 |
- void* alGetProcAddress( const ALchar* fname ) { return _alGetProcAddress(fname); } |
279 |
- ALenum alGetEnumValue( const ALchar* ename ) { return _alGetEnumValue(ename); } |
280 |
+@@ -251,5 +251,4 @@ |
281 |
+ } |
282 |
+ // Deinit OpenAL |
283 |
+- alcMakeContextCurrent(NULL); |
284 |
+ alcDestroyContext(context); |
285 |
+ alcCloseDevice(device); |
286 |
+@@ -481,5 +480,5 @@ |
287 |
+ void alEnable( ALenum capability ) { _alEnable(capability); } |
288 |
+ void alDisable( ALenum capability ) { _alDisable(capability); } |
289 |
+-ALboolean alIsEnabled( ALenum capability ) { _alIsEnabled(capability); } |
290 |
++ALboolean alIsEnabled( ALenum capability ) { return _alIsEnabled(capability); } |
291 |
+ const ALchar* alGetString( ALenum param ) { return _alGetString(param); } |
292 |
+ void alGetBooleanv( ALenum param, ALboolean* data ) { _alGetBooleanv(param, data); } |
293 |
+@@ -491,5 +490,5 @@ |
294 |
+ ALfloat alGetFloat( ALenum param ) { return _alGetFloat(param); } |
295 |
+ ALdouble alGetDouble( ALenum param ) { return _alGetDouble(param); } |
296 |
+-ALenum alGetError( void ) { _alGetError(); } |
297 |
++ALenum alGetError( void ) { return _alGetError(); } |
298 |
+ ALboolean alIsExtensionPresent( const ALchar* extname ) { return _alIsExtensionPresent(extname); } |
299 |
+ void* alGetProcAddress( const ALchar* fname ) { return _alGetProcAddress(fname); } |