summaryrefslogtreecommitdiff
path: root/app-emulation/dosemu
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /app-emulation/dosemu
reinit the tree, so we can have metadata
Diffstat (limited to 'app-emulation/dosemu')
-rw-r--r--app-emulation/dosemu/Manifest13
-rw-r--r--app-emulation/dosemu/dosemu-1.4.1_pre20130107-r3.ebuild87
-rw-r--r--app-emulation/dosemu/dosemu-1.4.1_pre20130107-r4.ebuild103
-rw-r--r--app-emulation/dosemu/files/dosemu-1.4.1_pre20091009-dash.patch10
-rw-r--r--app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fix-inline.patch14
-rw-r--r--app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-flex-2.6.3.patch15
-rw-r--r--app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fortify.patch48
-rw-r--r--app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-ia16-ldflags.patch45
-rw-r--r--app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-no-glibc.patch18
-rw-r--r--app-emulation/dosemu/metadata.xml14
10 files changed, 367 insertions, 0 deletions
diff --git a/app-emulation/dosemu/Manifest b/app-emulation/dosemu/Manifest
new file mode 100644
index 000000000000..65f421998b70
--- /dev/null
+++ b/app-emulation/dosemu/Manifest
@@ -0,0 +1,13 @@
+AUX dosemu-1.4.1_pre20091009-dash.patch 395 SHA256 75581a12062da86b199ae9b3a4a2413a6673635f6e32ca15d4ad6aa9608e5e15 SHA512 a520a6e71d7852035cf61e554cf0e9a10a61ffb1c908d7818507516f1674f59a30c46e47bf246c9113b03a0932b97e5f8cba12d69366466ea3f9b952742ae2cf WHIRLPOOL 228307318f9e7ea873a7c918b49b7694d637a3ef24ac84253cf27badac782f2d5cf21dee514b2f3886b45e97906b080e32fc4fe4fd4a881288dd6aafe15a2a3e
+AUX dosemu-1.4.1_pre20130107-fix-inline.patch 560 SHA256 4579c5dfbe7b535e1596dc48facd436c400a39ffb1767b867aef617a2ebfabc1 SHA512 66f3e9a119fb0f80d311d46af6e980ce2f519f389317391746805b875eaecf2f0f714f726e2d6306345c7f68c3e2b2432f8adb16a72a51faf49067ac618e1424 WHIRLPOOL 8b708af81f446820349a4dadc7fe92367cfdfca7d3e5603de847e0b7248d7cfca4808350b79455cee92b4ddc091e7bd67a3fc77534b168810440922c5f3cbd3e
+AUX dosemu-1.4.1_pre20130107-flex-2.6.3.patch 463 SHA256 8ebcc3b50a6128e1401f7d05ec44c05fef2435b2d7e307356970ef9ccf40ac21 SHA512 51674b60fb341f56c7120a9349c9890a9770cdef524ae3ccf6795769fde31823b2b57aaaafd6111c236550c16caf53246773dda1cd71639887ffaa7093d95cc0 WHIRLPOOL 95ee2eb2ae5d15b1837de1aa463ffc25607436d0e6580323cb77094f8ec73dc8dc010ae7ca0eb0b217e67bcaf158cac85ba4614bb3d180f9f12593b3f78f31ca
+AUX dosemu-1.4.1_pre20130107-fortify.patch 1961 SHA256 fdb67267e5fc45de64567605078a29738ad507a16716ae0d77a70a1815166790 SHA512 90a5dbc6b00d2b13086c15997cf056e1a54721518a76a85425c7adb6d859782e26391c28386e847fd914a01f0c243615c21c1317a58c19ed9603133e0256971a WHIRLPOOL 62bbfb3de8d26101b220757af27d1c80c0401e270aaf545b2be9fe0002d38062b81517e49a809b88bfb3e82e14691c0693f556b272c630a05e59e2bdf4dd93d5
+AUX dosemu-1.4.1_pre20130107-ia16-ldflags.patch 1688 SHA256 5fdc3975d0c764204369697f1099451f58ba6acc16f61fd70be5782e69de95a3 SHA512 7f88cfb8719061ead6fd7200c768263346bb7b1f8ce7a8f091607e445b53c468edc1bfc55d30c44513ba8361acad8c05d161774fdc90dae01ebc09a567e02bab WHIRLPOOL e5fa1b8108a6723a9dbb3c79eb8d6908ada248d9f6215a29e805cddaf604550d1c3251b0679dbba67e44983250425ff3f637419be11aa6618ddce31c7077c789
+AUX dosemu-1.4.1_pre20130107-no-glibc.patch 559 SHA256 29e59d4049e0af0ff8d97478a1e06091bea5ec700503877c4814d538fdaf70b7 SHA512 c53e3f7ed1b7a74e1112ea5507d0912ef1d16ff657aa5a03132f6b4c35ddb638ecde40ef554254f429316ffd74fc2d8afb59548d97547eeed231c80c0c057eed WHIRLPOOL 1a08dafc08d01bc168a8bcc760966246c34003ebf271fc7b13a44afaabcff8fc8efa7d4a6b4fb72a67ea9800618adae75573ee2a602bd1d08cd26c5789d73fd5
+DIST dosemu-1.4.1_pre20130107.zip 2767256 SHA256 072e1d8ea9c574b02e556d926a287c9c55b82384ed652bb8dd6f3488801901aa SHA512 eb8dcb914a74b235f2b37ff4dd5c1c84b4916ff195c7bf76cdbe6a4d5e6247c57297eef0c579f219ff7f475e727d66fa5a0f314da46d79cc97a0d794e9ad5864 WHIRLPOOL d2835f82515e40d3c85c1ee53c7add5ba055637864ee63997ec912f53862006e33b4139a253b98cb76ca3cdbd7bdca6614609d9e8e716b074283e77cd8105e3c
+DIST dosemu-freedos-1.0-bin.tgz 1205628 SHA256 080c306a1b611e1861fd64466062f268eb44d2bf38082b8a57efadb5a9c0ebc7 SHA512 d0c4235ceac55de63ce5f72e51b7d57a82b8104f4bf2df6f4dc25c9889d3337b40d75665c2dfc98492ec7123e0959a725f5c7579e145895024bd80a07036e3bd WHIRLPOOL 9e6acf38dc8fafe95a49baaaac2a97fdd02c508b7c30c60823f8af7f44aa62b8d82c92661640b4cef05fcdbea401fafea752ec4a0e439a8eff361dd41aa392d3
+EBUILD dosemu-1.4.1_pre20130107-r3.ebuild 2210 SHA256 7f564ae5815adbb8093b5b0e200ad159db4866dd7826a87a52f4e097a86678b8 SHA512 8eec21fcc4f82567453f3d8c3a9e89a9c49090c6324b9a728336f95c036d329d180fc9ad47888b0dd0fb4175b12010e61da9b9ab910506fa36ccb394b2bb4e11 WHIRLPOOL b67e61c399c17ff18bd3d400eb8bc58a2663f39f850eb63fecf8ca5a496eda266e70aafe7ad982baaabded99c1fa979bd043caceb53393c20333f16c7761852c
+EBUILD dosemu-1.4.1_pre20130107-r4.ebuild 2528 SHA256 fe335134854d8d3a46745db9c7dfc429c498b30411414699ef4c1c4130ed9f84 SHA512 fef7eade74a2c124b28029bd81ad1e9976b3578ea05a94e8a09b725b2c2cc181fcfb14ac90d5e9a778271d8aa97e7d29d754b412714bbae2cf1cb535d23439e7 WHIRLPOOL 09f2385797b7763f272ea7ef54cd69e9ac42ecc2af884b7c83903db7bd62de8e68bf9d04b0842f6472aec8f31a010c69667ff5c1b7b26b9b6255f3c3ca9b3e4a
+MISC ChangeLog 4068 SHA256 b2fbf8843568f1ac97c02c178d3299d7e15a72c4d30e52162d741cac620e5f42 SHA512 37e3c8d1f247d2b7a54ce1537ad70f46fe97d53a0acacdba3f8c53c455a365d5feada5c0fa5f9195898a6876e665d6316bb592381dbc0891c828d2d0529933bc WHIRLPOOL 7bd2a2608b06a0a14152102d9a286fdfca527b807824c65f7d50c99502dc56952f281b0880f3d85d3052d8d6de3a36413bf9edbaeb1c405b441baf0bf7cc8aee
+MISC ChangeLog-2015 9124 SHA256 29bdd1f0271a8d9bb3cb211565ce34d27738229d11c12c4a52e54906d9ede5ac SHA512 9b70931aed528f1279c4e9e726fae2fad45b5fc6c8c6c28e46ca2048fae1b089fab8f36dc0bb285fa85f2b445d52620e38c16337a58b08571ccae5e4705b50a3 WHIRLPOOL 344e78ca239fd94b030fa076ed23395f01c09be31825caf89c7c558ab4a43ef49e134ddd4ebd124a1a8fd070f00766f8f25365fe38c1d98a831c246befc36fab
+MISC metadata.xml 432 SHA256 eee767a8db09c9f12d83195219073e5895d157b096d59308ea31c2d9313a93bc SHA512 da0538836dc326d714141ab6c7b9f00bc1604fa5b51df7d9d548a8e3d889072b3ee8890a25705e2a7c2c1c31645c0b9af85ce6a2d1e4aa142a4d83a08fd6f9d8 WHIRLPOOL 70837a0b55b4b70b260844cb6f5a69e4e12994d3aa7533c7f4638ee09caad18ccbaf02a2c51503c68a1982b89a803b6a0b1017ef59db1ced562b6b51c1c6e4b4
diff --git a/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r3.ebuild b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r3.ebuild
new file mode 100644
index 000000000000..59a9fdf16d5e
--- /dev/null
+++ b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r3.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+inherit autotools eutils flag-o-matic pax-utils toolchain-funcs
+
+P_FD="dosemu-freedos-1.0-bin"
+COMMIT="15cfb41ff20a052769d753c3262c57ecb050ad71"
+
+DESCRIPTION="DOS Emulator"
+HOMEPAGE="http://www.dosemu.org/"
+SRC_URI="mirror://sourceforge/dosemu/${P_FD}.tgz
+ https://sourceforge.net/code-snapshots/git/d/do/dosemu/code.git/dosemu-code-${COMMIT}.zip -> ${P}.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* amd64 x86"
+IUSE="X svga gpm debug alsa sndfile fluidsynth"
+
+RDEPEND="X? ( x11-libs/libX11
+ x11-libs/libXxf86vm
+ x11-libs/libXau
+ x11-libs/libXext
+ x11-libs/libXdmcp
+ x11-apps/xset
+ x11-apps/xlsfonts
+ x11-apps/bdftopcf
+ x11-apps/mkfontdir )
+ svga? ( media-libs/svgalib )
+ gpm? ( sys-libs/gpm )
+ alsa? ( media-libs/alsa-lib )
+ sndfile? ( media-libs/libsndfile )
+ fluidsynth? ( media-sound/fluidsynth
+ media-sound/fluid-soundfont )
+ media-libs/libsdl
+ >=sys-libs/slang-1.4"
+
+DEPEND="${RDEPEND}
+ X? ( x11-proto/xf86dgaproto )
+ >=sys-devel/autoconf-2.57"
+
+S="${WORKDIR}/${PN}-code-${COMMIT}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-fortify.patch
+ epatch "${FILESDIR}"/${PN}-1.4.1_pre20091009-dash.patch
+ epatch "${FILESDIR}"/${P}-no-glibc.patch
+ epatch "${FILESDIR}"/${P}-flex-2.6.3.patch
+
+ epatch_user
+
+ # Has problems with -O3 on some systems
+ replace-flags -O[3-9] -O2
+
+ # This one is from media-sound/fluid-soundfont (bug #479534)
+ sed "s,/usr/share/soundfonts/default.sf2,${EPREFIX}/usr/share/sounds/sf2/FluidR3_GM.sf2,"\
+ -i src/plugin/fluidsynth/mid_o_flus.c || die
+
+ eautoreconf
+}
+
+src_configure() {
+ econf $(use_with X x) \
+ $(use_with svga svgalib) \
+ $(use_enable debug) \
+ $(use_with gpm) \
+ $(use_with alsa) \
+ $(use_with sndfile) \
+ $(use_with fluidsynth) \
+ --with-fdtarball="${DISTDIR}"/${P_FD}.tgz \
+ --sysconfdir="${EPREFIX}"/etc/dosemu/ \
+ --with-docdir="${EPREFIX}"/usr/share/doc/${PF}
+}
+
+src_compile() {
+ emake AR=$(tc-getAR)
+}
+
+src_install() {
+ default
+
+ # r - randmmap: dosemu tries to get address mapping
+ # exactly where asked, loops otherwise.
+ # m - allow RWX mapping: as it's an emulator / code loader
+ pax-mark -mr "${ED}/usr/bin/dosemu.bin"
+}
diff --git a/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r4.ebuild b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r4.ebuild
new file mode 100644
index 000000000000..67e228d97944
--- /dev/null
+++ b/app-emulation/dosemu/dosemu-1.4.1_pre20130107-r4.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools eutils flag-o-matic pax-utils toolchain-funcs
+
+P_FD="dosemu-freedos-1.0-bin"
+COMMIT="15cfb41ff20a052769d753c3262c57ecb050ad71"
+
+DESCRIPTION="DOS Emulator"
+HOMEPAGE="http://www.dosemu.org/"
+SRC_URI="mirror://sourceforge/dosemu/${P_FD}.tgz
+ https://sourceforge.net/code-snapshots/git/d/do/dosemu/code.git/dosemu-code-${COMMIT}.zip -> ${P}.zip"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="X svga gpm debug alsa sndfile fluidsynth"
+
+RDEPEND="X? ( x11-libs/libX11
+ x11-libs/libXxf86vm
+ x11-libs/libXau
+ x11-libs/libXext
+ x11-libs/libXdmcp
+ x11-apps/xset
+ x11-apps/xlsfonts
+ x11-apps/bdftopcf
+ x11-apps/mkfontdir )
+ svga? ( media-libs/svgalib )
+ gpm? ( sys-libs/gpm )
+ alsa? ( media-libs/alsa-lib )
+ sndfile? ( media-libs/libsndfile )
+ fluidsynth? ( media-sound/fluidsynth
+ media-sound/fluid-soundfont )
+ media-libs/libsdl
+ >=sys-libs/slang-1.4"
+
+DEPEND="${RDEPEND}
+ X? ( x11-proto/xf86dgaproto )
+ >=sys-devel/autoconf-2.57"
+
+S="${WORKDIR}/${PN}-code-${COMMIT}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fortify.patch
+ "${FILESDIR}"/${PN}-1.4.1_pre20091009-dash.patch
+ "${FILESDIR}"/${P}-no-glibc.patch
+ "${FILESDIR}"/${P}-flex-2.6.3.patch
+ "${FILESDIR}"/${P}-ia16-ldflags.patch
+ "${FILESDIR}"/${P}-fix-inline.patch
+)
+
+src_prepare() {
+ default
+
+ # Has problems with -O3 on some systems
+ replace-flags -O[3-9] -O2
+
+ # This one is from media-sound/fluid-soundfont (bug #479534)
+ sed "s,/usr/share/soundfonts/default.sf2,${EPREFIX}/usr/share/sounds/sf2/FluidR3_GM.sf2,"\
+ -i src/plugin/fluidsynth/mid_o_flus.c || die
+
+ eautoreconf
+}
+
+src_configure() {
+ # workaround binutils ld.gold bug #618366
+ local nopie_flag=
+ if tc-enables-pie; then
+ if gcc-specs-pie; then
+ # before gcc got upstream support for '-no-pie'
+ nopie_flag=-nopie
+ else
+ nopie_flag=-no-pie
+ fi
+ fi
+
+ econf $(use_with X x) \
+ $(use_with svga svgalib) \
+ $(use_enable debug) \
+ $(use_with gpm) \
+ $(use_with alsa) \
+ $(use_with sndfile) \
+ $(use_with fluidsynth) \
+ --with-fdtarball="${DISTDIR}"/${P_FD}.tgz \
+ --sysconfdir="${EPREFIX}"/etc/dosemu/ \
+ --with-docdir="${EPREFIX}"/usr/share/doc/${PF} \
+ IA16_LDFLAGS_EXTRA=${nopie_flag}
+}
+
+src_compile() {
+ emake AR=$(tc-getAR)
+}
+
+src_install() {
+ default
+
+ # r - randmmap: dosemu tries to get address mapping
+ # exactly where asked, loops otherwise.
+ # m - allow RWX mapping: as it's an emulator / code loader
+ pax-mark -mr "${ED}/usr/bin/dosemu.bin"
+}
diff --git a/app-emulation/dosemu/files/dosemu-1.4.1_pre20091009-dash.patch b/app-emulation/dosemu/files/dosemu-1.4.1_pre20091009-dash.patch
new file mode 100644
index 000000000000..c48712e68661
--- /dev/null
+++ b/app-emulation/dosemu/files/dosemu-1.4.1_pre20091009-dash.patch
@@ -0,0 +1,10 @@
+Dash does not support 'echo -n' and breaks default config sourcing.
+diff --git a/default-configure b/default-configure
+index 9e4b78b..a749f63 100755
+--- a/default-configure
++++ b/default-configure
+@@ -30,3 +30,3 @@ done
+ CONF=`cat $CONF_FILE`
+-CONF=`echo -n "$CONF"| sed '/^config {/d' | sed '/^}/d' | tr '\n' ' ' `
++CONF=`printf "%s" "$CONF"| sed '/^config {/d' | sed '/^}/d' | tr '\n' ' ' `
+
diff --git a/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fix-inline.patch b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fix-inline.patch
new file mode 100644
index 000000000000..9a515941b812
--- /dev/null
+++ b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fix-inline.patch
@@ -0,0 +1,14 @@
+diff --git a/src/dosext/sound/sound.c b/src/dosext/sound/sound.c
+index f33f78f..f429362 100644
+--- a/src/dosext/sound/sound.c
++++ b/src/dosext/sound/sound.c
+@@ -173,3 +173,3 @@ void sb_cms_write (ioport_t port, Bit8u value);
+
+-inline void sb_mixer_register_write (Bit8u value);
++static inline void sb_mixer_register_write (Bit8u value);
+ void sb_mixer_data_write (Bit8u value);
+@@ -840,3 +840,3 @@ void sb_cms_write (ioport_t port, Bit8u value)
+
+-inline void sb_mixer_register_write (Bit8u value)
++static inline void sb_mixer_register_write (Bit8u value)
+ {
diff --git a/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-flex-2.6.3.patch b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-flex-2.6.3.patch
new file mode 100644
index 000000000000..de5b00b783cf
--- /dev/null
+++ b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-flex-2.6.3.patch
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/604610
+
+New flex seems to define yywrap even for non-yywrap lexers.
+diff --git a/src/base/init/lexer.l.in b/src/base/init/lexer.l.in
+index aeaa2e2..9e42ddf 100644
+--- a/src/base/init/lexer.l.in
++++ b/src/base/init/lexer.l.in
+@@ -810,7 +810,2 @@ static void enter_includefile(char * fname)
+
+-
+-#ifdef yywrap
+- error "yywrap defined elsewere, need our own one"
+-#endif
+-
+ int yywrap(void) /* this gets called at EOF of a parsed file */
diff --git a/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fortify.patch b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fortify.patch
new file mode 100644
index 000000000000..5daa4e9fee41
--- /dev/null
+++ b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-fortify.patch
@@ -0,0 +1,48 @@
+From ff9bea065f4cc6068dcb8d6ea9423105305ca590 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Mon, 5 Aug 2013 13:03:21 +0300
+Subject: [PATCH] src/tools/tools86.c: fix stack buffer overflow in
+ 'change_aout'
+
+Detected by gcc:
+
+gcc -std=gnu99 -c -MP -MMD -I../../src/include -I../../src/plugin/include -Wall -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -pipe -O2 -fomit-frame-pointer -o tools86.o tools86.c
+In file included from /usr/include/stdio.h:937:0,
+ from tools86.c:98:
+ In function 'fread',
+ inlined from 'change_aout.constprop.1' at tools86.c:174:12,
+ inlined from 'main' at tools86.c:391:18:
+ /usr/include/bits/stdio2.h:293:2: warning: call to '__fread_chk_warn' declared with attribute warning: fread called with bigger size * nmemb than length of destination buffer [enabled by default]
+ return __fread_chk_warn (__ptr, __bos0 (__ptr), __size, __n, __stream);
+ ^
+Gentoo-bug: http://bugs.gentoo.org/343577
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ src/tools/tools86.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/tools/tools86.c b/src/tools/tools86.c
+index 141610d..35a0b96 100644
+--- a/src/tools/tools86.c
++++ b/src/tools/tools86.c
+@@ -137,7 +137,7 @@ struct bsd_header { /* a.out header */
+ #endif
+
+ #ifdef __linux__
+-static int header_ld86out_to_gnuasout(struct bsd_header *bsd, struct gnu_header *gnu)
++static int header_ld86out_to_gnuasout(const struct bsd_header *bsd, struct gnu_header *gnu)
+ {
+ if (bsd->a_magic[0] != 0x01 || bsd->a_magic[1] != 0x03 ||
+ bsd->a_flags != 0x00 || bsd->a_cpu != 0x10) return -1;
+@@ -171,7 +171,7 @@ static int change_aout(char *objfile, int update_symtable)
+ return errno;
+ }
+ #ifdef __linux__
+- if (fread(&bsd,sizeof(gnu),1,f) != 1 ) {
++ if (fread(&bsd,sizeof(bsd),1,f) != 1 ) {
+ fclose(f);
+ return -1;
+ }
+--
+1.8.3.2
+
diff --git a/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-ia16-ldflags.patch b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-ia16-ldflags.patch
new file mode 100644
index 000000000000..0e2393cc2741
--- /dev/null
+++ b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-ia16-ldflags.patch
@@ -0,0 +1,45 @@
+Add a @IA16_LDFLAGS_EXTRA@ environment variable
+to be able to pass through -no-pie.
+
+It's a workaround for binutils ld.gold bug:
+https://bugs.gentoo.org/618366
+diff --git a/Makefile.conf.in b/Makefile.conf.in
+index cd4b34d..cc29931 100644
+--- a/Makefile.conf.in
++++ b/Makefile.conf.in
+@@ -55,2 +55,4 @@ ALL_LDFLAGS:=@DOSEMU_LDFLAGS@ ${LDFLAGS}
+ DOSBIN_LDFLAGS:=@DOSBIN_LDFLAGS@
++# flags to "link" 16-bit .com files
++IA16_LDFLAGS:=-Wl,-Ttext,0x100,-e,_start16,--oformat,binary -nostdlib -s @IA16_LDFLAGS_EXTRA@
+ LIBS:=@LIBS@
+diff --git a/configure.ac b/configure.ac
+index 0f06f57..a86208e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -604,2 +604,3 @@ AC_SUBST(X_LIBS)
+ AC_SUBST(X_CFLAGS)
++AC_SUBST(IA16_LDFLAGS_EXTRA)
+
+diff --git a/src/commands/Makefile b/src/commands/Makefile
+index 3139b85..c5c4607 100644
+--- a/src/commands/Makefile
++++ b/src/commands/Makefile
+@@ -56,3 +56,3 @@ dosbin: $(COM1) $(COM2) $(SYS)
+ $(D)/%.sys: %.o
+- $(LD) $(ALL_LDFLAGS) -Wl,-Ttext,0,-e,_start16,--oformat,binary -nostdlib -s -o $@ $<
++ $(LD) $(ALL_LDFLAGS) $(IA16_LDFLAGS) -o $@ $<
+ chmod -x $@
+@@ -60,3 +60,3 @@ $(D)/%.sys: %.o
+ $(D)/%.com: %.o
+- $(LD) $(ALL_LDFLAGS) -Wl,-Ttext,100,-e,_start16,--oformat,binary -nostdlib -s -o $@ $<
++ $(LD) $(ALL_LDFLAGS) $(IA16_LDFLAGS) -o $@ $<
+ chmod -x $@
+diff --git a/src/plugin/commands/Makefile b/src/plugin/commands/Makefile
+index 48f49d5..d3a5667 100644
+--- a/src/plugin/commands/Makefile
++++ b/src/plugin/commands/Makefile
+@@ -57,3 +57,3 @@ $(STUBFULL): $(D)/generic.com ./mkcomstub
+ $(D)/%.com: %.o
+- $(LD) $(ALL_LDFLAGS) -Wl,-Ttext,0x100,-e,_start16,--oformat,binary -nostdlib -s -o $@ $<
++ $(LD) $(ALL_LDFLAGS) $(IA16_LDFLAGS) -o $@ $<
+ chmod -x $@
diff --git a/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-no-glibc.patch b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-no-glibc.patch
new file mode 100644
index 000000000000..7c5b8a50a094
--- /dev/null
+++ b/app-emulation/dosemu/files/dosemu-1.4.1_pre20130107-no-glibc.patch
@@ -0,0 +1,18 @@
+The check has no AC_MGS_RESULT finish helper
+and gets called as
+ set ``
+on gcc-6 which clutters ./configure output.
+
+One of fallouts of https://bugs.gentoo.org/598798
+diff --git a/configure.ac b/configure.ac
+index 34a7f71..0f06f57 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -574,7 +574,2 @@ if test "$GCC" = "yes" ; then
+
+- AC_MSG_CHECKING(for glibc...)
+- set `printf '%b\n' '#include <features.h>\nXXAaZZ __GLIBC__'|${CC-cc} -E -|awk '/XXAaZZ/ {print $2}'`
+- if test "$1" = "__GLIBC__"; then
+- AC_MSG_ERROR([Sorry, you need glibc.])
+- fi
+ fi
diff --git a/app-emulation/dosemu/metadata.xml b/app-emulation/dosemu/metadata.xml
new file mode 100644
index 000000000000..02fe93487b16
--- /dev/null
+++ b/app-emulation/dosemu/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>slyfox@gentoo.org</email>
+ <name>Sergei Trofimovich</name>
+ </maintainer>
+ <use>
+ <flag name="fluidsynth">use <pkg>media-sound/fluidsynth</pkg> for MIDI emulation</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">dosemu</remote-id>
+ </upstream>
+</pkgmetadata>