commit:     7bc3e53fa241aea8d83673da95d9665f22fdecee
Author:     Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
AuthorDate: Sat Jan  1 18:25:33 2022 +0000
Commit:     Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
CommitDate: Sat Jan  1 18:27:16 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7bc3e53f

games-emulation/dosbox-staging: add upstream fix for failing tests

With some compilers/linkers, dosbox main() function would be used in
tests instead of gmock's one

Closes: https://bugs.gentoo.org/830237
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Bernard Cafarelli <voyageur <AT> gentoo.org>

 .../dosbox-staging/dosbox-staging-0.78.0.ebuild    |  4 ++-
 .../files/dosbox-staging-0.78.0-fix_tests.patch    | 31 ++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/games-emulation/dosbox-staging/dosbox-staging-0.78.0.ebuild 
b/games-emulation/dosbox-staging/dosbox-staging-0.78.0.ebuild
index 35528cd3b10a..ec44d977dad6 100644
--- a/games-emulation/dosbox-staging/dosbox-staging-0.78.0.ebuild
+++ b/games-emulation/dosbox-staging/dosbox-staging-0.78.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2020-2021 Gentoo Authors
+# Copyright 2020-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -35,6 +35,8 @@ BDEPEND="test? ( dev-cpp/gtest )"
 
 DOCS=( AUTHORS README THANKS )
 
+PATCHES=( "${FILESDIR}"/${P}-fix_tests.patch )
+
 src_prepare() {
        default
 

diff --git 
a/games-emulation/dosbox-staging/files/dosbox-staging-0.78.0-fix_tests.patch 
b/games-emulation/dosbox-staging/files/dosbox-staging-0.78.0-fix_tests.patch
new file mode 100644
index 000000000000..d75aad0275ff
--- /dev/null
+++ b/games-emulation/dosbox-staging/files/dosbox-staging-0.78.0-fix_tests.patch
@@ -0,0 +1,31 @@
+From 4499e4566d2e488be1c0e0a20328b13652ed14cb Mon Sep 17 00:00:00 2001
+From: kcgen <kc...@users.noreply.github.com>
+Date: Sat, 1 Jan 2022 07:48:27 -0800
+Subject: [PATCH] Remove the project's main to prevent masking gmock's main
+ (#1476)
+
+clang/llvm ensure gmock's main() function always overrides the main
+function coming from the dosbox library, however sometimes with
+gcc/ld, gmock's main() doesn't take precedent and instead dosbox's
+main is run.
+
+This fixes an issue reported on Fedora and Gentoo where unit tests
+were popping up SDL's graphical window, and then either timing our
+failing.
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index d885da1b9..59f677b59 100644
+--- a/meson.build
++++ b/meson.build
+@@ -444,7 +444,7 @@ executable('dosbox', dosbox_sources,
+            include_directories : incdir,
+            install : true)
+ # create a library so we can test things inside DOSBOX dep path
+-libdosbox = static_library('dosbox', ['src/main.cpp', 'src/dosbox.cpp', 
version_file],
++libdosbox = static_library('dosbox', ['src/dosbox.cpp', version_file],
+                         include_directories : incdir,
+                         dependencies : [atomic_dep,
+                                         threads_dep,

Reply via email to