1 |
commit: 7bc3e53fa241aea8d83673da95d9665f22fdecee |
2 |
Author: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 1 18:25:33 2022 +0000 |
4 |
Commit: Bernard Cafarelli <voyageur <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 1 18:27:16 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7bc3e53f |
7 |
|
8 |
games-emulation/dosbox-staging: add upstream fix for failing tests |
9 |
|
10 |
With some compilers/linkers, dosbox main() function would be used in |
11 |
tests instead of gmock's one |
12 |
|
13 |
Closes: https://bugs.gentoo.org/830237 |
14 |
Package-Manager: Portage-3.0.30, Repoman-3.0.3 |
15 |
Signed-off-by: Bernard Cafarelli <voyageur <AT> gentoo.org> |
16 |
|
17 |
.../dosbox-staging/dosbox-staging-0.78.0.ebuild | 4 ++- |
18 |
.../files/dosbox-staging-0.78.0-fix_tests.patch | 31 ++++++++++++++++++++++ |
19 |
2 files changed, 34 insertions(+), 1 deletion(-) |
20 |
|
21 |
diff --git a/games-emulation/dosbox-staging/dosbox-staging-0.78.0.ebuild b/games-emulation/dosbox-staging/dosbox-staging-0.78.0.ebuild |
22 |
index 35528cd3b10a..ec44d977dad6 100644 |
23 |
--- a/games-emulation/dosbox-staging/dosbox-staging-0.78.0.ebuild |
24 |
+++ b/games-emulation/dosbox-staging/dosbox-staging-0.78.0.ebuild |
25 |
@@ -1,4 +1,4 @@ |
26 |
-# Copyright 2020-2021 Gentoo Authors |
27 |
+# Copyright 2020-2022 Gentoo Authors |
28 |
# Distributed under the terms of the GNU General Public License v2 |
29 |
|
30 |
EAPI=7 |
31 |
@@ -35,6 +35,8 @@ BDEPEND="test? ( dev-cpp/gtest )" |
32 |
|
33 |
DOCS=( AUTHORS README THANKS ) |
34 |
|
35 |
+PATCHES=( "${FILESDIR}"/${P}-fix_tests.patch ) |
36 |
+ |
37 |
src_prepare() { |
38 |
default |
39 |
|
40 |
|
41 |
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 |
42 |
new file mode 100644 |
43 |
index 000000000000..d75aad0275ff |
44 |
--- /dev/null |
45 |
+++ b/games-emulation/dosbox-staging/files/dosbox-staging-0.78.0-fix_tests.patch |
46 |
@@ -0,0 +1,31 @@ |
47 |
+From 4499e4566d2e488be1c0e0a20328b13652ed14cb Mon Sep 17 00:00:00 2001 |
48 |
+From: kcgen <kcgen@××××××××××××××××××××.com> |
49 |
+Date: Sat, 1 Jan 2022 07:48:27 -0800 |
50 |
+Subject: [PATCH] Remove the project's main to prevent masking gmock's main |
51 |
+ (#1476) |
52 |
+ |
53 |
+clang/llvm ensure gmock's main() function always overrides the main |
54 |
+function coming from the dosbox library, however sometimes with |
55 |
+gcc/ld, gmock's main() doesn't take precedent and instead dosbox's |
56 |
+main is run. |
57 |
+ |
58 |
+This fixes an issue reported on Fedora and Gentoo where unit tests |
59 |
+were popping up SDL's graphical window, and then either timing our |
60 |
+failing. |
61 |
+--- |
62 |
+ meson.build | 2 +- |
63 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
64 |
+ |
65 |
+diff --git a/meson.build b/meson.build |
66 |
+index d885da1b9..59f677b59 100644 |
67 |
+--- a/meson.build |
68 |
++++ b/meson.build |
69 |
+@@ -444,7 +444,7 @@ executable('dosbox', dosbox_sources, |
70 |
+ include_directories : incdir, |
71 |
+ install : true) |
72 |
+ # create a library so we can test things inside DOSBOX dep path |
73 |
+-libdosbox = static_library('dosbox', ['src/main.cpp', 'src/dosbox.cpp', version_file], |
74 |
++libdosbox = static_library('dosbox', ['src/dosbox.cpp', version_file], |
75 |
+ include_directories : incdir, |
76 |
+ dependencies : [atomic_dep, |
77 |
+ threads_dep, |