Gentoo Archives: gentoo-commits

From: Pacho Ramos <pacho@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-misc/yadex/, games-misc/yadex/files/
Date: Sun, 27 May 2018 16:14:44
Message-Id: 1527437669.6ed5cb8f8f48a604bd4db58192b30a3cb0813286.pacho@gentoo
1 commit: 6ed5cb8f8f48a604bd4db58192b30a3cb0813286
2 Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 27 15:52:28 2018 +0000
4 Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
5 CommitDate: Sun May 27 16:14:29 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ed5cb8f
7
8 games-misc/yadex: Lots of fixes from Fedora (#160305)
9
10 Package-Manager: Portage-2.3.38, Repoman-2.3.9
11
12 games-misc/yadex/Manifest | 3 +
13 games-misc/yadex/files/yadex-1.7.0-64bit.patch | 161 +++++++++++++++++++++
14 games-misc/yadex/files/yadex-1.7.0-datadir.patch | 55 +++++++
15 games-misc/yadex/files/yadex-1.7.0-destdir.patch | 36 +++++
16 games-misc/yadex/files/yadex-1.7.0-elif.patch | 4 +-
17 .../yadex/files/yadex_170-obj-overflow.patch | 22 +++
18 games-misc/yadex/files/yadex_170_O2.patch | 14 ++
19 games-misc/yadex/files/yadex_170_wm.patch | 49 +++++++
20 games-misc/yadex/yadex-1.7.0-r1.ebuild | 61 ++++++++
21 9 files changed, 403 insertions(+), 2 deletions(-)
22
23 diff --git a/games-misc/yadex/Manifest b/games-misc/yadex/Manifest
24 index 5234c686b17..ddee652d22c 100644
25 --- a/games-misc/yadex/Manifest
26 +++ b/games-misc/yadex/Manifest
27 @@ -1 +1,4 @@
28 +DIST Yadex_170_ALL.diff 73652 BLAKE2B dfead81153d0674d70d6e27b27e5abf0f4834c1e10d874d2c6148b4715539646b1cdf7d65f669413f4814f65e838e1f7031f221ba0baa3f7b248305e3fbe0598 SHA512 0879fa5f62e395d53ee9a004b116fbc0180178f41099876d7fea159c9ced25a54218be787d155895e74707e70a2c2e48f752dcf86aec4d1a8f41f96e2bcbe279
29 +DIST yadex-1.7.0-mrmeval-differential-patch.patch 128529 BLAKE2B 500df2ed4173f39313416728a70e6fe2823ec604c8ab63076058944cfe83ba8a584276a77ee87a0ac46e635484a2215c96c068e0ee231698b683cb0c65c0f391 SHA512 4ec1d9c452db88dd42c145c04e2ec3f9958e7a462eaa14512cffb57ede1f263d375105917845f52e76e7eb171476d4f44bd95dd8615131ca9fdaf6e229cb53fc
30 DIST yadex-1.7.0.tar.gz 551318 BLAKE2B c5655c190466419505691762bb6b6641a61f68d80bc8a06f0e600a1e4a562b4989179400a2185104994971eeb55105e5f3691d6286c7431147b97cef0d00b3a2 SHA512 017f0ffc21b7b49e25e81a16c5badc3159f0b34954e278d658175da51b7ecf1e15e12579a244530afb10e133c890761d78c1f1a209a800887c145c5c1af5d317
31 +DIST yadex.png 2229 BLAKE2B 4559d8b134b58231b062e18b0e151a952a42748c7b2ddc9db64fa6456a37b0f4839d92eae92dec66085b1ad5f46f3d50082cd9398cc68713fec431d3e3ee946c SHA512 290cee14dea91ca4fb618f00575351b77b7c63ec155256274f83707d1f457cf4e7a921803203c75b371dc688d2ee90890f943ce3744987840aa1c5e0b5d977ee
32
33 diff --git a/games-misc/yadex/files/yadex-1.7.0-64bit.patch b/games-misc/yadex/files/yadex-1.7.0-64bit.patch
34 new file mode 100644
35 index 00000000000..7f6b84216e5
36 --- /dev/null
37 +++ b/games-misc/yadex/files/yadex-1.7.0-64bit.patch
38 @@ -0,0 +1,161 @@
39 +diff -Naur yadex-1.7.0/GNUmakefile yadex-1.7.0.new/GNUmakefile
40 +--- yadex-1.7.0/GNUmakefile 2006-03-16 20:33:36.000000000 -0800
41 ++++ yadex-1.7.0.new/GNUmakefile 2006-03-16 18:37:50.000000000 -0800
42 +@@ -53,6 +53,7 @@
43 +
44 + # Which OS ?
45 + OS := $(shell uname -s | tr A-Z a-z)
46 ++ARCH := $(shell uname -i | tr A-Z a-z)
47 +
48 + # Where your X11 libraries and headers reside.
49 + # Current rule:
50 +@@ -67,7 +68,11 @@
51 + X11LIBDIR = /usr/openwin/lib
52 + X11INCLUDEDIR = /usr/openwin/include
53 + else
54 +- X11LIBDIR = /usr/X11R6/lib
55 ++ ifeq ($(findstring $(ARCH), x86_64), $(ARCH))
56 ++ X11LIBDIR = /usr/X11R6/lib64
57 ++ else
58 ++ X11LIBDIR = /usr/X11R6/lib
59 ++ endif
60 + X11INCLUDEDIR = /usr/X11R6/include
61 + endif
62 + endif
63 +diff -Naur yadex-1.7.0/src/levels.cc yadex-1.7.0.new/src/levels.cc
64 +--- yadex-1.7.0/src/levels.cc 2003-03-28 04:37:32.000000000 -0800
65 ++++ yadex-1.7.0.new/src/levels.cc 2006-03-16 20:38:01.000000000 -0800
66 +@@ -1387,7 +1387,7 @@
67 + }
68 + NumWTexture = (int) val + 1;
69 + /* read in the offsets for texture1 names */
70 +- offsets = (i32 *) GetMemory ((long) NumWTexture * 4);
71 ++ offsets = (i32 *) GetMemory ((long) NumWTexture * (sizeof(i32)));
72 + wf->read_i32 (offsets + 1, NumWTexture - 1);
73 + if (wf->error ())
74 + {
75 +@@ -1445,7 +1445,7 @@
76 + }
77 + NumWTexture = (int) val + 1;
78 + /* read in the offsets for texture1 names */
79 +- offsets = (i32 *) GetMemory ((long) NumWTexture * 4);
80 ++ offsets = (i32 *) GetMemory ((long) NumWTexture * sizeof(i32));
81 + wf->read_i32 (offsets + 1, NumWTexture - 1);
82 + {
83 + // FIXME
84 +@@ -1489,7 +1489,7 @@
85 + // FIXME
86 + }
87 + /* read in the offsets for texture2 names */
88 +- offsets = (i32 *) GetMemory ((long) val * 4);
89 ++ offsets = (i32 *) GetMemory ((long) val * sizeof(i32));
90 + wf->read_i32 (offsets, val);
91 + if (wf->error ())
92 + {
93 +diff -Naur yadex-1.7.0/src/pic2img.cc yadex-1.7.0.new/src/pic2img.cc
94 +--- yadex-1.7.0/src/pic2img.cc 2003-03-28 04:37:32.000000000 -0800
95 ++++ yadex-1.7.0.new/src/pic2img.cc 2006-03-16 20:30:40.000000000 -0800
96 +@@ -192,7 +192,7 @@
97 +
98 + ColumnData = (u8 *) GetMemory (TEX_COLUMNBUFFERSIZE);
99 + /* FIXME DOS and pic_width_ > 16000 */
100 +-NeededOffsets = (i32 *) GetMemory ((long) pic_width_ * 4);
101 ++NeededOffsets = (i32 *) GetMemory ((long) pic_width_ * (sizeof(i32)));
102 +
103 + if (long_offsets)
104 + dir->wadfile->read_i32 (NeededOffsets, pic_width_);
105 +diff -Naur yadex-1.7.0/src/r_images.cc yadex-1.7.0.new/src/r_images.cc
106 +--- yadex-1.7.0/src/r_images.cc 2006-03-16 20:33:12.000000000 -0800
107 ++++ yadex-1.7.0.new/src/r_images.cc 2006-03-16 20:39:17.000000000 -0800
108 +@@ -182,7 +182,7 @@
109 + dir->wadfile->seek (dir->dir.start);
110 + dir->wadfile->read_i32 (&numtex);
111 + /* read in the offsets for texture1 names and info. */
112 +- offsets = (i32 *) GetMemory ((long) numtex * 4);
113 ++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
114 + dir->wadfile->read_i32 (offsets, numtex);
115 + for (n = 0; n < numtex && !texofs; n++)
116 + {
117 +@@ -205,7 +205,7 @@
118 + dir->wadfile->seek (dir->dir.start);
119 + dir->wadfile->read_i32 (&numtex);
120 + /* read in the offsets for texture1 names and info. */
121 +- offsets = (i32 *) GetMemory ((long) numtex * 4);
122 ++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
123 + dir->wadfile->read_i32 (offsets, numtex);
124 + for (n = 0; n < numtex && !texofs; n++)
125 + {
126 +@@ -225,7 +225,7 @@
127 + dir->wadfile->seek (dir->dir.start);
128 + dir->wadfile->read_i32 (&numtex);
129 + /* read in the offsets for texture2 names */
130 +- offsets = (i32 *) GetMemory ((long) numtex * 4);
131 ++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
132 + dir->wadfile->read_i32 (offsets, numtex);
133 + for (n = 0; n < numtex && !texofs; n++)
134 + {
135 +diff -Naur yadex-1.7.0/src/textures.cc yadex-1.7.0.new/src/textures.cc
136 +--- yadex-1.7.0/src/textures.cc 2003-04-24 13:50:36.000000000 -0700
137 ++++ yadex-1.7.0.new/src/textures.cc 2006-03-16 20:38:44.000000000 -0800
138 +@@ -177,7 +177,7 @@
139 + goto textures_done;
140 + }
141 + // Read in the offsets for texture1 names and info
142 +- offsets = (i32 *) GetMemory ((long) numtex * 4);
143 ++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
144 + wf->read_i32 (offsets, numtex);
145 + if (wf->error ())
146 + {
147 +@@ -233,7 +233,7 @@
148 + goto texture1_done;
149 + }
150 + // Read in the offsets for texture1 names and info
151 +- offsets = (i32 *) GetMemory ((long) numtex * 4);
152 ++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
153 + wf->read_i32 (offsets, numtex);
154 + if (wf->error ())
155 + {
156 +@@ -286,7 +286,7 @@
157 + goto texture2_done;
158 + }
159 + // Read in the offsets for TEXTURE2 names
160 +- offsets = (i32 *) GetMemory ((long) numtex * 4);
161 ++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
162 + wf->read_i32 (offsets, numtex);
163 + if (wf->error ())
164 + {
165 +@@ -514,7 +514,7 @@
166 + dir->wadfile->seek (dir->dir.start);
167 + dir->wadfile->read_i32 (&numtex);
168 + // Read in the offsets for texture1 names and info
169 +- offsets = (i32 *) GetMemory ((long) numtex * 4);
170 ++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
171 + dir->wadfile->read_i32 (offsets, numtex);
172 + for (n = 0; n < numtex && !texofs; n++)
173 + {
174 +@@ -534,7 +534,7 @@
175 + dir->wadfile->seek (dir->dir.start);
176 + dir->wadfile->read_i32 (&numtex);
177 + // Read in the offsets for texture2 names
178 +- offsets = (i32 *) GetMemory ((long) numtex * 4);
179 ++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
180 + dir->wadfile->read_i32 (offsets);
181 + for (n = 0; n < numtex && !texofs; n++)
182 + {
183 +diff -Naur yadex-1.7.0/src/yadex.h yadex-1.7.0.new/src/yadex.h
184 +--- yadex-1.7.0/src/yadex.h 2006-03-16 20:33:12.000000000 -0800
185 ++++ yadex-1.7.0.new/src/yadex.h 2006-03-16 20:29:15.000000000 -0800
186 +@@ -98,11 +98,11 @@
187 + #define F_I16_D "hd"
188 + #define F_I16_H "hX"
189 +
190 +-typedef unsigned long u32;
191 ++typedef unsigned int u32;
192 + #define F_U32_D "lu"
193 + #define F_U32_H "lX"
194 +
195 +-typedef signed long i32;
196 ++typedef signed int i32;
197 + #define F_I32_D "ld"
198 + #define F_I32_H "lX"
199 +
200
201 diff --git a/games-misc/yadex/files/yadex-1.7.0-datadir.patch b/games-misc/yadex/files/yadex-1.7.0-datadir.patch
202 new file mode 100644
203 index 00000000000..f7b2ab5fb7e
204 --- /dev/null
205 +++ b/games-misc/yadex/files/yadex-1.7.0-datadir.patch
206 @@ -0,0 +1,55 @@
207 +diff -Naur yadex-1.7.0/configure yadex-1.7.0.new/configure
208 +--- yadex-1.7.0/configure 2006-03-16 18:49:20.000000000 -0800
209 ++++ yadex-1.7.0.new/configure 2006-03-16 16:36:21.000000000 -0800
210 +@@ -408,16 +408,16 @@
211 + ETCDIR=/etc/$APPNAME/%v
212 + ETCDIRNV=/etc/$APPNAME
213 + MANDIR=/usr/share/man
214 +- SHAREDIR=/usr/share/games/$APPNAME/%v
215 +- SHAREDIRNV=/usr/share/games/$APPNAME
216 ++ SHAREDIR=/usr/share/$APPNAME/%v
217 ++ SHAREDIRNV=/usr/share/$APPNAME
218 + elif expr "$PREFIX" : '//*usr//*local/*$' >/dev/null
219 + then
220 + BINDIR=/usr/local/bin # FHS-ly correct is /usr/local/games
221 + ETCDIR=/etc/$APPNAME/%v
222 + ETCDIRNV=/etc/$APPNAME
223 + MANDIR=/usr/local/man
224 +- SHAREDIR=/usr/local/share/games/$APPNAME/%v
225 +- SHAREDIRNV=/usr/local/share/games/$APPNAME
226 ++ SHAREDIR=/usr/local/share/$APPNAME/%v
227 ++ SHAREDIRNV=/usr/local/share/$APPNAME
228 + elif expr "$PREFIX" : '//*opt/*$' >/dev/null
229 + then
230 + echo '/opt ? Surely you mean /opt/something, Mr. Feynman !' 1>&2
231 +diff -Naur yadex-1.7.0/yadex.cfg yadex-1.7.0.new/yadex.cfg
232 +--- yadex-1.7.0/yadex.cfg 2006-03-16 18:49:20.000000000 -0800
233 ++++ yadex-1.7.0.new/yadex.cfg 2006-03-16 18:49:43.000000000 -0800
234 +@@ -20,16 +20,17 @@
235 + # 9 doompr Doom press release pre-beta (/pub/idgames/historic/doomprbt.zip)
236 + # 10 strife10 Strife 1.0 (demo or commercial)
237 +
238 +- iwad1 = /usr/local/share/games/doom/doom.wad
239 +- iwad2 = /usr/local/share/games/doom2/doom2.wad
240 +- iwad3 = /usr/local/share/games/heretic/heretic.wad
241 +- iwad4 = /usr/local/share/games/hexen/hexen.wad
242 +- iwad5 = /usr/local/share/games/strife/strife1.wad
243 +- iwad6 = /usr/local/share/games/doom02/doom.wad
244 +- iwad7 = /usr/local/share/games/doom04/doom.wad
245 +- iwad8 = /usr/local/share/games/doom05/doom.wad
246 +- iwad9 = /usr/local/share/games/doompr/doompres.wad
247 +- iwad10 = /usr/local/share/games/strife10/strife1.wad
248 ++ iwad1 = /usr/share/doom/doom.wad
249 ++# iwad2 = /usr/share/doom/doom2.wad
250 ++ iwad2 = /usr/share/doom/freedoom.wad
251 ++ iwad3 = /usr/share/doom/heretic.wad
252 ++ iwad4 = /usr/share/doom/hexen.wad
253 ++ iwad5 = /usr/share/doom/strife1.wad
254 ++ iwad6 = /usr/share/doom/doom.wad
255 ++ iwad7 = /usr/share/doom/doom.wad
256 ++ iwad8 = /usr/share/doom/doom.wad
257 ++ iwad9 = /usr/share/doom/doompres.wad
258 ++ iwad10 = /usr/share/doom/strife1.wad
259 +
260 + # Name of the patch wads you want to load. None by default.
261 +
262
263 diff --git a/games-misc/yadex/files/yadex-1.7.0-destdir.patch b/games-misc/yadex/files/yadex-1.7.0-destdir.patch
264 new file mode 100644
265 index 00000000000..a1f430c4bd9
266 --- /dev/null
267 +++ b/games-misc/yadex/files/yadex-1.7.0-destdir.patch
268 @@ -0,0 +1,36 @@
269 +diff -Naur yadex-1.7.0/GNUmakefile yadex-1.7.0.new/GNUmakefile
270 +--- yadex-1.7.0/GNUmakefile 2006-03-16 16:08:10.000000000 -0800
271 ++++ yadex-1.7.0.new/GNUmakefile 2006-03-16 16:11:32.000000000 -0800
272 +@@ -392,19 +392,19 @@
273 +
274 + .PHONY: install
275 + install: $(OBJDIR)/install
276 +- @scripts/mkinstalldirs $(BINDIR)
277 +- @scripts/mkinstalldirs $(ETCDIR)
278 +- @scripts/mkinstalldirs $(MANDIR)
279 +- @scripts/mkinstalldirs $(MANDIR)/man6
280 +- @scripts/mkinstalldirs $(SHAREDIR)
281 +- $(OBJDIR)/install -m 755 $(OBJDIR)/yadex $(BINDIR)/yadex-$(VERSION)
282 +- rm -f $(BINDIR)/yadex
283 +- ln -s yadex-$(VERSION) $(BINDIR)/yadex
284 +- $(OBJDIR)/install -m 644 doc/yadex.6 $(MANDIR)/man6/yadex-$(VERSION).6
285 +- rm -f $(MANDIR)/man6/yadex.6
286 +- ln -s yadex-$(VERSION).6 $(MANDIR)/man6/yadex.6
287 +- $(OBJDIR)/install -m 644 -d $(SHAREDIR) $(YGD)
288 +- $(OBJDIR)/install -m 644 -d $(ETCDIR) yadex.cfg
289 ++ @scripts/mkinstalldirs $(DESTDIR)$(BINDIR)
290 ++ @scripts/mkinstalldirs $(DESTDIR)$(ETCDIR)
291 ++ @scripts/mkinstalldirs $(DESTDIR)$(MANDIR)
292 ++ @scripts/mkinstalldirs $(DESTDIR)$(MANDIR)/man6
293 ++ @scripts/mkinstalldirs $(DESTDIR)$(SHAREDIR)
294 ++ $(OBJDIR)/install -m 755 $(OBJDIR)/yadex $(DESTDIR)$(BINDIR)/yadex-$(VERSION)
295 ++ rm -f $(DESTDIR)$(BINDIR)/yadex
296 ++ ln -s yadex-$(VERSION) $(DESTDIR)$(BINDIR)/yadex
297 ++ $(OBJDIR)/install -m 644 doc/yadex.6 $(DESTDIR)$(MANDIR)/man6/yadex-$(VERSION).6
298 ++ rm -f $(DESTDIR)$(MANDIR)/man6/yadex.6
299 ++ ln -s yadex-$(VERSION).6 $(DESTDIR)$(MANDIR)/man6/yadex.6
300 ++ $(OBJDIR)/install -m 644 -d $(DESTDIR)$(SHAREDIR) $(YGD)
301 ++ $(OBJDIR)/install -m 644 -d $(DESTDIR)$(ETCDIR) yadex.cfg
302 + @echo "---------------------------------------------------------------"
303 + @echo " Yadex is now installed."
304 + @echo
305
306 diff --git a/games-misc/yadex/files/yadex-1.7.0-elif.patch b/games-misc/yadex/files/yadex-1.7.0-elif.patch
307 index a170cbe0ad7..6674d5becdc 100644
308 --- a/games-misc/yadex/files/yadex-1.7.0-elif.patch
309 +++ b/games-misc/yadex/files/yadex-1.7.0-elif.patch
310 @@ -1,5 +1,5 @@
311 ---- src/gfx.cc.old 2009-08-01 18:47:46.000000000 +0200
312 -+++ src/gfx.cc 2009-08-01 18:46:03.000000000 +0200
313 +--- a/src/gfx.cc.old 2009-08-01 18:47:46.000000000 +0200
314 ++++ b/src/gfx.cc 2009-08-01 18:46:03.000000000 +0200
315 @@ -310,7 +310,7 @@
316 win_vis_id = vis_info->visualid;
317 #if defined _cplusplus || defined __cplusplus
318
319 diff --git a/games-misc/yadex/files/yadex_170-obj-overflow.patch b/games-misc/yadex/files/yadex_170-obj-overflow.patch
320 new file mode 100644
321 index 00000000000..aba86f1e0e0
322 --- /dev/null
323 +++ b/games-misc/yadex/files/yadex_170-obj-overflow.patch
324 @@ -0,0 +1,22 @@
325 +--- yadex-1.7.0/src/objects.cc 2003-03-28 06:37:32.000000000 -0600
326 ++++ yadex-1.7.0/src/objects.cc 2010-05-06 11:42:36.824661556 -0500
327 +@@ -543,7 +543,7 @@
328 + SideDefs[last].yoff = 0;
329 + strcpy (SideDefs[last].tex1, "-");
330 + strcpy (SideDefs[last].tex2, "-");
331 +- strcpy (SideDefs[last].tex3, default_middle_texture);
332 ++ strncpy (SideDefs[last].tex3, default_middle_texture, sizeof(SideDefs[last].tex3));
333 + SideDefs[last].sector = NumSectors - 1;
334 + }
335 + MadeMapChanges = 1;
336 +--- yadex-1.7.0/src/editobj.cc 2003-04-24 15:32:39.000000000 -0500
337 ++++ yadex-1.7.0/src/editobj.cc 2010-05-07 16:36:49.825412601 -0500
338 +@@ -937,7 +937,7 @@
339 + struct SideDef *s = SideDefs + l->sidedef1;
340 + strcpy (s->tex1, "-");
341 + strcpy (s->tex2, "-");
342 +- strcpy (s->tex3, default_middle_texture);
343 ++ strncpy (s->tex3, default_middle_texture, sizeof(s->tex3));
344 + }
345 + /* Don't delete the 2nd sidedef, it could be used
346 + by another linedef. And if it isn't, the next
347
348 diff --git a/games-misc/yadex/files/yadex_170_O2.patch b/games-misc/yadex/files/yadex_170_O2.patch
349 new file mode 100644
350 index 00000000000..5ef90ca9425
351 --- /dev/null
352 +++ b/games-misc/yadex/files/yadex_170_O2.patch
353 @@ -0,0 +1,14 @@
354 +diff -dupr yadex-1.7.901-patched/src/pic2img.cc yadex-1.7.901/src/pic2img.cc
355 +--- yadex-1.7.901-patched/src/pic2img.cc 2006-11-06 17:35:03.000000000 +0100
356 ++++ yadex-1.7.901/src/pic2img.cc 2015-11-24 09:54:25.578048649 +0100
357 +@@ -92,9 +92,9 @@ uint8_t *buf; /* This variable is s
358 + should be pasted. It can be off the image buffer! */
359 +
360 + // Locate the lump where the picture is
361 ++ MasterDirectory dirbuf;
362 + if (picloc.wad != 0)
363 + {
364 +- MasterDirectory dirbuf;
365 + dirbuf.wadfile = picloc.wad;
366 + dirbuf.dir.start = picloc.ofs;
367 + dirbuf.dir.size = picloc.len;
368
369 diff --git a/games-misc/yadex/files/yadex_170_wm.patch b/games-misc/yadex/files/yadex_170_wm.patch
370 new file mode 100644
371 index 00000000000..88006a28a2d
372 --- /dev/null
373 +++ b/games-misc/yadex/files/yadex_170_wm.patch
374 @@ -0,0 +1,49 @@
375 +diff -dupr yadex-1.7.901-patched/src/gfx.cc yadex-1.7.901/src/gfx.cc
376 +--- yadex-1.7.901-patched/src/gfx.cc 2015-11-23 15:53:56.087783740 +0100
377 ++++ yadex-1.7.901/src/gfx.cc 2015-11-23 22:17:45.876127582 +0100
378 +@@ -114,6 +114,7 @@ int win_depth; // The depth of win
379 + int x_server_big_endian = 0; // Is the X server big endian ?
380 + int ximage_bpp; // Number of bytes per pixels in XImages
381 + int ximage_quantum;// Pad XImages lines to a multiple of that many bytes
382 ++Atom wm_delete;
383 + static pcolour_t *app_colour = 0; // Pixel values for the app. colours
384 + static int DrawingMode = 0; // 0 = copy, 1 = xor
385 + static int LineThickness = 0; // 0 = thin, 1 = thick
386 +@@ -471,6 +472,10 @@ int InitGfx (void)
387 + | ExposureMask
388 + | StructureNotifyMask);
389 +
390 ++ // register for message from window manager if the window is closed
391 ++ wm_delete = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
392 ++ XSetWMProtocols(dpy, win, &wm_delete, 1);
393 ++
394 + /*
395 + * Possibly load and query the font
396 + */
397 +diff -dupr yadex-1.7.901-patched/src/gfx.h yadex-1.7.901/src/gfx.h
398 +--- yadex-1.7.901-patched/src/gfx.h 2005-02-06 10:45:21.000000000 +0100
399 ++++ yadex-1.7.901/src/gfx.h 2015-11-23 22:16:10.674721105 +0100
400 +@@ -96,6 +96,7 @@ extern int win_bpp; // The depth of
401 + extern int x_server_big_endian; // Is the X server big-endian ?
402 + extern int ximage_bpp; // Number of bytes per pixels in XImages
403 + extern int ximage_quantum; // Pad XImage lines to a mult of that many B.
404 ++extern Atom wm_delete;
405 + #endif // ifdef X_PROTOCOL
406 + #endif // ifdef Y_X11
407 + extern int text_dot; // DrawScreenText()/DrawScreenString() debug flag
408 +diff -dupr yadex-1.7.901-patched/src/input.cc yadex-1.7.901/src/input.cc
409 +--- yadex-1.7.901-patched/src/input.cc 2006-11-03 14:49:01.000000000 +0100
410 ++++ yadex-1.7.901/src/input.cc 2015-11-23 22:15:21.398133938 +0100
411 +@@ -413,6 +413,12 @@ switch (ev.type)
412 + }
413 + #endif
414 + break;
415 ++
416 ++ case ClientMessage:
417 ++ if ((Atom)ev.xclient.data.l[0] == wm_delete)
418 ++ // window has been closed, simulate ESC keypress
419 ++ is.key = YK_ESC;
420 ++ break;
421 + }
422 + } /* switch (ev.type) */
423 + }
424
425 diff --git a/games-misc/yadex/yadex-1.7.0-r1.ebuild b/games-misc/yadex/yadex-1.7.0-r1.ebuild
426 new file mode 100644
427 index 00000000000..6cbfd87a8ed
428 --- /dev/null
429 +++ b/games-misc/yadex/yadex-1.7.0-r1.ebuild
430 @@ -0,0 +1,61 @@
431 +# Copyright 1999-2018 Gentoo Foundation
432 +# Distributed under the terms of the GNU General Public License v2
433 +
434 +EAPI=6
435 +inherit desktop toolchain-funcs
436 +
437 +DESCRIPTION="A Doom level (wad) editor"
438 +HOMEPAGE="http://www.teaser.fr/~amajorel/yadex/"
439 +SRC_URI="http://www.teaser.fr/~amajorel/yadex/${P}.tar.gz
440 + http://www.teaser.fr/~amajorel/yadex/logo_small.png -> ${PN}.png
441 + http://glbsp.sourceforge.net/yadex/Yadex_170_ALL.diff
442 + https://dev.gentoo.org/~pacho/${PN}/${P}-mrmeval-differential-patch.patch
443 +"
444 +
445 +LICENSE="GPL-2"
446 +SLOT="0"
447 +KEYWORDS="~amd64 ~x86"
448 +IUSE=""
449 +RESTRICT="test"
450 +
451 +DEPEND="x11-libs/libX11"
452 +RDEPEND="${DEPEND}
453 + games-fps/freedoom
454 +"
455 +
456 +src_prepare() {
457 + default
458 +
459 + eapply "${DISTDIR}"/Yadex_170_ALL.diff
460 + eapply "${DISTDIR}"/${P}-mrmeval-differential-patch.patch
461 + eapply "${FILESDIR}"/*.patch
462 +
463 + # Remove bundled boost
464 + rm -rf boost/
465 + # Force the patched file to be old, otherwise the compile fails
466 + touch -t 197010101010 "${S}"/src/wadlist.cc
467 + touch -t 197010101010 "${S}"/src/gfx.cc
468 +}
469 +
470 +src_configure() {
471 + tc-export CC CXX LD AR RANLIB
472 + # not an autoconf script
473 + ./configure --prefix="/usr" || die "configure failed"
474 +}
475 +
476 +src_compile() {
477 + emake CC="${CC}" CXX="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS} -std=gnu++03"
478 +}
479 +
480 +src_install() {
481 + dobin obj/0/yadex
482 + insinto "/usr/share/${PN}/${PV}"
483 + doins ygd/*
484 + doman doc/yadex.6
485 + HTML_DOCS="docsrc/" einstalldocs
486 + insinto /etc/yadex/${PV}
487 + doins yadex.cfg
488 +
489 + make_desktop_entry "yadex -i2 /usr/share/doom-data/freedoom/freedm.wad"
490 + doicon "${DISTDIR}"/${PN}.png
491 +}