commit:     f4db3c824ac162b28dfdb3d57645fc120a856624
Author:     Jimi Huotari <chiitoo <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 17 00:18:59 2020 +0000
Commit:     Jimi Huotari <chiitoo <AT> gentoo <DOT> org>
CommitDate: Tue Nov 24 03:16:43 2020 +0000
URL:        https://gitweb.gentoo.org/repo/proj/wine.git/commit/?id=f4db3c82

app-emulation/wine-vanilla: add USE="mingw"

Using MinGW to build PE files has become more or less a requirement
for some applications to still run via Wine, so let's not
hard-disable it any longer.

Bug: https://bugs.gentoo.org/736657
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Jimi Huotari <chiitoo <AT> gentoo.org>

 app-emulation/wine-vanilla/metadata.xml            |  1 +
 ...lla-9999.ebuild => wine-vanilla-5.22-r1.ebuild} | 33 ++++++++++++++++++++--
 .../wine-vanilla/wine-vanilla-9999.ebuild          | 33 ++++++++++++++++++++--
 3 files changed, 63 insertions(+), 4 deletions(-)

diff --git a/app-emulation/wine-vanilla/metadata.xml 
b/app-emulation/wine-vanilla/metadata.xml
index 03b0000..7467ea2 100644
--- a/app-emulation/wine-vanilla/metadata.xml
+++ b/app-emulation/wine-vanilla/metadata.xml
@@ -24,6 +24,7 @@ This variant of the Wine packaging does not include external 
patchsets
                <flag name="gecko">Add support for the Gecko engine when using 
iexplore</flag>
                <flag name="gssapi">Use GSSAPI (Kerberos SSP support)</flag>
                <flag name="gstreamer">Use <pkg>media-libs/gstreamer</pkg> to 
provide DirectShow functionality;</flag>
+               <flag name="mingw">Build PE files using a MinGW cross 
compiler</flag>
                <flag name="mono">Add support for .NET using Wine's Mono 
add-on</flag>
                <flag name="netapi">Use libnetapi from <pkg>net-fs/samba</pkg> 
to support Windows networks in netapi32.dll</flag>
                <flag name="opencl">Enable OpenCL support</flag>

diff --git a/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild 
b/app-emulation/wine-vanilla/wine-vanilla-5.22-r1.ebuild
similarity index 92%
copy from app-emulation/wine-vanilla/wine-vanilla-9999.ebuild
copy to app-emulation/wine-vanilla/wine-vanilla-5.22-r1.ebuild
index 226b93e..a422ff7 100644
--- a/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild
+++ b/app-emulation/wine-vanilla/wine-vanilla-5.22-r1.ebuild
@@ -35,7 +35,7 @@ SRC_URI="${SRC_URI}
 
 LICENSE="LGPL-2.1"
 SLOT="${PV}"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc 
+faudio +fontconfig +gecko gphoto2 gsm gssapi gstreamer +jpeg kerberos 
kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl 
+opengl osmesa oss +perl pcap +png prelink pulseaudio +realtime +run-exes samba 
scanner sdl selinux +ssl test +threads +truetype udev +udisks +unwind v4l vkd3d 
vulkan +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc 
+faudio +fontconfig +gecko gphoto2 gsm gssapi gstreamer +jpeg kerberos 
kernel_FreeBSD +lcms ldap mingw +mono mp3 ncurses netapi nls odbc openal opencl 
+opengl osmesa oss +perl pcap +png prelink pulseaudio +realtime +run-exes samba 
scanner sdl selinux +ssl test +threads +truetype udev +udisks +unwind v4l vkd3d 
vulkan +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
        X? ( truetype )
        elibc_glibc? ( threads )
@@ -261,6 +261,34 @@ pkg_pretend() {
                        die
                fi
        fi
+
+       if use mingw && use abi_x86_32 && ! has_version 
"cross-i686-w64-mingw32/gcc"; then
+               eerror
+               eerror "USE=\"mingw\" is currently experimental, and requires 
the"
+               eerror "'cross-i686-w64-mingw32' compiler and its runtime for 
32-bit builds."
+               eerror
+               eerror "These can be installed by using 'sys-devel/crossdev':"
+               eerror
+               eerror "crossdev --target i686-w64-mingw32"
+               eerror
+               eerror "For more information on setting up MinGW, see: 
https://wiki.gentoo.org/wiki/Mingw";
+               eerror
+               die "MinGW build was enabled, but no compiler to support it was 
found."
+       fi
+
+       if use mingw && use abi_x86_64 && ! has_version 
"cross-x86_64-w64-mingw32/gcc"; then
+               eerror
+               eerror "USE=\"mingw\" is currently experimental, and requires 
the"
+               eerror "'cross-x86_64-w64-mingw32' compiler and its runtime for 
64-bit builds."
+               eerror
+               eerror "These can be installed by using 'sys-devel/crossdev':"
+               eerror
+               eerror "crossdev --target x86_64-w64-mingw32"
+               eerror
+               eerror "For more information on setting up MinGW, see: 
https://wiki.gentoo.org/wiki/Mingw";
+               eerror
+               die "MinGW build was enabled, but no compiler to support it was 
found."
+       fi
 }
 
 pkg_setup() {
@@ -388,7 +416,8 @@ multilib_src_configure() {
                $(use_with jpeg)
                $(use_with kerberos krb5)
                $(use_with ldap)
-               --without-mingw # linux LDFLAGS leak in mingw32: bug #685172
+               # TODO: Will bug 685172 still need special handling?
+               $(use_with mingw)
                $(use_enable mono mscoree)
                $(use_with mp3 mpg123)
                $(use_with netapi)

diff --git a/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild 
b/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild
index 226b93e..a422ff7 100644
--- a/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild
+++ b/app-emulation/wine-vanilla/wine-vanilla-9999.ebuild
@@ -35,7 +35,7 @@ SRC_URI="${SRC_URI}
 
 LICENSE="LGPL-2.1"
 SLOT="${PV}"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc 
+faudio +fontconfig +gecko gphoto2 gsm gssapi gstreamer +jpeg kerberos 
kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl 
+opengl osmesa oss +perl pcap +png prelink pulseaudio +realtime +run-exes samba 
scanner sdl selinux +ssl test +threads +truetype udev +udisks +unwind v4l vkd3d 
vulkan +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc 
+faudio +fontconfig +gecko gphoto2 gsm gssapi gstreamer +jpeg kerberos 
kernel_FreeBSD +lcms ldap mingw +mono mp3 ncurses netapi nls odbc openal opencl 
+opengl osmesa oss +perl pcap +png prelink pulseaudio +realtime +run-exes samba 
scanner sdl selinux +ssl test +threads +truetype udev +udisks +unwind v4l vkd3d 
vulkan +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
        X? ( truetype )
        elibc_glibc? ( threads )
@@ -261,6 +261,34 @@ pkg_pretend() {
                        die
                fi
        fi
+
+       if use mingw && use abi_x86_32 && ! has_version 
"cross-i686-w64-mingw32/gcc"; then
+               eerror
+               eerror "USE=\"mingw\" is currently experimental, and requires 
the"
+               eerror "'cross-i686-w64-mingw32' compiler and its runtime for 
32-bit builds."
+               eerror
+               eerror "These can be installed by using 'sys-devel/crossdev':"
+               eerror
+               eerror "crossdev --target i686-w64-mingw32"
+               eerror
+               eerror "For more information on setting up MinGW, see: 
https://wiki.gentoo.org/wiki/Mingw";
+               eerror
+               die "MinGW build was enabled, but no compiler to support it was 
found."
+       fi
+
+       if use mingw && use abi_x86_64 && ! has_version 
"cross-x86_64-w64-mingw32/gcc"; then
+               eerror
+               eerror "USE=\"mingw\" is currently experimental, and requires 
the"
+               eerror "'cross-x86_64-w64-mingw32' compiler and its runtime for 
64-bit builds."
+               eerror
+               eerror "These can be installed by using 'sys-devel/crossdev':"
+               eerror
+               eerror "crossdev --target x86_64-w64-mingw32"
+               eerror
+               eerror "For more information on setting up MinGW, see: 
https://wiki.gentoo.org/wiki/Mingw";
+               eerror
+               die "MinGW build was enabled, but no compiler to support it was 
found."
+       fi
 }
 
 pkg_setup() {
@@ -388,7 +416,8 @@ multilib_src_configure() {
                $(use_with jpeg)
                $(use_with kerberos krb5)
                $(use_with ldap)
-               --without-mingw # linux LDFLAGS leak in mingw32: bug #685172
+               # TODO: Will bug 685172 still need special handling?
+               $(use_with mingw)
                $(use_enable mono mscoree)
                $(use_with mp3 mpg123)
                $(use_with netapi)

Reply via email to