commit:     6e58c4bee50fb1e19375cf3fbf2a80e4db0a052c
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Tue May  2 15:55:02 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Tue May  2 16:56:17 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e58c4be

app-emulation/wine-proton: fix 7.0.6 build with mingw64 11.0.0

Mostly a dirty/quick hack, exact cause leading to this happening
with wine-proton-7(32bit) but not 8 nor 7(64bit) haven't been fully
dug into.

Had tested wine-vanilla-7.0.2 with 11.0.0 and initially thought
proton-7 was fine too, but unlike vanilla it defines __fastfail.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 .../files/wine-proton-7.0.6-mingw64-11.0.0.patch     | 20 ++++++++++++++++++++
 app-emulation/wine-proton/wine-proton-7.0.6.ebuild   |  1 +
 2 files changed, 21 insertions(+)

diff --git 
a/app-emulation/wine-proton/files/wine-proton-7.0.6-mingw64-11.0.0.patch 
b/app-emulation/wine-proton/files/wine-proton-7.0.6-mingw64-11.0.0.patch
new file mode 100644
index 000000000000..54ecc49c7235
--- /dev/null
+++ b/app-emulation/wine-proton/files/wine-proton-7.0.6-mingw64-11.0.0.patch
@@ -0,0 +1,20 @@
+Hack: this does not actually need stdarg.h, but including it ensures
+that _mingw.h will be loaded before the rest of Wine's winnt.h avoiding
+issues with mingw64-runtime-11.0.0, e.g.:
+
+    _mingw.h:602:60: error: redefinition of ‘__fastfail’
+    make[1]: *** [Makefile:5900: dlls/advapi32/crypt_des.cross.o] Error 1
+
+(other crypt_*.c happen to include stdarg.h first and don't fail, but this
+one does not, same for several other files in dlls/)
+
+Not an issue with non-proton Wine 7.0 as Wine did not define __fastfail
+until ~wine-7.10. Wine 8 does define it but does not seem to be a problem
+there (perhaps due to different header layout). A more "right" fix would
+be welcome, but given Proton-7 seems EOL it is not judged important.
+--- a/include/winnt.h
++++ b/include/winnt.h
+@@ -32,2 +32,3 @@
+ #include <string.h>
++#include <stdarg.h>
+ #endif

diff --git a/app-emulation/wine-proton/wine-proton-7.0.6.ebuild 
b/app-emulation/wine-proton/wine-proton-7.0.6.ebuild
index 2c927df19297..0479380661a8 100644
--- a/app-emulation/wine-proton/wine-proton-7.0.6.ebuild
+++ b/app-emulation/wine-proton/wine-proton-7.0.6.ebuild
@@ -117,6 +117,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-7.0.4-noexecstack.patch
        "${FILESDIR}"/${PN}-7.0.4-restore-menubuilder.patch
        "${FILESDIR}"/${PN}-7.0.4-unwind.patch
+       "${FILESDIR}"/${PN}-7.0.6-mingw64-11.0.0.patch
 )
 
 pkg_pretend() {

Reply via email to