summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzamat H. Hackimov <azamat.hackimov@gmail.com>2019-01-05 21:11:13 +0300
committerJames Le Cuirot <chewi@gentoo.org>2019-01-05 19:43:35 +0000
commite17dcd37000234ba0ae79246a09d5c09ff33a16e (patch)
tree0d413370002544dbfb3b8df7556c4f18ddc44baf /games-emulation
parentnet-misc/mosh: Add libressl USE flag to 9999 ebuild (diff)
downloadgentoo-e17dcd37000234ba0ae79246a09d5c09ff33a16e.tar.gz
gentoo-e17dcd37000234ba0ae79246a09d5c09ff33a16e.tar.bz2
gentoo-e17dcd37000234ba0ae79246a09d5c09ff33a16e.zip
games-emulation/dosbox: fix for xorg 1.20 issue
* Added patch for xorg 1.20 issue (https://sourceforge.net/p/dosbox/code-0/4177/). * Changed HOMEPAGE Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com> Package-Manager: Portage-2.3.51, Repoman-2.3.11 Closes: https://github.com/gentoo/gentoo/pull/10747 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'games-emulation')
-rw-r--r--games-emulation/dosbox/dosbox-0.74_p20160629-r3.ebuild75
-rw-r--r--games-emulation/dosbox/dosbox-9999.ebuild4
-rw-r--r--games-emulation/dosbox/files/dosbox-0.74.2_events.patch37
3 files changed, 114 insertions, 2 deletions
diff --git a/games-emulation/dosbox/dosbox-0.74_p20160629-r3.ebuild b/games-emulation/dosbox/dosbox-0.74_p20160629-r3.ebuild
new file mode 100644
index 000000000000..140ff29f6f0c
--- /dev/null
+++ b/games-emulation/dosbox/dosbox-0.74_p20160629-r3.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools desktop flag-o-matic
+
+PATCH=3989
+GLIDE_PATCH=3722fc563b737d2d7933df6a771651c2154e6f7b
+
+DESCRIPTION="DOS emulator"
+HOMEPAGE="https://www.dosbox.com/"
+SRC_URI="mirror://gentoo/dosbox-code-0-${PATCH}-dosbox-trunk.zip
+ glide? ( https://raw.githubusercontent.com/voyageur/openglide/${GLIDE_PATCH}/platform/dosbox/dosbox_glide.diff -> dosbox_glide-${GLIDE_PATCH}.diff )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc64 ~x86"
+IUSE="alsa +core-inline debug glide hardened opengl X"
+
+RDEPEND="alsa? ( media-libs/alsa-lib )
+ glide? ( media-libs/openglide )
+ opengl? ( virtual/glu virtual/opengl )
+ debug? ( sys-libs/ncurses:0 )
+ X? ( x11-libs/libX11 )
+ media-libs/libpng:0=
+ media-libs/libsdl[joystick,opengl?,video,X?]
+ media-libs/sdl-net
+ media-libs/sdl-sound
+ sys-libs/zlib"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S=${WORKDIR}/${PN}-code-0-${PATCH}-dosbox-trunk
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.74-gcc46.patch"
+ "${FILESDIR}/${PN}-0.74.2_events.patch"
+)
+
+src_prepare() {
+ use glide && eapply "${DISTDIR}"/dosbox_glide-${GLIDE_PATCH}.diff
+ default
+ eautoreconf
+}
+
+src_configure() {
+ use glide && append-cppflags -I"${EPREFIX}"/usr/include/openglide
+
+ ac_cv_lib_X11_main=$(usex X yes no) \
+ econf \
+ $(use_enable alsa alsa-midi) \
+ $(use_enable core-inline) \
+ $(use_enable !hardened dynamic-core) \
+ $(use_enable !hardened dynamic-x86) \
+ $(use_enable debug) \
+ $(use_enable opengl)
+}
+
+src_install() {
+ default
+ make_desktop_entry dosbox DOSBox /usr/share/pixmaps/dosbox.ico
+ doicon src/dosbox.ico
+}
+
+pkg_postinst() {
+ if use glide; then
+ elog "You have enabled unofficial Glide emulation. To use this, symlink"
+ elog "or copy ${EPREFIX}/usr/share/openglide/glide2x-dosbox.ovl to your game's"
+ elog "directory and add the following to your DOSBox configuration."
+ elog ""
+ elog "[glide]"
+ elog "glide=true"
+ fi
+}
diff --git a/games-emulation/dosbox/dosbox-9999.ebuild b/games-emulation/dosbox/dosbox-9999.ebuild
index 421603aa2fd0..8c4711e5620c 100644
--- a/games-emulation/dosbox/dosbox-9999.ebuild
+++ b/games-emulation/dosbox/dosbox-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -17,7 +17,7 @@ else
fi
DESCRIPTION="DOS emulator"
-HOMEPAGE="http://dosbox.sourceforge.net/"
+HOMEPAGE="https://www.dosbox.com/"
LICENSE="GPL-2"
SLOT="0"
diff --git a/games-emulation/dosbox/files/dosbox-0.74.2_events.patch b/games-emulation/dosbox/files/dosbox-0.74.2_events.patch
new file mode 100644
index 000000000000..fee09a65a4ce
--- /dev/null
+++ b/games-emulation/dosbox/files/dosbox-0.74.2_events.patch
@@ -0,0 +1,37 @@
+Index: src/gui/sdlmain.cpp
+===================================================================
+--- a/src/gui/sdlmain.cpp (revision 4177)
++++ b/src/gui/sdlmain.cpp (working copy)
+@@ -1426,6 +1426,12 @@
+ #define DB_POLLSKIP 1
+ #endif
+
++#if defined(LINUX)
++#define SDL_XORG_FIX 1
++#else
++#define SDL_XORG_FIX 0
++#endif
++
+ void GFX_Events() {
+ //Don't poll too often. This can be heavy on the OS, especially Macs.
+ //In idle mode 3000-4000 polls are done per second without this check.
+@@ -1449,6 +1455,19 @@
+ }
+ #endif
+ while (SDL_PollEvent(&event)) {
++#if SDL_XORG_FIX
++ // Special code for broken SDL with Xorg 1.20.1, where pairs of inputfocus gain and loss events are generated
++ // when locking the mouse in windowed mode.
++ if (event.type == SDL_ACTIVEEVENT && event.active.state == SDL_APPINPUTFOCUS && event.active.gain == 0) {
++ SDL_Event test; //Check if the next event would undo this one.
++ if (SDL_PeepEvents(&test,1,SDL_PEEKEVENT,SDL_ACTIVEEVENTMASK) == 1 && test.active.state == SDL_APPINPUTFOCUS && test.active.gain == 1) {
++ // Skip both events.
++ SDL_PeepEvents(&test,1,SDL_GETEVENT,SDL_ACTIVEEVENTMASK);
++ continue;
++ }
++ }
++#endif
++
+ switch (event.type) {
+ case SDL_ACTIVEEVENT:
+ if (event.active.state & SDL_APPINPUTFOCUS) {