summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--games-misc/yadex/Manifest3
-rw-r--r--games-misc/yadex/files/yadex-1.7.0-64bit.patch161
-rw-r--r--games-misc/yadex/files/yadex-1.7.0-datadir.patch55
-rw-r--r--games-misc/yadex/files/yadex-1.7.0-destdir.patch36
-rw-r--r--games-misc/yadex/files/yadex-1.7.0-elif.patch4
-rw-r--r--games-misc/yadex/files/yadex_170-obj-overflow.patch22
-rw-r--r--games-misc/yadex/files/yadex_170_O2.patch14
-rw-r--r--games-misc/yadex/files/yadex_170_wm.patch49
-rw-r--r--games-misc/yadex/yadex-1.7.0-r1.ebuild61
9 files changed, 403 insertions, 2 deletions
diff --git a/games-misc/yadex/Manifest b/games-misc/yadex/Manifest
index 5234c686b172..ddee652d22ca 100644
--- a/games-misc/yadex/Manifest
+++ b/games-misc/yadex/Manifest
@@ -1 +1,4 @@
+DIST Yadex_170_ALL.diff 73652 BLAKE2B dfead81153d0674d70d6e27b27e5abf0f4834c1e10d874d2c6148b4715539646b1cdf7d65f669413f4814f65e838e1f7031f221ba0baa3f7b248305e3fbe0598 SHA512 0879fa5f62e395d53ee9a004b116fbc0180178f41099876d7fea159c9ced25a54218be787d155895e74707e70a2c2e48f752dcf86aec4d1a8f41f96e2bcbe279
+DIST yadex-1.7.0-mrmeval-differential-patch.patch 128529 BLAKE2B 500df2ed4173f39313416728a70e6fe2823ec604c8ab63076058944cfe83ba8a584276a77ee87a0ac46e635484a2215c96c068e0ee231698b683cb0c65c0f391 SHA512 4ec1d9c452db88dd42c145c04e2ec3f9958e7a462eaa14512cffb57ede1f263d375105917845f52e76e7eb171476d4f44bd95dd8615131ca9fdaf6e229cb53fc
DIST yadex-1.7.0.tar.gz 551318 BLAKE2B c5655c190466419505691762bb6b6641a61f68d80bc8a06f0e600a1e4a562b4989179400a2185104994971eeb55105e5f3691d6286c7431147b97cef0d00b3a2 SHA512 017f0ffc21b7b49e25e81a16c5badc3159f0b34954e278d658175da51b7ecf1e15e12579a244530afb10e133c890761d78c1f1a209a800887c145c5c1af5d317
+DIST yadex.png 2229 BLAKE2B 4559d8b134b58231b062e18b0e151a952a42748c7b2ddc9db64fa6456a37b0f4839d92eae92dec66085b1ad5f46f3d50082cd9398cc68713fec431d3e3ee946c SHA512 290cee14dea91ca4fb618f00575351b77b7c63ec155256274f83707d1f457cf4e7a921803203c75b371dc688d2ee90890f943ce3744987840aa1c5e0b5d977ee
diff --git a/games-misc/yadex/files/yadex-1.7.0-64bit.patch b/games-misc/yadex/files/yadex-1.7.0-64bit.patch
new file mode 100644
index 000000000000..7f6b84216e5a
--- /dev/null
+++ b/games-misc/yadex/files/yadex-1.7.0-64bit.patch
@@ -0,0 +1,161 @@
+diff -Naur yadex-1.7.0/GNUmakefile yadex-1.7.0.new/GNUmakefile
+--- yadex-1.7.0/GNUmakefile 2006-03-16 20:33:36.000000000 -0800
++++ yadex-1.7.0.new/GNUmakefile 2006-03-16 18:37:50.000000000 -0800
+@@ -53,6 +53,7 @@
+
+ # Which OS ?
+ OS := $(shell uname -s | tr A-Z a-z)
++ARCH := $(shell uname -i | tr A-Z a-z)
+
+ # Where your X11 libraries and headers reside.
+ # Current rule:
+@@ -67,7 +68,11 @@
+ X11LIBDIR = /usr/openwin/lib
+ X11INCLUDEDIR = /usr/openwin/include
+ else
+- X11LIBDIR = /usr/X11R6/lib
++ ifeq ($(findstring $(ARCH), x86_64), $(ARCH))
++ X11LIBDIR = /usr/X11R6/lib64
++ else
++ X11LIBDIR = /usr/X11R6/lib
++ endif
+ X11INCLUDEDIR = /usr/X11R6/include
+ endif
+ endif
+diff -Naur yadex-1.7.0/src/levels.cc yadex-1.7.0.new/src/levels.cc
+--- yadex-1.7.0/src/levels.cc 2003-03-28 04:37:32.000000000 -0800
++++ yadex-1.7.0.new/src/levels.cc 2006-03-16 20:38:01.000000000 -0800
+@@ -1387,7 +1387,7 @@
+ }
+ NumWTexture = (int) val + 1;
+ /* read in the offsets for texture1 names */
+- offsets = (i32 *) GetMemory ((long) NumWTexture * 4);
++ offsets = (i32 *) GetMemory ((long) NumWTexture * (sizeof(i32)));
+ wf->read_i32 (offsets + 1, NumWTexture - 1);
+ if (wf->error ())
+ {
+@@ -1445,7 +1445,7 @@
+ }
+ NumWTexture = (int) val + 1;
+ /* read in the offsets for texture1 names */
+- offsets = (i32 *) GetMemory ((long) NumWTexture * 4);
++ offsets = (i32 *) GetMemory ((long) NumWTexture * sizeof(i32));
+ wf->read_i32 (offsets + 1, NumWTexture - 1);
+ {
+ // FIXME
+@@ -1489,7 +1489,7 @@
+ // FIXME
+ }
+ /* read in the offsets for texture2 names */
+- offsets = (i32 *) GetMemory ((long) val * 4);
++ offsets = (i32 *) GetMemory ((long) val * sizeof(i32));
+ wf->read_i32 (offsets, val);
+ if (wf->error ())
+ {
+diff -Naur yadex-1.7.0/src/pic2img.cc yadex-1.7.0.new/src/pic2img.cc
+--- yadex-1.7.0/src/pic2img.cc 2003-03-28 04:37:32.000000000 -0800
++++ yadex-1.7.0.new/src/pic2img.cc 2006-03-16 20:30:40.000000000 -0800
+@@ -192,7 +192,7 @@
+
+ ColumnData = (u8 *) GetMemory (TEX_COLUMNBUFFERSIZE);
+ /* FIXME DOS and pic_width_ > 16000 */
+-NeededOffsets = (i32 *) GetMemory ((long) pic_width_ * 4);
++NeededOffsets = (i32 *) GetMemory ((long) pic_width_ * (sizeof(i32)));
+
+ if (long_offsets)
+ dir->wadfile->read_i32 (NeededOffsets, pic_width_);
+diff -Naur yadex-1.7.0/src/r_images.cc yadex-1.7.0.new/src/r_images.cc
+--- yadex-1.7.0/src/r_images.cc 2006-03-16 20:33:12.000000000 -0800
++++ yadex-1.7.0.new/src/r_images.cc 2006-03-16 20:39:17.000000000 -0800
+@@ -182,7 +182,7 @@
+ dir->wadfile->seek (dir->dir.start);
+ dir->wadfile->read_i32 (&numtex);
+ /* read in the offsets for texture1 names and info. */
+- offsets = (i32 *) GetMemory ((long) numtex * 4);
++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
+ dir->wadfile->read_i32 (offsets, numtex);
+ for (n = 0; n < numtex && !texofs; n++)
+ {
+@@ -205,7 +205,7 @@
+ dir->wadfile->seek (dir->dir.start);
+ dir->wadfile->read_i32 (&numtex);
+ /* read in the offsets for texture1 names and info. */
+- offsets = (i32 *) GetMemory ((long) numtex * 4);
++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
+ dir->wadfile->read_i32 (offsets, numtex);
+ for (n = 0; n < numtex && !texofs; n++)
+ {
+@@ -225,7 +225,7 @@
+ dir->wadfile->seek (dir->dir.start);
+ dir->wadfile->read_i32 (&numtex);
+ /* read in the offsets for texture2 names */
+- offsets = (i32 *) GetMemory ((long) numtex * 4);
++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
+ dir->wadfile->read_i32 (offsets, numtex);
+ for (n = 0; n < numtex && !texofs; n++)
+ {
+diff -Naur yadex-1.7.0/src/textures.cc yadex-1.7.0.new/src/textures.cc
+--- yadex-1.7.0/src/textures.cc 2003-04-24 13:50:36.000000000 -0700
++++ yadex-1.7.0.new/src/textures.cc 2006-03-16 20:38:44.000000000 -0800
+@@ -177,7 +177,7 @@
+ goto textures_done;
+ }
+ // Read in the offsets for texture1 names and info
+- offsets = (i32 *) GetMemory ((long) numtex * 4);
++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
+ wf->read_i32 (offsets, numtex);
+ if (wf->error ())
+ {
+@@ -233,7 +233,7 @@
+ goto texture1_done;
+ }
+ // Read in the offsets for texture1 names and info
+- offsets = (i32 *) GetMemory ((long) numtex * 4);
++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
+ wf->read_i32 (offsets, numtex);
+ if (wf->error ())
+ {
+@@ -286,7 +286,7 @@
+ goto texture2_done;
+ }
+ // Read in the offsets for TEXTURE2 names
+- offsets = (i32 *) GetMemory ((long) numtex * 4);
++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
+ wf->read_i32 (offsets, numtex);
+ if (wf->error ())
+ {
+@@ -514,7 +514,7 @@
+ dir->wadfile->seek (dir->dir.start);
+ dir->wadfile->read_i32 (&numtex);
+ // Read in the offsets for texture1 names and info
+- offsets = (i32 *) GetMemory ((long) numtex * 4);
++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
+ dir->wadfile->read_i32 (offsets, numtex);
+ for (n = 0; n < numtex && !texofs; n++)
+ {
+@@ -534,7 +534,7 @@
+ dir->wadfile->seek (dir->dir.start);
+ dir->wadfile->read_i32 (&numtex);
+ // Read in the offsets for texture2 names
+- offsets = (i32 *) GetMemory ((long) numtex * 4);
++ offsets = (i32 *) GetMemory ((long) numtex * sizeof(i32));
+ dir->wadfile->read_i32 (offsets);
+ for (n = 0; n < numtex && !texofs; n++)
+ {
+diff -Naur yadex-1.7.0/src/yadex.h yadex-1.7.0.new/src/yadex.h
+--- yadex-1.7.0/src/yadex.h 2006-03-16 20:33:12.000000000 -0800
++++ yadex-1.7.0.new/src/yadex.h 2006-03-16 20:29:15.000000000 -0800
+@@ -98,11 +98,11 @@
+ #define F_I16_D "hd"
+ #define F_I16_H "hX"
+
+-typedef unsigned long u32;
++typedef unsigned int u32;
+ #define F_U32_D "lu"
+ #define F_U32_H "lX"
+
+-typedef signed long i32;
++typedef signed int i32;
+ #define F_I32_D "ld"
+ #define F_I32_H "lX"
+
diff --git a/games-misc/yadex/files/yadex-1.7.0-datadir.patch b/games-misc/yadex/files/yadex-1.7.0-datadir.patch
new file mode 100644
index 000000000000..f7b2ab5fb7ef
--- /dev/null
+++ b/games-misc/yadex/files/yadex-1.7.0-datadir.patch
@@ -0,0 +1,55 @@
+diff -Naur yadex-1.7.0/configure yadex-1.7.0.new/configure
+--- yadex-1.7.0/configure 2006-03-16 18:49:20.000000000 -0800
++++ yadex-1.7.0.new/configure 2006-03-16 16:36:21.000000000 -0800
+@@ -408,16 +408,16 @@
+ ETCDIR=/etc/$APPNAME/%v
+ ETCDIRNV=/etc/$APPNAME
+ MANDIR=/usr/share/man
+- SHAREDIR=/usr/share/games/$APPNAME/%v
+- SHAREDIRNV=/usr/share/games/$APPNAME
++ SHAREDIR=/usr/share/$APPNAME/%v
++ SHAREDIRNV=/usr/share/$APPNAME
+ elif expr "$PREFIX" : '//*usr//*local/*$' >/dev/null
+ then
+ BINDIR=/usr/local/bin # FHS-ly correct is /usr/local/games
+ ETCDIR=/etc/$APPNAME/%v
+ ETCDIRNV=/etc/$APPNAME
+ MANDIR=/usr/local/man
+- SHAREDIR=/usr/local/share/games/$APPNAME/%v
+- SHAREDIRNV=/usr/local/share/games/$APPNAME
++ SHAREDIR=/usr/local/share/$APPNAME/%v
++ SHAREDIRNV=/usr/local/share/$APPNAME
+ elif expr "$PREFIX" : '//*opt/*$' >/dev/null
+ then
+ echo '/opt ? Surely you mean /opt/something, Mr. Feynman !' 1>&2
+diff -Naur yadex-1.7.0/yadex.cfg yadex-1.7.0.new/yadex.cfg
+--- yadex-1.7.0/yadex.cfg 2006-03-16 18:49:20.000000000 -0800
++++ yadex-1.7.0.new/yadex.cfg 2006-03-16 18:49:43.000000000 -0800
+@@ -20,16 +20,17 @@
+ # 9 doompr Doom press release pre-beta (/pub/idgames/historic/doomprbt.zip)
+ # 10 strife10 Strife 1.0 (demo or commercial)
+
+- iwad1 = /usr/local/share/games/doom/doom.wad
+- iwad2 = /usr/local/share/games/doom2/doom2.wad
+- iwad3 = /usr/local/share/games/heretic/heretic.wad
+- iwad4 = /usr/local/share/games/hexen/hexen.wad
+- iwad5 = /usr/local/share/games/strife/strife1.wad
+- iwad6 = /usr/local/share/games/doom02/doom.wad
+- iwad7 = /usr/local/share/games/doom04/doom.wad
+- iwad8 = /usr/local/share/games/doom05/doom.wad
+- iwad9 = /usr/local/share/games/doompr/doompres.wad
+- iwad10 = /usr/local/share/games/strife10/strife1.wad
++ iwad1 = /usr/share/doom/doom.wad
++# iwad2 = /usr/share/doom/doom2.wad
++ iwad2 = /usr/share/doom/freedoom.wad
++ iwad3 = /usr/share/doom/heretic.wad
++ iwad4 = /usr/share/doom/hexen.wad
++ iwad5 = /usr/share/doom/strife1.wad
++ iwad6 = /usr/share/doom/doom.wad
++ iwad7 = /usr/share/doom/doom.wad
++ iwad8 = /usr/share/doom/doom.wad
++ iwad9 = /usr/share/doom/doompres.wad
++ iwad10 = /usr/share/doom/strife1.wad
+
+ # Name of the patch wads you want to load. None by default.
+
diff --git a/games-misc/yadex/files/yadex-1.7.0-destdir.patch b/games-misc/yadex/files/yadex-1.7.0-destdir.patch
new file mode 100644
index 000000000000..a1f430c4bd9f
--- /dev/null
+++ b/games-misc/yadex/files/yadex-1.7.0-destdir.patch
@@ -0,0 +1,36 @@
+diff -Naur yadex-1.7.0/GNUmakefile yadex-1.7.0.new/GNUmakefile
+--- yadex-1.7.0/GNUmakefile 2006-03-16 16:08:10.000000000 -0800
++++ yadex-1.7.0.new/GNUmakefile 2006-03-16 16:11:32.000000000 -0800
+@@ -392,19 +392,19 @@
+
+ .PHONY: install
+ install: $(OBJDIR)/install
+- @scripts/mkinstalldirs $(BINDIR)
+- @scripts/mkinstalldirs $(ETCDIR)
+- @scripts/mkinstalldirs $(MANDIR)
+- @scripts/mkinstalldirs $(MANDIR)/man6
+- @scripts/mkinstalldirs $(SHAREDIR)
+- $(OBJDIR)/install -m 755 $(OBJDIR)/yadex $(BINDIR)/yadex-$(VERSION)
+- rm -f $(BINDIR)/yadex
+- ln -s yadex-$(VERSION) $(BINDIR)/yadex
+- $(OBJDIR)/install -m 644 doc/yadex.6 $(MANDIR)/man6/yadex-$(VERSION).6
+- rm -f $(MANDIR)/man6/yadex.6
+- ln -s yadex-$(VERSION).6 $(MANDIR)/man6/yadex.6
+- $(OBJDIR)/install -m 644 -d $(SHAREDIR) $(YGD)
+- $(OBJDIR)/install -m 644 -d $(ETCDIR) yadex.cfg
++ @scripts/mkinstalldirs $(DESTDIR)$(BINDIR)
++ @scripts/mkinstalldirs $(DESTDIR)$(ETCDIR)
++ @scripts/mkinstalldirs $(DESTDIR)$(MANDIR)
++ @scripts/mkinstalldirs $(DESTDIR)$(MANDIR)/man6
++ @scripts/mkinstalldirs $(DESTDIR)$(SHAREDIR)
++ $(OBJDIR)/install -m 755 $(OBJDIR)/yadex $(DESTDIR)$(BINDIR)/yadex-$(VERSION)
++ rm -f $(DESTDIR)$(BINDIR)/yadex
++ ln -s yadex-$(VERSION) $(DESTDIR)$(BINDIR)/yadex
++ $(OBJDIR)/install -m 644 doc/yadex.6 $(DESTDIR)$(MANDIR)/man6/yadex-$(VERSION).6
++ rm -f $(DESTDIR)$(MANDIR)/man6/yadex.6
++ ln -s yadex-$(VERSION).6 $(DESTDIR)$(MANDIR)/man6/yadex.6
++ $(OBJDIR)/install -m 644 -d $(DESTDIR)$(SHAREDIR) $(YGD)
++ $(OBJDIR)/install -m 644 -d $(DESTDIR)$(ETCDIR) yadex.cfg
+ @echo "---------------------------------------------------------------"
+ @echo " Yadex is now installed."
+ @echo
diff --git a/games-misc/yadex/files/yadex-1.7.0-elif.patch b/games-misc/yadex/files/yadex-1.7.0-elif.patch
index a170cbe0ad77..6674d5becdc2 100644
--- a/games-misc/yadex/files/yadex-1.7.0-elif.patch
+++ b/games-misc/yadex/files/yadex-1.7.0-elif.patch
@@ -1,5 +1,5 @@
---- src/gfx.cc.old 2009-08-01 18:47:46.000000000 +0200
-+++ src/gfx.cc 2009-08-01 18:46:03.000000000 +0200
+--- a/src/gfx.cc.old 2009-08-01 18:47:46.000000000 +0200
++++ b/src/gfx.cc 2009-08-01 18:46:03.000000000 +0200
@@ -310,7 +310,7 @@
win_vis_id = vis_info->visualid;
#if defined _cplusplus || defined __cplusplus
diff --git a/games-misc/yadex/files/yadex_170-obj-overflow.patch b/games-misc/yadex/files/yadex_170-obj-overflow.patch
new file mode 100644
index 000000000000..aba86f1e0e0e
--- /dev/null
+++ b/games-misc/yadex/files/yadex_170-obj-overflow.patch
@@ -0,0 +1,22 @@
+--- yadex-1.7.0/src/objects.cc 2003-03-28 06:37:32.000000000 -0600
++++ yadex-1.7.0/src/objects.cc 2010-05-06 11:42:36.824661556 -0500
+@@ -543,7 +543,7 @@
+ SideDefs[last].yoff = 0;
+ strcpy (SideDefs[last].tex1, "-");
+ strcpy (SideDefs[last].tex2, "-");
+- strcpy (SideDefs[last].tex3, default_middle_texture);
++ strncpy (SideDefs[last].tex3, default_middle_texture, sizeof(SideDefs[last].tex3));
+ SideDefs[last].sector = NumSectors - 1;
+ }
+ MadeMapChanges = 1;
+--- yadex-1.7.0/src/editobj.cc 2003-04-24 15:32:39.000000000 -0500
++++ yadex-1.7.0/src/editobj.cc 2010-05-07 16:36:49.825412601 -0500
+@@ -937,7 +937,7 @@
+ struct SideDef *s = SideDefs + l->sidedef1;
+ strcpy (s->tex1, "-");
+ strcpy (s->tex2, "-");
+- strcpy (s->tex3, default_middle_texture);
++ strncpy (s->tex3, default_middle_texture, sizeof(s->tex3));
+ }
+ /* Don't delete the 2nd sidedef, it could be used
+ by another linedef. And if it isn't, the next
diff --git a/games-misc/yadex/files/yadex_170_O2.patch b/games-misc/yadex/files/yadex_170_O2.patch
new file mode 100644
index 000000000000..5ef90ca94253
--- /dev/null
+++ b/games-misc/yadex/files/yadex_170_O2.patch
@@ -0,0 +1,14 @@
+diff -dupr yadex-1.7.901-patched/src/pic2img.cc yadex-1.7.901/src/pic2img.cc
+--- yadex-1.7.901-patched/src/pic2img.cc 2006-11-06 17:35:03.000000000 +0100
++++ yadex-1.7.901/src/pic2img.cc 2015-11-24 09:54:25.578048649 +0100
+@@ -92,9 +92,9 @@ uint8_t *buf; /* This variable is s
+ should be pasted. It can be off the image buffer! */
+
+ // Locate the lump where the picture is
++ MasterDirectory dirbuf;
+ if (picloc.wad != 0)
+ {
+- MasterDirectory dirbuf;
+ dirbuf.wadfile = picloc.wad;
+ dirbuf.dir.start = picloc.ofs;
+ dirbuf.dir.size = picloc.len;
diff --git a/games-misc/yadex/files/yadex_170_wm.patch b/games-misc/yadex/files/yadex_170_wm.patch
new file mode 100644
index 000000000000..88006a28a2d4
--- /dev/null
+++ b/games-misc/yadex/files/yadex_170_wm.patch
@@ -0,0 +1,49 @@
+diff -dupr yadex-1.7.901-patched/src/gfx.cc yadex-1.7.901/src/gfx.cc
+--- yadex-1.7.901-patched/src/gfx.cc 2015-11-23 15:53:56.087783740 +0100
++++ yadex-1.7.901/src/gfx.cc 2015-11-23 22:17:45.876127582 +0100
+@@ -114,6 +114,7 @@ int win_depth; // The depth of win
+ int x_server_big_endian = 0; // Is the X server big endian ?
+ int ximage_bpp; // Number of bytes per pixels in XImages
+ int ximage_quantum;// Pad XImages lines to a multiple of that many bytes
++Atom wm_delete;
+ static pcolour_t *app_colour = 0; // Pixel values for the app. colours
+ static int DrawingMode = 0; // 0 = copy, 1 = xor
+ static int LineThickness = 0; // 0 = thin, 1 = thick
+@@ -471,6 +472,10 @@ int InitGfx (void)
+ | ExposureMask
+ | StructureNotifyMask);
+
++ // register for message from window manager if the window is closed
++ wm_delete = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
++ XSetWMProtocols(dpy, win, &wm_delete, 1);
++
+ /*
+ * Possibly load and query the font
+ */
+diff -dupr yadex-1.7.901-patched/src/gfx.h yadex-1.7.901/src/gfx.h
+--- yadex-1.7.901-patched/src/gfx.h 2005-02-06 10:45:21.000000000 +0100
++++ yadex-1.7.901/src/gfx.h 2015-11-23 22:16:10.674721105 +0100
+@@ -96,6 +96,7 @@ extern int win_bpp; // The depth of
+ extern int x_server_big_endian; // Is the X server big-endian ?
+ extern int ximage_bpp; // Number of bytes per pixels in XImages
+ extern int ximage_quantum; // Pad XImage lines to a mult of that many B.
++extern Atom wm_delete;
+ #endif // ifdef X_PROTOCOL
+ #endif // ifdef Y_X11
+ extern int text_dot; // DrawScreenText()/DrawScreenString() debug flag
+diff -dupr yadex-1.7.901-patched/src/input.cc yadex-1.7.901/src/input.cc
+--- yadex-1.7.901-patched/src/input.cc 2006-11-03 14:49:01.000000000 +0100
++++ yadex-1.7.901/src/input.cc 2015-11-23 22:15:21.398133938 +0100
+@@ -413,6 +413,12 @@ switch (ev.type)
+ }
+ #endif
+ break;
++
++ case ClientMessage:
++ if ((Atom)ev.xclient.data.l[0] == wm_delete)
++ // window has been closed, simulate ESC keypress
++ is.key = YK_ESC;
++ break;
+ }
+ } /* switch (ev.type) */
+ }
diff --git a/games-misc/yadex/yadex-1.7.0-r1.ebuild b/games-misc/yadex/yadex-1.7.0-r1.ebuild
new file mode 100644
index 000000000000..6cbfd87a8ed0
--- /dev/null
+++ b/games-misc/yadex/yadex-1.7.0-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit desktop toolchain-funcs
+
+DESCRIPTION="A Doom level (wad) editor"
+HOMEPAGE="http://www.teaser.fr/~amajorel/yadex/"
+SRC_URI="http://www.teaser.fr/~amajorel/yadex/${P}.tar.gz
+ http://www.teaser.fr/~amajorel/yadex/logo_small.png -> ${PN}.png
+ http://glbsp.sourceforge.net/yadex/Yadex_170_ALL.diff
+ https://dev.gentoo.org/~pacho/${PN}/${P}-mrmeval-differential-patch.patch
+"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+RESTRICT="test"
+
+DEPEND="x11-libs/libX11"
+RDEPEND="${DEPEND}
+ games-fps/freedoom
+"
+
+src_prepare() {
+ default
+
+ eapply "${DISTDIR}"/Yadex_170_ALL.diff
+ eapply "${DISTDIR}"/${P}-mrmeval-differential-patch.patch
+ eapply "${FILESDIR}"/*.patch
+
+ # Remove bundled boost
+ rm -rf boost/
+ # Force the patched file to be old, otherwise the compile fails
+ touch -t 197010101010 "${S}"/src/wadlist.cc
+ touch -t 197010101010 "${S}"/src/gfx.cc
+}
+
+src_configure() {
+ tc-export CC CXX LD AR RANLIB
+ # not an autoconf script
+ ./configure --prefix="/usr" || die "configure failed"
+}
+
+src_compile() {
+ emake CC="${CC}" CXX="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS} -std=gnu++03"
+}
+
+src_install() {
+ dobin obj/0/yadex
+ insinto "/usr/share/${PN}/${PV}"
+ doins ygd/*
+ doman doc/yadex.6
+ HTML_DOCS="docsrc/" einstalldocs
+ insinto /etc/yadex/${PV}
+ doins yadex.cfg
+
+ make_desktop_entry "yadex -i2 /usr/share/doom-data/freedoom/freedm.wad"
+ doicon "${DISTDIR}"/${PN}.png
+}