app-emulation/wine: Mega update, fixes and closes 6 bugs and 1 PR
authorNP-Hardass <NP-Hardass@gentoo.org>
Tue, 5 Jul 2016 20:11:18 +0000 (16:11 -0400)
committerNP-Hardass <NP-Hardass@gentoo.org>
Sun, 10 Jul 2016 05:29:09 +0000 (01:29 -0400)
Rearrange deps (Thanks to Andreas Sturmlechner)
Closes: #1625

Handle when staging has different mono/gecko
Gentoo-Bug: 586114

Switch from capi4k to libcapi
Gentoo-Bug: 583828

Fix compilation with gnutls-3.5
Gentoo-Bug: 587028

X requires typetype; remove wineconsole w/o X or ncurses
Gentoo-Bug: 551124

Split build checks so compilations happen once
Fix gcc version checks for clang support
Gentoo-Bug: 449378

Clean up compiler checks and use ebegin and eend

Make USE=oss warning verbose for linux users
Gentoo-Bug: 577154

Require dosbox that contains compatibility patches

15 files changed:
app-emulation/wine/Manifest
app-emulation/wine/files/wine-1.8-gnutls-3.5-compat.patch [new file with mode: 0644]
app-emulation/wine/wine-1.8-r2.ebuild [moved from app-emulation/wine/wine-1.8-r1.ebuild with 76% similarity]
app-emulation/wine/wine-1.8.1-r2.ebuild [moved from app-emulation/wine/wine-1.8.1-r1.ebuild with 77% similarity]
app-emulation/wine/wine-1.8.2-r1.ebuild [new file with mode: 0644]
app-emulation/wine/wine-1.8.2.ebuild
app-emulation/wine/wine-1.9.10-r1.ebuild [moved from app-emulation/wine/wine-1.9.10.ebuild with 77% similarity]
app-emulation/wine/wine-1.9.11-r1.ebuild [moved from app-emulation/wine/wine-1.9.11.ebuild with 77% similarity]
app-emulation/wine/wine-1.9.4-r2.ebuild [moved from app-emulation/wine/wine-1.9.4-r1.ebuild with 76% similarity]
app-emulation/wine/wine-1.9.5-r2.ebuild [moved from app-emulation/wine/wine-1.9.5-r1.ebuild with 76% similarity]
app-emulation/wine/wine-1.9.6-r2.ebuild [moved from app-emulation/wine/wine-1.9.7-r1.ebuild with 76% similarity]
app-emulation/wine/wine-1.9.7-r2.ebuild [moved from app-emulation/wine/wine-1.9.6-r1.ebuild with 76% similarity]
app-emulation/wine/wine-1.9.8-r1.ebuild [moved from app-emulation/wine/wine-1.9.8.ebuild with 76% similarity]
app-emulation/wine/wine-1.9.9-r1.ebuild [moved from app-emulation/wine/wine-1.9.9.ebuild with 77% similarity]
app-emulation/wine/wine-9999.ebuild

index ed9d1405a63c573a26be3200a2e9fc6b59f2b898..34a73e41f823ac4047e88322d1d7b68d2408eb9f 100644 (file)
@@ -32,3 +32,7 @@ DIST wine_gecko-2.40-x86.msi 31741440 SHA256 1a29d17435a52b7663cea6f30a0771f7409
 DIST wine_gecko-2.40-x86_64.msi 33056768 SHA256 c3e28988e7d92221596fc4c569d10eb4dd2ca64b9f4970bf77e791f5dd8c9230 SHA512 af171193f221f2cd51f6dc3382a9b1c658ef2553213be32f201c05f7122eb6883838be97c3ec66177b1e3922df64c409745c3223acb01910680a5476c3f01478 WHIRLPOOL d11234b593f4190ae8fa99bec8363c0047f6de08b186752b9f49764519ee9f4aafd017a16c0496581a0f4791e1109273846cec0314d9e320423d51723cd2083a
 DIST wine_gecko-2.44-x86.msi 34832896 SHA256 77a64ad17571b3a00386a88b9b1b1ea4b7e759061675568bee0ec238fb456d39 SHA512 6c3b6ccbab0081d8ab188a9a031050ca8fd7ef8f1de0efa3a57569d6166397f91bf13037402e3437cc8cfc4fc25e7c2f8be32f66500306d567055e89aae0797d WHIRLPOOL 59c269a6d6e3ba829bd24cf81eba991f91bb0c1995a1841b7e548593f544088959093ba29eb83b53f38f77e71780d8288f0b12a212862af1374f954d61f24999
 DIST wine_gecko-2.44-x86_64.msi 36273152 SHA256 628e5a0d3b7406cbd2f031139be06e2ef695081fc77ee18dc06748e649ff6661 SHA512 71dcbd28ff048fc587ed796f2f09815f624774742abc192d9aa1104485f5d8cd93b2308fb72506f82d0ea5032dd6c7ed2af4ac95121e7b2367e7a6dd77cb042f WHIRLPOOL a327f2b5a8f47498967b80e06336918006b71b4e1b90a96943faa6f05e481273203259ab6f8a3b45ba85249344c76c100880ad88dd346a94ee45327fffb2f3a1
+DIST wine_gecko-2.47-beta1-x86.msi 49209856 SHA256 2b570f0d011a7b3711a00f6de1e60d2c04bacf2a4587ba158296ff18f6861891 SHA512 7e2a0502ad2e04bcbf604dc266a4b55f8ce592e2a555ee4d5fe6797fd965f18c08371b2ae65c0fc2bdd452cc14ced1b89f839589cc99832c43bff9f71de680b0 WHIRLPOOL 2bae533925cb9d225af7d1f663d6be7b771f09be5e34fd836c933366e80d529f9b7805b4f062f61994df725a59d5cc6c7f5bcf01245f9981310f11256dac4032
+DIST wine_gecko-2.47-beta1-x86_64.msi 50761216 SHA256 af843bb7e49d00906fc9a612ca4829cf18609f94e32b7729696d776fc0447d10 SHA512 9f8b8e8615e2142c682877134583a3fd18f3c33a9bfb41254b0a141f7139bfab21a4f6ac0e207c88db3a322907cf404dafdb08803e37a938a4e0e6ea6d3ebe3c WHIRLPOOL fe5e7c8eaf841fb099ec2912329cd6a2c5217aff5a7e6b268e39d64c9e837bddf61e9f4d2b4276a260f51e409cd6c47882182c9349a7f6081cf7b5566daeb227
+DIST wine_gecko-2.47-x86.msi 49266176 SHA256 3b8a361f5d63952d21caafd74e849a774994822fb96c5922b01d554f1677643a SHA512 e0d06102dcb8ec2d24e8c8c3f5c2ee5cb47c18e203dfb43d85de008d682ff874fb664fef1df909a5a7857de39c7e8ce5175e734a11964ec4cd35f8fbacaea3a4 WHIRLPOOL 2b4e3e88d530106d942200e5cdc67e51fc529c51864dee687ff1d6ae4cc94557481f74797a5ca7c1de8ca5ad00f7d9cb71e484ab24d73867d1032ccd88c0c376
+DIST wine_gecko-2.47-x86_64.msi 50806272 SHA256 c565ea25e50ea953937d4ab01299e4306da4a556946327d253ea9b28357e4a7d SHA512 7c2496b15a06bc6906bc60afb3ac082e3f9931207fa624e60297020211d66aa9b420a61e95730a0dbdcefbe4b26c811d0c896ecd9c363b5107d08c3fa22fef41 WHIRLPOOL c7619954da22a47dae86ef4c6c0cfbece41943edcceb2c21babe610e0a0b2197b244ebbddd2f3986ee4d5251b062e5f3b8e079426ec77c311b928d18c8451677
diff --git a/app-emulation/wine/files/wine-1.8-gnutls-3.5-compat.patch b/app-emulation/wine/files/wine-1.8-gnutls-3.5-compat.patch
new file mode 100644 (file)
index 0000000..291c4a5
--- /dev/null
@@ -0,0 +1,39 @@
+From bf5ac531a030bce9e798ab66bc53e84a65ca8fdb Mon Sep 17 00:00:00 2001
+From: Michael Cronenworth <mike@cchtml.com>
+Date: Thu, 16 Jun 2016 00:21:13 -0500
+Subject: [PATCH] secur32: Provide a static declaration for
+ gnutls_cipher_get_block_size.
+
+Instead of providing an extern provide a static declaration. The
+function return type changed from signed to unsigned in GnuTLS 3.5.
+
+Signed-off-by: Michael Cronenworth <mike@cchtml.com>
+Signed-off-by: Alexandre Julliard <julliard@winehq.org>
+---
+ dlls/secur32/schannel_gnutls.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/dlls/secur32/schannel_gnutls.c b/dlls/secur32/schannel_gnutls.c
+index b10b629..bcadd47 100644
+--- a/dlls/secur32/schannel_gnutls.c
++++ b/dlls/secur32/schannel_gnutls.c
+@@ -42,7 +42,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(secur32);
+ WINE_DECLARE_DEBUG_CHANNEL(winediag);
+ /* Not present in gnutls version < 2.9.10. */
+-extern int gnutls_cipher_get_block_size(gnutls_cipher_algorithm_t algorithm);
++static int (*pgnutls_cipher_get_block_size)(gnutls_cipher_algorithm_t algorithm);
+ static void *libgnutls_handle;
+ #define MAKE_FUNCPTR(f) static typeof(f) * p##f
+@@ -52,7 +52,6 @@ MAKE_FUNCPTR(gnutls_certificate_allocate_credentials);
+ MAKE_FUNCPTR(gnutls_certificate_free_credentials);
+ MAKE_FUNCPTR(gnutls_certificate_get_peers);
+ MAKE_FUNCPTR(gnutls_cipher_get);
+-MAKE_FUNCPTR(gnutls_cipher_get_block_size);
+ MAKE_FUNCPTR(gnutls_cipher_get_key_size);
+ MAKE_FUNCPTR(gnutls_credentials_set);
+ MAKE_FUNCPTR(gnutls_deinit);
+-- 
+2.1.4
+
similarity index 76%
rename from app-emulation/wine/wine-1.8-r1.ebuild
rename to app-emulation/wine/wine-1.8-r2.ebuild
index 9819193fb67dec2d95c14beaa6b9ae5a9137d4af..8b73b5bbb4f4184d15005ce824a9de3b4b9b7fcf 100644 (file)
@@ -23,6 +23,8 @@ fi
 
 GV="2.40"
 MV="4.5.6"
+STAGING_GV="2.40"
+STAGING_MV="4.5.6"
 STAGING_P="wine-staging-${PV}"
 STAGING_DIR="${WORKDIR}/${STAGING_P}"
 WINE_GENTOO="wine-gentoo-2015.03.07"
@@ -30,11 +32,20 @@ GST_P="wine-1.8-gstreamer-1.0"
 DESCRIPTION="Free implementation of Windows(tm) on Unix"
 HOMEPAGE="http://www.winehq.org/"
 SRC_URI="${SRC_URI}
-       gecko? (
-               abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
-               abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+       !staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
+       )
+       staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${STAGING_MV}/wine-mono-${STAGING_MV}.msi )
        )
-       mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
        https://dev.gentoo.org/~np-hardass/distfiles/${PN}/${GST_P}.patch.bz2
        https://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
 
@@ -47,32 +58,22 @@ fi
 
 LICENSE="LGPL-2.1"
 SLOT="0"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
-       test? ( abi_x86_32 )
+       X? ( truetype )
        elibc_glibc? ( threads )
        mono? ( abi_x86_32 )
+       osmesa? ( opengl )
        pipelight? ( staging )
        s3tc? ( staging )
-       vaapi? ( staging )
-       osmesa? ( opengl )" #286560
+       test? ( abi_x86_32 )
+       vaapi? ( staging )" # osmesa-opengl #286560 # X-truetype #551124
 
 # FIXME: the test suite is unsuitable for us; many tests require net access
 # or fail due to Xvfb's opengl limitations.
 RESTRICT="test"
 
 COMMON_DEPEND="
-       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
-       capi? ( net-dialup/capi4k-utils )
-       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
-       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
-       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
-       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
-       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
-       gstreamer? (
-               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
-               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
-       )
        X? (
                x11-libs/libXcursor[${MULTILIB_USEDEP}]
                x11-libs/libXext[${MULTILIB_USEDEP}]
@@ -80,36 +81,47 @@ COMMON_DEPEND="
                x11-libs/libXi[${MULTILIB_USEDEP}]
                x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
        )
-       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
        alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+       capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
        cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
-       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
-       opengl? (
-               virtual/glu[${MULTILIB_USEDEP}]
-               virtual/opengl[${MULTILIB_USEDEP}]
-       )
+       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
        gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+       gstreamer? (
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+       )
        jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
-       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
        netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
        nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
        odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+       opengl? (
+               virtual/glu[${MULTILIB_USEDEP}]
+               virtual/opengl[${MULTILIB_USEDEP}]
+       )
        osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
        pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
        pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
-       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
-       xml? (
-               dev-libs/libxml2[${MULTILIB_USEDEP}]
-               dev-libs/libxslt[${MULTILIB_USEDEP}]
-       )
        scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
        ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
-       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
        v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
        vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
        xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+       xml? (
+               dev-libs/libxml2[${MULTILIB_USEDEP}]
+               dev-libs/libxslt[${MULTILIB_USEDEP}]
+       )
        abi_x86_32? (
                !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
                !<app-emulation/emul-linux-x86-baselibs-20140508-r14
@@ -128,28 +140,36 @@ COMMON_DEPEND="
        )"
 
 RDEPEND="${COMMON_DEPEND}
-       dos? ( games-emulation/dosbox )
-       perl? ( dev-lang/perl dev-perl/XML-Simple )
+       dos? ( >=games-emulation/dosbox-0.74_p20160629 )
+       perl? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       pulseaudio? (
+               realtime? ( sys-auth/rtkit )
+       )
        s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
        samba? ( >=net-fs/samba-3.0.25[winbind] )
        selinux? ( sec-policy/selinux-wine )
-       udisks? ( sys-fs/udisks:2 )
-       pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+       udisks? ( sys-fs/udisks:2 )"
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       staging? ( dev-lang/perl dev-perl/XML-Simple )
+       sys-devel/flex
+       >=sys-kernel/linux-headers-2.6
+       virtual/pkgconfig
+       virtual/yacc
        X? (
                x11-proto/inputproto
                x11-proto/xextproto
                x11-proto/xf86vidmodeproto
        )
-       xinerama? ( x11-proto/xineramaproto )
        prelink? ( sys-devel/prelink )
-       >=sys-kernel/linux-headers-2.6
-       virtual/pkgconfig
-       virtual/yacc
-       sys-devel/flex"
+       staging? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       xinerama? ( x11-proto/xineramaproto )"
 
 # These use a non-standard "Wine" category, which is provided by
 # /etc/xdg/applications-merged/wine.menu
@@ -158,42 +178,51 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
-wine_build_environment_check() {
+wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
-       # bug #549768
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
-               einfo "Checking for gcc-5 ms_abi compiler bug ..."
-               $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
-               # Run in subshell to prevent "Aborted" message
-               if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
-                       eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/549768"
-                       eerror
-                       return 1
+       # GCC-specific bugs
+       if tc-is-gcc; then
+               # bug #549768
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+                       ebegin "Checking for gcc-5 ms_abi compiler bug"
+                       $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+                       # Run in subshell to prevent "Aborted" message
+                       ( "${T}"/pr66838 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/549768"
+                               eerror
+                               return 1
+                       fi
                fi
-       fi
-       # bug #574044
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
-               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
-               # Compile in subshell to prevent "Aborted" message
-               if ! ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1; then
-                       eerror "Wine cannot be built with this version of gcc-5.3"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/574044"
-                       eerror
-                       return 1
+               # bug #574044
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+                       ebegin "Checking for gcc-5-3 stack realignment compiler bug"
+                       # Compile in subshell to prevent "Aborted" message
+                       ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "Wine cannot be built with this version of gcc-5.3"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/574044"
+                               eerror
+                               return 1
+                       fi
                fi
        fi
 
+       # Ensure compiler support
        if use abi_x86_64; then
-               einfo "Checking for builtin_ms_va_list ..."
-               if ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1) ; then
-                       einfo "$(tc-getCC) supports builtin_ms_va_list, enabling 64-bit wine"
-               else
+               ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
+               # Compile in subshell to prevent "Aborted" message
+               ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
+               eend $?
+               if [[ $? -ne 0 ]]; then
                        eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
                        eerror
                        eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
@@ -201,6 +230,10 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+}
+
+wine_build_environment_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
        if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
                eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
@@ -211,7 +244,19 @@ wine_build_environment_check() {
 }
 
 pkg_pretend() {
+       wine_compiler_check || die
        wine_build_environment_check || die
+
+       # Verify OSS support
+       if use oss && ! use kernel_FreeBSD; then
+               local oss_vers=$(best_version media-sound/oss)
+               if [[ -z ${oss_vers} ]] || ! version_is_at_least "4" ${oss_vers}; then
+                       eerror "You cannot build wine with USE=oss without having support from a"
+                       eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
+                       eerror
+                       die
+               fi
+       fi
 }
 
 pkg_setup() {
@@ -255,8 +300,9 @@ src_prepare() {
                "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
                "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
                "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
-               "${WORKDIR}/${GST_P}.patch"
                "${FILESDIR}"/${PN}-sysmacros.patch #580046
+               "${FILESDIR}"/${PN}-1.8-gnutls-3.5-compat.patch #587028
+               "${WORKDIR}/${GST_P}.patch"
        )
        if use staging; then
                ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
@@ -409,6 +455,13 @@ multilib_src_install_all() {
                rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
        fi
 
+       # Remove wineconsole if neither backend is installed #551124
+       if ! use X && ! use ncurses; then
+               rm      "${D}"/usr/{bin/,man/man1/}wineconsole* || die
+               use abi_x86_32 && rm "${D}"/usr/lib32/wine/{,fakedlls/}wineconsole.exe* || die
+               use abi_x86_64 && rm "${D}"/usr/lib64/wine/{,fakedlls/}wineconsole.exe* || die
+       fi
+
        use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
        use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
 
similarity index 77%
rename from app-emulation/wine/wine-1.8.1-r1.ebuild
rename to app-emulation/wine/wine-1.8.1-r2.ebuild
index 693adfbcd8898644e4e54f89039a9da8c6f0cbb3..be42443b21e511bc8eb83faa4cb0ec720bf677ac 100644 (file)
@@ -23,6 +23,8 @@ fi
 
 GV="2.40"
 MV="4.5.6"
+STAGING_GV="2.40"
+STAGING_MV="4.5.6"
 [[ ${MAJOR_V} == "1.8" ]] && SUFFIX="-unofficial"
 STAGING_P="wine-staging-${PV}"
 STAGING_DIR="${WORKDIR}/${STAGING_P}${SUFFIX}"
@@ -31,11 +33,20 @@ GST_P="wine-1.8-gstreamer-1.0"
 DESCRIPTION="Free implementation of Windows(tm) on Unix"
 HOMEPAGE="http://www.winehq.org/"
 SRC_URI="${SRC_URI}
-       gecko? (
-               abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
-               abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+       !staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
+       )
+       staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${STAGING_MV}/wine-mono-${STAGING_MV}.msi )
        )
-       mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
        https://dev.gentoo.org/~np-hardass/distfiles/${PN}/${GST_P}.patch.bz2
        https://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
 
@@ -48,32 +59,22 @@ fi
 
 LICENSE="LGPL-2.1"
 SLOT="0"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
-       test? ( abi_x86_32 )
+       X? ( truetype )
        elibc_glibc? ( threads )
        mono? ( abi_x86_32 )
+       osmesa? ( opengl )
        pipelight? ( staging )
        s3tc? ( staging )
-       vaapi? ( staging )
-       osmesa? ( opengl )" #286560
+       test? ( abi_x86_32 )
+       vaapi? ( staging )" # osmesa-opengl #286560 # X-truetype #551124
 
 # FIXME: the test suite is unsuitable for us; many tests require net access
 # or fail due to Xvfb's opengl limitations.
 RESTRICT="test"
 
 COMMON_DEPEND="
-       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
-       capi? ( net-dialup/capi4k-utils )
-       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
-       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
-       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
-       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
-       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
-       gstreamer? (
-               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
-               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
-       )
        X? (
                x11-libs/libXcursor[${MULTILIB_USEDEP}]
                x11-libs/libXext[${MULTILIB_USEDEP}]
@@ -81,36 +82,47 @@ COMMON_DEPEND="
                x11-libs/libXi[${MULTILIB_USEDEP}]
                x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
        )
-       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
        alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+       capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
        cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
-       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
-       opengl? (
-               virtual/glu[${MULTILIB_USEDEP}]
-               virtual/opengl[${MULTILIB_USEDEP}]
-       )
+       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
        gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+       gstreamer? (
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+       )
        jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
-       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
        netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
        nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
        odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+       opengl? (
+               virtual/glu[${MULTILIB_USEDEP}]
+               virtual/opengl[${MULTILIB_USEDEP}]
+       )
        osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
        pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
        pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
-       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
-       xml? (
-               dev-libs/libxml2[${MULTILIB_USEDEP}]
-               dev-libs/libxslt[${MULTILIB_USEDEP}]
-       )
        scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
        ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
-       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
        v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
        vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
        xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+       xml? (
+               dev-libs/libxml2[${MULTILIB_USEDEP}]
+               dev-libs/libxslt[${MULTILIB_USEDEP}]
+       )
        abi_x86_32? (
                !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
                !<app-emulation/emul-linux-x86-baselibs-20140508-r14
@@ -129,28 +141,36 @@ COMMON_DEPEND="
        )"
 
 RDEPEND="${COMMON_DEPEND}
-       dos? ( games-emulation/dosbox )
-       perl? ( dev-lang/perl dev-perl/XML-Simple )
+       dos? ( >=games-emulation/dosbox-0.74_p20160629 )
+       perl? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       pulseaudio? (
+               realtime? ( sys-auth/rtkit )
+       )
        s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
        samba? ( >=net-fs/samba-3.0.25[winbind] )
        selinux? ( sec-policy/selinux-wine )
-       udisks? ( sys-fs/udisks:2 )
-       pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+       udisks? ( sys-fs/udisks:2 )"
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       staging? ( dev-lang/perl dev-perl/XML-Simple )
+       sys-devel/flex
+       >=sys-kernel/linux-headers-2.6
+       virtual/pkgconfig
+       virtual/yacc
        X? (
                x11-proto/inputproto
                x11-proto/xextproto
                x11-proto/xf86vidmodeproto
        )
-       xinerama? ( x11-proto/xineramaproto )
        prelink? ( sys-devel/prelink )
-       >=sys-kernel/linux-headers-2.6
-       virtual/pkgconfig
-       virtual/yacc
-       sys-devel/flex"
+       staging? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       xinerama? ( x11-proto/xineramaproto )"
 
 # These use a non-standard "Wine" category, which is provided by
 # /etc/xdg/applications-merged/wine.menu
@@ -159,42 +179,51 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
-wine_build_environment_check() {
+wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
-       # bug #549768
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
-               einfo "Checking for gcc-5 ms_abi compiler bug ..."
-               $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
-               # Run in subshell to prevent "Aborted" message
-               if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
-                       eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/549768"
-                       eerror
-                       return 1
+       # GCC-specific bugs
+       if tc-is-gcc; then
+               # bug #549768
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+                       ebegin "Checking for gcc-5 ms_abi compiler bug"
+                       $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+                       # Run in subshell to prevent "Aborted" message
+                       ( "${T}"/pr66838 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/549768"
+                               eerror
+                               return 1
+                       fi
                fi
-       fi
-       # bug #574044
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
-               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
-               # Compile in subshell to prevent "Aborted" message
-               if ! ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1; then
-                       eerror "Wine cannot be built with this version of gcc-5.3"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/574044"
-                       eerror
-                       return 1
+               # bug #574044
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+                       ebegin "Checking for gcc-5-3 stack realignment compiler bug"
+                       # Compile in subshell to prevent "Aborted" message
+                       ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "Wine cannot be built with this version of gcc-5.3"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/574044"
+                               eerror
+                               return 1
+                       fi
                fi
        fi
 
+       # Ensure compiler support
        if use abi_x86_64; then
-               einfo "Checking for builtin_ms_va_list ..."
-               if ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1) ; then
-                       einfo "$(tc-getCC) supports builtin_ms_va_list, enabling 64-bit wine"
-               else
+               ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
+               # Compile in subshell to prevent "Aborted" message
+               ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
+               eend $?
+               if [[ $? -ne 0 ]]; then
                        eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
                        eerror
                        eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
@@ -202,6 +231,10 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+}
+
+wine_build_environment_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
        if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
                eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
@@ -212,7 +245,19 @@ wine_build_environment_check() {
 }
 
 pkg_pretend() {
+       wine_compiler_check || die
        wine_build_environment_check || die
+
+       # Verify OSS support
+       if use oss && ! use kernel_FreeBSD; then
+               local oss_vers=$(best_version media-sound/oss)
+               if [[ -z ${oss_vers} ]] || ! version_is_at_least "4" ${oss_vers}; then
+                       eerror "You cannot build wine with USE=oss without having support from a"
+                       eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
+                       eerror
+                       die
+               fi
+       fi
 }
 
 pkg_setup() {
@@ -256,8 +301,9 @@ src_prepare() {
                "${FILESDIR}"/${PN}-1.4_rc2-multilib-portage.patch #395615
                "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
                "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
-               "${WORKDIR}/${GST_P}.patch"
                "${FILESDIR}"/${PN}-sysmacros.patch #580046
+               "${FILESDIR}"/${PN}-1.8-gnutls-3.5-compat.patch #587028
+               "${WORKDIR}/${GST_P}.patch"
        )
        if use staging; then
                ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
@@ -415,6 +461,13 @@ multilib_src_install_all() {
                rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
        fi
 
+       # Remove wineconsole if neither backend is installed #551124
+       if ! use X && ! use ncurses; then
+               rm      "${D}"/usr/{bin/,man/man1/}wineconsole* || die
+               use abi_x86_32 && rm "${D}"/usr/lib32/wine/{,fakedlls/}wineconsole.exe* || die
+               use abi_x86_64 && rm "${D}"/usr/lib64/wine/{,fakedlls/}wineconsole.exe* || die
+       fi
+
        use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
        use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
 
diff --git a/app-emulation/wine/wine-1.8.2-r1.ebuild b/app-emulation/wine/wine-1.8.2-r1.ebuild
new file mode 100644 (file)
index 0000000..b01ffd8
--- /dev/null
@@ -0,0 +1,516 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+PLOCALES="ar bg ca cs da de el en en_US eo es fa fi fr he hi hr hu it ja ko lt ml nb_NO nl or pa pl pt_BR pt_PT rm ro ru sk sl sr_RS@cyrillic sr_RS@latin sv te th tr uk wa zh_CN zh_TW"
+PLOCALE_BACKUP="en"
+
+inherit autotools eutils fdo-mime flag-o-matic gnome2-utils l10n multilib multilib-minimal pax-utils toolchain-funcs virtualx versionator
+
+if [[ ${PV} == "9999" ]] ; then
+       EGIT_REPO_URI="git://source.winehq.org/git/wine.git http://source.winehq.org/git/wine.git"
+       EGIT_BRANCH="master"
+       inherit git-r3
+       SRC_URI=""
+       #KEYWORDS=""
+else
+       MAJOR_V=$(get_version_component_range 1-2)
+       SRC_URI="https://dl.winehq.org/wine/source/${MAJOR_V}/${P}.tar.bz2"
+       KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
+fi
+
+GV="2.40"
+MV="4.5.6"
+STAGING_GV="2.40"
+STAGING_MV="4.5.6"
+[[ ${MAJOR_V} == "1.8" ]] && SUFFIX="-unofficial"
+STAGING_P="wine-staging-${PV}"
+STAGING_DIR="${WORKDIR}/${STAGING_P}${SUFFIX}"
+WINE_GENTOO="wine-gentoo-2015.03.07"
+GST_P="wine-1.8-gstreamer-1.0"
+DESCRIPTION="Free implementation of Windows(tm) on Unix"
+HOMEPAGE="http://www.winehq.org/"
+SRC_URI="${SRC_URI}
+       !staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
+       )
+       staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${STAGING_MV}/wine-mono-${STAGING_MV}.msi )
+       )
+       https://dev.gentoo.org/~np-hardass/distfiles/${PN}/${GST_P}.patch.bz2
+       https://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
+
+if [[ ${PV} == "9999" ]] ; then
+       STAGING_EGIT_REPO_URI="git://github.com/wine-compholio/wine-staging.git"
+else
+       SRC_URI="${SRC_URI}
+       staging? ( https://github.com/wine-compholio/wine-staging/archive/v${PV}${SUFFIX}.tar.gz -> ${STAGING_P}.tar.gz )"
+fi
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
+       X? ( truetype )
+       elibc_glibc? ( threads )
+       mono? ( abi_x86_32 )
+       osmesa? ( opengl )
+       pipelight? ( staging )
+       s3tc? ( staging )
+       test? ( abi_x86_32 )
+       vaapi? ( staging )" # osmesa-opengl #286560 # X-truetype #551124
+
+# FIXME: the test suite is unsuitable for us; many tests require net access
+# or fail due to Xvfb's opengl limitations.
+RESTRICT="test"
+
+COMMON_DEPEND="
+       X? (
+               x11-libs/libXcursor[${MULTILIB_USEDEP}]
+               x11-libs/libXext[${MULTILIB_USEDEP}]
+               x11-libs/libXrandr[${MULTILIB_USEDEP}]
+               x11-libs/libXi[${MULTILIB_USEDEP}]
+               x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
+       )
+       alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+       capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
+       cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
+       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
+       gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+       gstreamer? (
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+       )
+       jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
+       lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
+       mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
+       netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
+       nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
+       odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+       opengl? (
+               virtual/glu[${MULTILIB_USEDEP}]
+               virtual/opengl[${MULTILIB_USEDEP}]
+       )
+       osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
+       pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+       pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
+       scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
+       ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
+       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+       v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
+       vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
+       xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+       xml? (
+               dev-libs/libxml2[${MULTILIB_USEDEP}]
+               dev-libs/libxslt[${MULTILIB_USEDEP}]
+       )
+       abi_x86_32? (
+               !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
+               !<app-emulation/emul-linux-x86-baselibs-20140508-r14
+               !app-emulation/emul-linux-x86-db[-abi_x86_32(-)]
+               !<app-emulation/emul-linux-x86-db-20140508-r3
+               !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+               !<app-emulation/emul-linux-x86-medialibs-20140508-r6
+               !app-emulation/emul-linux-x86-opengl[-abi_x86_32(-)]
+               !<app-emulation/emul-linux-x86-opengl-20140508-r1
+               !app-emulation/emul-linux-x86-sdl[-abi_x86_32(-)]
+               !<app-emulation/emul-linux-x86-sdl-20140508-r1
+               !app-emulation/emul-linux-x86-soundlibs[-abi_x86_32(-)]
+               !<app-emulation/emul-linux-x86-soundlibs-20140508
+               !app-emulation/emul-linux-x86-xlibs[-abi_x86_32(-)]
+               !<app-emulation/emul-linux-x86-xlibs-20140508
+       )"
+
+RDEPEND="${COMMON_DEPEND}
+       dos? ( >=games-emulation/dosbox-0.74_p20160629 )
+       perl? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       pulseaudio? (
+               realtime? ( sys-auth/rtkit )
+       )
+       s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
+       samba? ( >=net-fs/samba-3.0.25[winbind] )
+       selinux? ( sec-policy/selinux-wine )
+       udisks? ( sys-fs/udisks:2 )"
+
+# tools/make_requests requires perl
+DEPEND="${COMMON_DEPEND}
+       sys-devel/flex
+       >=sys-kernel/linux-headers-2.6
+       virtual/pkgconfig
+       virtual/yacc
+       X? (
+               x11-proto/inputproto
+               x11-proto/xextproto
+               x11-proto/xf86vidmodeproto
+       )
+       prelink? ( sys-devel/prelink )
+       staging? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       xinerama? ( x11-proto/xineramaproto )"
+
+# These use a non-standard "Wine" category, which is provided by
+# /etc/xdg/applications-merged/wine.menu
+QA_DESKTOP_FILE="usr/share/applications/wine-browsedrive.desktop
+usr/share/applications/wine-notepad.desktop
+usr/share/applications/wine-uninstaller.desktop
+usr/share/applications/wine-winecfg.desktop"
+
+wine_compiler_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+       # GCC-specific bugs
+       if tc-is-gcc; then
+               # bug #549768
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+                       ebegin "Checking for gcc-5 ms_abi compiler bug"
+                       $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+                       # Run in subshell to prevent "Aborted" message
+                       ( "${T}"/pr66838 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/549768"
+                               eerror
+                               return 1
+                       fi
+               fi
+               # bug #574044
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+                       ebegin "Checking for gcc-5-3 stack realignment compiler bug"
+                       # Compile in subshell to prevent "Aborted" message
+                       ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "Wine cannot be built with this version of gcc-5.3"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/574044"
+                               eerror
+                               return 1
+                       fi
+               fi
+       fi
+
+       # Ensure compiler support
+       if use abi_x86_64; then
+               ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
+               # Compile in subshell to prevent "Aborted" message
+               ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
+               eend $?
+               if [[ $? -ne 0 ]]; then
+                       eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
+                       eerror
+                       eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
+                       eerror
+                       return 1
+               fi
+       fi
+}
+
+wine_build_environment_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
+
+       if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
+               eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
+               eerror "See https://bugs.gentoo.org/487864 for more details."
+               eerror
+               return 1
+       fi
+}
+
+pkg_pretend() {
+       wine_compiler_check || die
+       wine_build_environment_check || die
+
+       # Verify OSS support
+       if use oss && ! use kernel_FreeBSD; then
+               local oss_vers=$(best_version media-sound/oss)
+               if [[ -z ${oss_vers} ]] || ! version_is_at_least "4" ${oss_vers}; then
+                       eerror "You cannot build wine with USE=oss without having support from a"
+                       eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
+                       eerror
+                       die
+               fi
+       fi
+}
+
+pkg_setup() {
+       wine_build_environment_check || die
+}
+
+src_unpack() {
+       if [[ ${PV} == "9999" ]] ; then
+               git-r3_src_unpack
+               if use staging; then
+                       local WINE_COMMIT=${EGIT_VERSION}
+
+                       EGIT_REPO_URI=${STAGING_EGIT_REPO_URI}
+                       unset ${PN}_LIVE_{REPO,BRANCH,COMMIT} EGIT_COMMIT;
+
+                       EGIT_CHECKOUT_DIR=${STAGING_DIR} git-r3_src_unpack
+
+                       local STAGING_COMMIT=$("${STAGING_DIR}/patches/patchinstall.sh" --upstream-commit) || die
+
+                       if [[ "${WINE_COMMIT}" != "${STAGING_COMMIT}" ]]; then
+                               einfo "The current Staging patchset is not guaranteed to apply on this WINE commit."
+                               einfo "If src_prepare fails, try emerging with the env var EGIT_COMMIT."
+                               einfo "Example: EGIT_COMMIT=${STAGING_COMMIT} emerge -1 wine"
+                       fi
+               fi
+       else
+               unpack ${P}.tar.bz2
+               use staging && unpack "${STAGING_P}.tar.gz"
+       fi
+
+       unpack "${WINE_GENTOO}.tar.bz2"
+       unpack "${GST_P}.patch.bz2"
+
+       l10n_find_plocales_changes "${S}/po" "" ".po"
+}
+
+src_prepare() {
+       local md5="$(md5sum server/protocol.def)"
+       local PATCHES=(
+               "${FILESDIR}"/${PN}-1.5.26-winegcc.patch #260726
+               "${FILESDIR}"/${PN}-1.9.5-multilib-portage.patch #395615
+               "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
+               "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+               "${FILESDIR}"/${PN}-sysmacros.patch #580046
+               "${FILESDIR}"/${PN}-1.8-gnutls-3.5-compat.patch #587028
+               "${WORKDIR}/${GST_P}.patch"
+       )
+       if use staging; then
+               ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
+               ewarn "Wine bugzilla should explicitly state that staging was used."
+
+               local STAGING_EXCLUDE=""
+               use pipelight || STAGING_EXCLUDE="${STAGING_EXCLUDE} -W Pipelight"
+
+               # Launch wine-staging patcher in a subshell, using epatch as a backend, and gitapply.sh as a backend for binary patches
+               ebegin "Running Wine-Staging patch installer"
+               (
+                       set -- DESTDIR="${S}" --backend=epatch --no-autoconf --all ${STAGING_EXCLUDE}
+                       cd "${STAGING_DIR}/patches"
+                       source "${STAGING_DIR}/patches/patchinstall.sh"
+               )
+               eend $?
+
+               # To differentiate unofficial staging releases
+               if [[ ! -z ${SUFFIX} ]]; then
+                       sed -i "s/(Staging)/(Staging [Unofficial])/" libs/wine/Makefile.in || die
+               fi
+       fi
+
+       default
+       eautoreconf
+
+       # Modification of the server protocol requires regenerating the server requests
+       if [[ "$(md5sum server/protocol.def)" != "${md5}" ]]; then
+               einfo "server/protocol.def was patched; running tools/make_requests"
+               tools/make_requests || die #432348
+       fi
+       sed -i '/^UPDATE_DESKTOP_DATABASE/s:=.*:=true:' tools/Makefile.in || die
+       if ! use run-exes; then
+               sed -i '/^MimeType/d' loader/wine.desktop || die #117785
+       fi
+
+       # hi-res default icon, #472990, http://bugs.winehq.org/show_bug.cgi?id=24652
+       cp "${WORKDIR}"/${WINE_GENTOO}/icons/oic_winlogo.ico dlls/user32/resources/ || die
+
+       l10n_get_locales > po/LINGUAS # otherwise wine doesn't respect LINGUAS
+}
+
+src_configure() {
+       export LDCONFIG=/bin/true
+       use custom-cflags || strip-flags
+
+       multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+       local myconf=(
+               --sysconfdir=/etc/wine
+               $(use_with alsa)
+               $(use_with capi)
+               $(use_with lcms cms)
+               $(use_with cups)
+               $(use_with ncurses curses)
+               $(use_with udisks dbus)
+               $(use_with fontconfig)
+               $(use_with ssl gnutls)
+               $(use_enable gecko mshtml)
+               $(use_with gphoto2 gphoto)
+               $(use_with gsm)
+               $(use_with gstreamer)
+               --without-hal
+               $(use_with jpeg)
+               $(use_with ldap)
+               $(use_enable mono mscoree)
+               $(use_with mp3 mpg123)
+               $(use_with netapi)
+               $(use_with nls gettext)
+               $(use_with openal)
+               $(use_with opencl)
+               $(use_with opengl)
+               $(use_with osmesa)
+               $(use_with oss)
+               $(use_with pcap)
+               $(use_with png)
+               $(use_with pulseaudio pulse)
+               $(use_with threads pthread)
+               $(use_with scanner sane)
+               $(use_enable test tests)
+               $(use_with truetype freetype)
+               $(use_with v4l)
+               $(use_with X x)
+               $(use_with xcomposite)
+               $(use_with xinerama)
+               $(use_with xml)
+               $(use_with xml xslt)
+       )
+
+       use staging && myconf+=(
+               --with-xattr
+               $(use_with vaapi va)
+       )
+
+       local PKG_CONFIG AR RANLIB
+       # Avoid crossdev's i686-pc-linux-gnu-pkg-config if building wine32 on amd64; #472038
+       # set AR and RANLIB to make QA scripts happy; #483342
+       tc-export PKG_CONFIG AR RANLIB
+
+       if use amd64; then
+               if [[ ${ABI} == amd64 ]]; then
+                       myconf+=( --enable-win64 )
+               else
+                       myconf+=( --disable-win64 )
+               fi
+
+               # Note: using --with-wine64 results in problems with multilib.eclass
+               # CC/LD hackery. We're using separate tools instead.
+       fi
+
+       ECONF_SOURCE=${S} \
+       econf "${myconf[@]}"
+       emake depend
+}
+
+multilib_src_test() {
+       # FIXME: win32-only; wine64 tests fail with "could not find the Wine loader"
+       if [[ ${ABI} == x86 ]]; then
+               if [[ $(id -u) == 0 ]]; then
+                       ewarn "Skipping tests since they cannot be run under the root user."
+                       ewarn "To run the test ${PN} suite, add userpriv to FEATURES in make.conf"
+                       return
+               fi
+
+               WINEPREFIX="${T}/.wine-${ABI}" \
+               Xemake test
+       fi
+}
+
+multilib_src_install_all() {
+       local DOCS=( ANNOUNCE AUTHORS README )
+       local l
+       add_locale_docs() {
+               local locale_doc="documentation/README.$1"
+               [[ ! -e ${locale_doc} ]] || DOCS+=( ${locale_doc} )
+       }
+       l10n_for_each_locale_do add_locale_docs
+
+       einstalldocs
+       prune_libtool_files --all
+
+       emake -C "../${WINE_GENTOO}" install DESTDIR="${D}" EPREFIX="${EPREFIX}"
+       if use gecko ; then
+               insinto /usr/share/wine/gecko
+               use abi_x86_32 && doins "${DISTDIR}"/wine_gecko-${GV}-x86.msi
+               use abi_x86_64 && doins "${DISTDIR}"/wine_gecko-${GV}-x86_64.msi
+       fi
+       if use mono ; then
+               insinto /usr/share/wine/mono
+               doins "${DISTDIR}"/wine-mono-${MV}.msi
+       fi
+       if ! use perl ; then # winedump calls function_grep.pl, and winemaker is a perl script
+               rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
+       fi
+
+       # Remove wineconsole if neither backend is installed #551124
+       if ! use X && ! use ncurses; then
+               rm      "${D}"/usr/{bin/,man/man1/}wineconsole* || die
+               use abi_x86_32 && rm "${D}"/usr/lib32/wine/{,fakedlls/}wineconsole.exe* || die
+               use abi_x86_64 && rm "${D}"/usr/lib64/wine/{,fakedlls/}wineconsole.exe* || die
+       fi
+
+       use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
+       use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
+
+       if use abi_x86_64 && ! use abi_x86_32; then
+               dosym /usr/bin/wine{64,} # 404331
+               dosym /usr/bin/wine{64,}-preloader
+       fi
+
+       # respect LINGUAS when installing man pages, #469418
+       for l in de fr pl; do
+               use linguas_${l} || rm -r "${D}"usr/share/man/${l}*
+       done
+}
+
+pkg_preinst() {
+       gnome2_icon_savelist
+}
+
+pkg_postinst() {
+       gnome2_icon_cache_update
+       fdo-mime_desktop_database_update
+
+       if ! use gecko; then
+               ewarn "Without Wine Gecko, wine prefixes will not have a default"
+               ewarn "implementation of iexplore.  Many older windows applications"
+               ewarn "rely upon the existence of an iexplore implementation, so"
+               ewarn "you will likely need to install an external one, like via winetricks"
+       fi
+       if ! use mono; then
+               ewarn "Without Wine Mono, wine prefixes will not have a default"
+               ewarn "implementation of .NET.  Many windows applications rely upon"
+               ewarn "the existence of a .NET implementation, so you will likely need"
+               ewarn "to install an external one, like via winetricks"
+       fi
+
+       if use gstreamer; then
+               ewarn "This package uses a Gentoo specific patchset to provide"
+               ewarn "GStreamer 1.0 support.  Any bugs related to GStreamer should"
+               ewarn "be filed at Gentoo's bugzilla, not upstream's."
+       fi
+}
+
+pkg_postrm() {
+       gnome2_icon_cache_update
+       fdo-mime_desktop_database_update
+}
index 64a4bc515f55361fe67c7c764e1edfef9364749a..0da62bb62dd62316714abd059a03dff598a8e71a 100644 (file)
@@ -50,11 +50,11 @@ LICENSE="LGPL-2.1"
 SLOT="0"
 IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
-       test? ( abi_x86_32 )
        elibc_glibc? ( threads )
        mono? ( abi_x86_32 )
        pipelight? ( staging )
        s3tc? ( staging )
+       test? ( abi_x86_32 )
        vaapi? ( staging )
        osmesa? ( opengl )" #286560
 
@@ -63,17 +63,6 @@ REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
 RESTRICT="test"
 
 COMMON_DEPEND="
-       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
-       capi? ( net-dialup/capi4k-utils )
-       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
-       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
-       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
-       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
-       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
-       gstreamer? (
-               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
-               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
-       )
        X? (
                x11-libs/libXcursor[${MULTILIB_USEDEP}]
                x11-libs/libXext[${MULTILIB_USEDEP}]
@@ -83,34 +72,45 @@ COMMON_DEPEND="
        )
        xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
        alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+       capi? ( net-dialup/capi4k-utils )
        cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
-       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
-       opengl? (
-               virtual/glu[${MULTILIB_USEDEP}]
-               virtual/opengl[${MULTILIB_USEDEP}]
-       )
+       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
        gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+       gstreamer? (
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+       )
        jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
        ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
        mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
        netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
        nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
        odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+       opengl? (
+               virtual/glu[${MULTILIB_USEDEP}]
+               virtual/opengl[${MULTILIB_USEDEP}]
+       )
        osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
        pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
        pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
        staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
-       xml? (
-               dev-libs/libxml2[${MULTILIB_USEDEP}]
-               dev-libs/libxslt[${MULTILIB_USEDEP}]
-       )
        scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
        ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
-       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
        v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
        vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
        xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+       xml? (
+               dev-libs/libxml2[${MULTILIB_USEDEP}]
+               dev-libs/libxslt[${MULTILIB_USEDEP}]
+       )
        abi_x86_32? (
                !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
                !<app-emulation/emul-linux-x86-baselibs-20140508-r14
@@ -130,27 +130,35 @@ COMMON_DEPEND="
 
 RDEPEND="${COMMON_DEPEND}
        dos? ( games-emulation/dosbox )
-       perl? ( dev-lang/perl dev-perl/XML-Simple )
+       perl? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       pulseaudio? (
+               realtime? ( sys-auth/rtkit )
+       )
        s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
        samba? ( >=net-fs/samba-3.0.25[winbind] )
        selinux? ( sec-policy/selinux-wine )
-       udisks? ( sys-fs/udisks:2 )
-       pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+       udisks? ( sys-fs/udisks:2 )"
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       staging? ( dev-lang/perl dev-perl/XML-Simple )
+       sys-devel/flex
+       >=sys-kernel/linux-headers-2.6
+       virtual/pkgconfig
+       virtual/yacc
+       prelink? ( sys-devel/prelink )
+       staging? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
        X? (
                x11-proto/inputproto
                x11-proto/xextproto
                x11-proto/xf86vidmodeproto
        )
-       xinerama? ( x11-proto/xineramaproto )
-       prelink? ( sys-devel/prelink )
-       >=sys-kernel/linux-headers-2.6
-       virtual/pkgconfig
-       virtual/yacc
-       sys-devel/flex"
+       xinerama? ( x11-proto/xineramaproto )"
 
 # These use a non-standard "Wine" category, which is provided by
 # /etc/xdg/applications-merged/wine.menu
@@ -159,37 +167,41 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
-wine_build_environment_check() {
+wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
-       # bug #549768
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
-               einfo "Checking for gcc-5 ms_abi compiler bug ..."
-               $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
-               # Run in subshell to prevent "Aborted" message
-               if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
-                       eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/549768"
-                       eerror
-                       return 1
+       # GCC-specific bugs
+       if tc-is-gcc; then
+               # bug #549768
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+                       einfo "Checking for gcc-5 ms_abi compiler bug ..."
+                       $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+                       # Run in subshell to prevent "Aborted" message
+                       if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
+                               eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/549768"
+                               eerror
+                               return 1
+                       fi
                fi
-       fi
-       # bug #574044
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
-               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
-               # Compile in subshell to prevent "Aborted" message
-               if ! ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1; then
-                       eerror "Wine cannot be built with this version of gcc-5.3"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/574044"
-                       eerror
-                       return 1
+               # bug #574044
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+                       einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
+                       # Compile in subshell to prevent "Aborted" message
+                       if ! ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1; then
+                               eerror "Wine cannot be built with this version of gcc-5.3"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/574044"
+                               eerror
+                               return 1
+                       fi
                fi
        fi
 
+       # Ensure compiler support
        if use abi_x86_64; then
                einfo "Checking for builtin_ms_va_list ..."
                if ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1) ; then
@@ -202,6 +214,10 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+}
+
+wine_build_environment_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
        if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
                eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
@@ -212,6 +228,7 @@ wine_build_environment_check() {
 }
 
 pkg_pretend() {
+       wine_compiler_check || die
        wine_build_environment_check || die
 }
 
similarity index 77%
rename from app-emulation/wine/wine-1.9.10.ebuild
rename to app-emulation/wine/wine-1.9.10-r1.ebuild
index 529dfbe03cd811b96b620498c56139fed47c108b..fb182df4a29b6e99cc18d2cdd33bfaa63838d4de 100644 (file)
@@ -23,6 +23,8 @@ fi
 
 GV="2.44"
 MV="4.6.2"
+STAGING_GV="2.47-beta1"
+STAGING_MV="4.6.2"
 [[ ${MAJOR_V} == "1.8" ]] && SUFFIX="-unofficial"
 STAGING_P="wine-staging-${PV}"
 STAGING_DIR="${WORKDIR}/${STAGING_P}${SUFFIX}"
@@ -32,11 +34,20 @@ WINE_GENTOO="wine-gentoo-2015.03.07"
 DESCRIPTION="Free implementation of Windows(tm) on Unix"
 HOMEPAGE="http://www.winehq.org/"
 SRC_URI="${SRC_URI}
-       gecko? (
-               abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
-               abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+       !staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
+       )
+       staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${STAGING_MV}/wine-mono-${STAGING_MV}.msi )
        )
-       mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
        https://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
 
 if [[ ${PV} == "9999" ]] ; then
@@ -50,32 +61,21 @@ fi
 
 LICENSE="LGPL-2.1"
 SLOT="0"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
-       test? ( abi_x86_32 )
+       X? ( truetype )
        elibc_glibc? ( threads )
+       osmesa? ( opengl )
        pipelight? ( staging )
        s3tc? ( staging )
-       vaapi? ( staging )
-       osmesa? ( opengl )" #286560
+       test? ( abi_x86_32 )
+       vaapi? ( staging )" # osmesa-opengl #286560 # X-truetype #551124
 
 # FIXME: the test suite is unsuitable for us; many tests require net access
 # or fail due to Xvfb's opengl limitations.
 RESTRICT="test"
 
 COMMON_DEPEND="
-       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
-       capi? ( net-dialup/capi4k-utils )
-       d3d9? ( media-libs/mesa[d3d9,${MULTILIB_USEDEP}] )
-       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
-       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
-       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
-       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
-       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
-       gstreamer? (
-               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
-               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
-       )
        X? (
                x11-libs/libXcursor[${MULTILIB_USEDEP}]
                x11-libs/libXext[${MULTILIB_USEDEP}]
@@ -83,36 +83,48 @@ COMMON_DEPEND="
                x11-libs/libXi[${MULTILIB_USEDEP}]
                x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
        )
-       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
        alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+       capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
        cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
-       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
-       opengl? (
-               virtual/glu[${MULTILIB_USEDEP}]
-               virtual/opengl[${MULTILIB_USEDEP}]
-       )
+       d3d9? ( media-libs/mesa[d3d9,${MULTILIB_USEDEP}] )
+       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
        gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+       gstreamer? (
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+       )
        jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
-       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
        netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
        nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
        odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+       opengl? (
+               virtual/glu[${MULTILIB_USEDEP}]
+               virtual/opengl[${MULTILIB_USEDEP}]
+       )
        osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
        pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
        pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
-       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
-       xml? (
-               dev-libs/libxml2[${MULTILIB_USEDEP}]
-               dev-libs/libxslt[${MULTILIB_USEDEP}]
-       )
        scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
        ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
-       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
        v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
        vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
        xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+       xml? (
+               dev-libs/libxml2[${MULTILIB_USEDEP}]
+               dev-libs/libxslt[${MULTILIB_USEDEP}]
+       )
        abi_x86_32? (
                !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
                !<app-emulation/emul-linux-x86-baselibs-20140508-r14
@@ -131,28 +143,36 @@ COMMON_DEPEND="
        )"
 
 RDEPEND="${COMMON_DEPEND}
-       dos? ( games-emulation/dosbox )
-       perl? ( dev-lang/perl dev-perl/XML-Simple )
+       dos? ( >=games-emulation/dosbox-0.74_p20160629 )
+       perl? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       pulseaudio? (
+               realtime? ( sys-auth/rtkit )
+       )
        s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
        samba? ( >=net-fs/samba-3.0.25[winbind] )
        selinux? ( sec-policy/selinux-wine )
-       udisks? ( sys-fs/udisks:2 )
-       pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+       udisks? ( sys-fs/udisks:2 )"
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       staging? ( dev-lang/perl dev-perl/XML-Simple )
+       sys-devel/flex
+       >=sys-kernel/linux-headers-2.6
+       virtual/pkgconfig
+       virtual/yacc
        X? (
                x11-proto/inputproto
                x11-proto/xextproto
                x11-proto/xf86vidmodeproto
        )
-       xinerama? ( x11-proto/xineramaproto )
        prelink? ( sys-devel/prelink )
-       >=sys-kernel/linux-headers-2.6
-       virtual/pkgconfig
-       virtual/yacc
-       sys-devel/flex"
+       staging? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       xinerama? ( x11-proto/xineramaproto )"
 
 # These use a non-standard "Wine" category, which is provided by
 # /etc/xdg/applications-merged/wine.menu
@@ -161,42 +181,51 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
-wine_build_environment_check() {
+wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
-       # bug #549768
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
-               einfo "Checking for gcc-5 ms_abi compiler bug ..."
-               $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
-               # Run in subshell to prevent "Aborted" message
-               if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
-                       eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/549768"
-                       eerror
-                       return 1
+       # GCC-specific bugs
+       if tc-is-gcc; then
+               # bug #549768
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+                       ebegin "Checking for gcc-5 ms_abi compiler bug"
+                       $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+                       # Run in subshell to prevent "Aborted" message
+                       ( "${T}"/pr66838 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/549768"
+                               eerror
+                               return 1
+                       fi
                fi
-       fi
-       # bug #574044
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
-               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
-               # Compile in subshell to prevent "Aborted" message
-               if ! ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1; then
-                       eerror "Wine cannot be built with this version of gcc-5.3"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/574044"
-                       eerror
-                       return 1
+               # bug #574044
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+                       ebegin "Checking for gcc-5-3 stack realignment compiler bug"
+                       # Compile in subshell to prevent "Aborted" message
+                       ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "Wine cannot be built with this version of gcc-5.3"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/574044"
+                               eerror
+                               return 1
+                       fi
                fi
        fi
 
+       # Ensure compiler support
        if use abi_x86_64; then
-               einfo "Checking for builtin_ms_va_list ..."
-               if ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1) ; then
-                       einfo "$(tc-getCC) supports builtin_ms_va_list, enabling 64-bit wine"
-               else
+               ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
+               # Compile in subshell to prevent "Aborted" message
+               ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
+               eend $?
+               if [[ $? -ne 0 ]]; then
                        eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
                        eerror
                        eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
@@ -204,6 +233,10 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+}
+
+wine_build_environment_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
        if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
                eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
@@ -214,7 +247,19 @@ wine_build_environment_check() {
 }
 
 pkg_pretend() {
+       wine_compiler_check || die
        wine_build_environment_check || die
+
+       # Verify OSS support
+       if use oss && ! use kernel_FreeBSD; then
+               local oss_vers=$(best_version media-sound/oss)
+               if [[ -z ${oss_vers} ]] || ! version_is_at_least "4" ${oss_vers}; then
+                       eerror "You cannot build wine with USE=oss without having support from a"
+                       eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
+                       eerror
+                       die
+               fi
+       fi
 }
 
 pkg_setup() {
@@ -263,6 +308,7 @@ src_prepare() {
                "${FILESDIR}"/${PN}-1.9.5-multilib-portage.patch #395615
                "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
                "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+               "${FILESDIR}"/${PN}-1.8-gnutls-3.5-compat.patch #587028
        )
        if use staging; then
                ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
@@ -429,6 +475,13 @@ multilib_src_install_all() {
                rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
        fi
 
+       # Remove wineconsole if neither backend is installed #551124
+       if ! use X && ! use ncurses; then
+               rm      "${D}"/usr/{bin/,man/man1/}wineconsole* || die
+               use abi_x86_32 && rm "${D}"/usr/lib32/wine/{,fakedlls/}wineconsole.exe* || die
+               use abi_x86_64 && rm "${D}"/usr/lib64/wine/{,fakedlls/}wineconsole.exe* || die
+       fi
+
        use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
        use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
 
similarity index 77%
rename from app-emulation/wine/wine-1.9.11.ebuild
rename to app-emulation/wine/wine-1.9.11-r1.ebuild
index 529dfbe03cd811b96b620498c56139fed47c108b..fb182df4a29b6e99cc18d2cdd33bfaa63838d4de 100644 (file)
@@ -23,6 +23,8 @@ fi
 
 GV="2.44"
 MV="4.6.2"
+STAGING_GV="2.47-beta1"
+STAGING_MV="4.6.2"
 [[ ${MAJOR_V} == "1.8" ]] && SUFFIX="-unofficial"
 STAGING_P="wine-staging-${PV}"
 STAGING_DIR="${WORKDIR}/${STAGING_P}${SUFFIX}"
@@ -32,11 +34,20 @@ WINE_GENTOO="wine-gentoo-2015.03.07"
 DESCRIPTION="Free implementation of Windows(tm) on Unix"
 HOMEPAGE="http://www.winehq.org/"
 SRC_URI="${SRC_URI}
-       gecko? (
-               abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
-               abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+       !staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
+       )
+       staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${STAGING_MV}/wine-mono-${STAGING_MV}.msi )
        )
-       mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
        https://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
 
 if [[ ${PV} == "9999" ]] ; then
@@ -50,32 +61,21 @@ fi
 
 LICENSE="LGPL-2.1"
 SLOT="0"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
-       test? ( abi_x86_32 )
+       X? ( truetype )
        elibc_glibc? ( threads )
+       osmesa? ( opengl )
        pipelight? ( staging )
        s3tc? ( staging )
-       vaapi? ( staging )
-       osmesa? ( opengl )" #286560
+       test? ( abi_x86_32 )
+       vaapi? ( staging )" # osmesa-opengl #286560 # X-truetype #551124
 
 # FIXME: the test suite is unsuitable for us; many tests require net access
 # or fail due to Xvfb's opengl limitations.
 RESTRICT="test"
 
 COMMON_DEPEND="
-       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
-       capi? ( net-dialup/capi4k-utils )
-       d3d9? ( media-libs/mesa[d3d9,${MULTILIB_USEDEP}] )
-       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
-       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
-       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
-       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
-       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
-       gstreamer? (
-               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
-               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
-       )
        X? (
                x11-libs/libXcursor[${MULTILIB_USEDEP}]
                x11-libs/libXext[${MULTILIB_USEDEP}]
@@ -83,36 +83,48 @@ COMMON_DEPEND="
                x11-libs/libXi[${MULTILIB_USEDEP}]
                x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
        )
-       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
        alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+       capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
        cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
-       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
-       opengl? (
-               virtual/glu[${MULTILIB_USEDEP}]
-               virtual/opengl[${MULTILIB_USEDEP}]
-       )
+       d3d9? ( media-libs/mesa[d3d9,${MULTILIB_USEDEP}] )
+       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
        gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+       gstreamer? (
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+       )
        jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
-       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
        netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
        nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
        odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+       opengl? (
+               virtual/glu[${MULTILIB_USEDEP}]
+               virtual/opengl[${MULTILIB_USEDEP}]
+       )
        osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
        pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
        pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
-       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
-       xml? (
-               dev-libs/libxml2[${MULTILIB_USEDEP}]
-               dev-libs/libxslt[${MULTILIB_USEDEP}]
-       )
        scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
        ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
-       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
        v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
        vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
        xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+       xml? (
+               dev-libs/libxml2[${MULTILIB_USEDEP}]
+               dev-libs/libxslt[${MULTILIB_USEDEP}]
+       )
        abi_x86_32? (
                !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
                !<app-emulation/emul-linux-x86-baselibs-20140508-r14
@@ -131,28 +143,36 @@ COMMON_DEPEND="
        )"
 
 RDEPEND="${COMMON_DEPEND}
-       dos? ( games-emulation/dosbox )
-       perl? ( dev-lang/perl dev-perl/XML-Simple )
+       dos? ( >=games-emulation/dosbox-0.74_p20160629 )
+       perl? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       pulseaudio? (
+               realtime? ( sys-auth/rtkit )
+       )
        s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
        samba? ( >=net-fs/samba-3.0.25[winbind] )
        selinux? ( sec-policy/selinux-wine )
-       udisks? ( sys-fs/udisks:2 )
-       pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+       udisks? ( sys-fs/udisks:2 )"
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       staging? ( dev-lang/perl dev-perl/XML-Simple )
+       sys-devel/flex
+       >=sys-kernel/linux-headers-2.6
+       virtual/pkgconfig
+       virtual/yacc
        X? (
                x11-proto/inputproto
                x11-proto/xextproto
                x11-proto/xf86vidmodeproto
        )
-       xinerama? ( x11-proto/xineramaproto )
        prelink? ( sys-devel/prelink )
-       >=sys-kernel/linux-headers-2.6
-       virtual/pkgconfig
-       virtual/yacc
-       sys-devel/flex"
+       staging? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       xinerama? ( x11-proto/xineramaproto )"
 
 # These use a non-standard "Wine" category, which is provided by
 # /etc/xdg/applications-merged/wine.menu
@@ -161,42 +181,51 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
-wine_build_environment_check() {
+wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
-       # bug #549768
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
-               einfo "Checking for gcc-5 ms_abi compiler bug ..."
-               $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
-               # Run in subshell to prevent "Aborted" message
-               if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
-                       eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/549768"
-                       eerror
-                       return 1
+       # GCC-specific bugs
+       if tc-is-gcc; then
+               # bug #549768
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+                       ebegin "Checking for gcc-5 ms_abi compiler bug"
+                       $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+                       # Run in subshell to prevent "Aborted" message
+                       ( "${T}"/pr66838 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/549768"
+                               eerror
+                               return 1
+                       fi
                fi
-       fi
-       # bug #574044
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
-               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
-               # Compile in subshell to prevent "Aborted" message
-               if ! ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1; then
-                       eerror "Wine cannot be built with this version of gcc-5.3"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/574044"
-                       eerror
-                       return 1
+               # bug #574044
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+                       ebegin "Checking for gcc-5-3 stack realignment compiler bug"
+                       # Compile in subshell to prevent "Aborted" message
+                       ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "Wine cannot be built with this version of gcc-5.3"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/574044"
+                               eerror
+                               return 1
+                       fi
                fi
        fi
 
+       # Ensure compiler support
        if use abi_x86_64; then
-               einfo "Checking for builtin_ms_va_list ..."
-               if ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1) ; then
-                       einfo "$(tc-getCC) supports builtin_ms_va_list, enabling 64-bit wine"
-               else
+               ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
+               # Compile in subshell to prevent "Aborted" message
+               ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
+               eend $?
+               if [[ $? -ne 0 ]]; then
                        eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
                        eerror
                        eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
@@ -204,6 +233,10 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+}
+
+wine_build_environment_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
        if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
                eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
@@ -214,7 +247,19 @@ wine_build_environment_check() {
 }
 
 pkg_pretend() {
+       wine_compiler_check || die
        wine_build_environment_check || die
+
+       # Verify OSS support
+       if use oss && ! use kernel_FreeBSD; then
+               local oss_vers=$(best_version media-sound/oss)
+               if [[ -z ${oss_vers} ]] || ! version_is_at_least "4" ${oss_vers}; then
+                       eerror "You cannot build wine with USE=oss without having support from a"
+                       eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
+                       eerror
+                       die
+               fi
+       fi
 }
 
 pkg_setup() {
@@ -263,6 +308,7 @@ src_prepare() {
                "${FILESDIR}"/${PN}-1.9.5-multilib-portage.patch #395615
                "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
                "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+               "${FILESDIR}"/${PN}-1.8-gnutls-3.5-compat.patch #587028
        )
        if use staging; then
                ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
@@ -429,6 +475,13 @@ multilib_src_install_all() {
                rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
        fi
 
+       # Remove wineconsole if neither backend is installed #551124
+       if ! use X && ! use ncurses; then
+               rm      "${D}"/usr/{bin/,man/man1/}wineconsole* || die
+               use abi_x86_32 && rm "${D}"/usr/lib32/wine/{,fakedlls/}wineconsole.exe* || die
+               use abi_x86_64 && rm "${D}"/usr/lib64/wine/{,fakedlls/}wineconsole.exe* || die
+       fi
+
        use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
        use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
 
similarity index 76%
rename from app-emulation/wine/wine-1.9.4-r1.ebuild
rename to app-emulation/wine/wine-1.9.4-r2.ebuild
index 44b40e1d16f9ed11c30c939b438aacfbf6875bbb..e63c554936eb2d0de80f42601b4ac850dc3c5a7a 100644 (file)
@@ -23,6 +23,8 @@ fi
 
 GV="2.44"
 MV="4.5.6"
+STAGING_GV="2.44"
+STAGING_MV="4.5.6"
 [[ ${MAJOR_V} == "1.8" ]] && SUFFIX="-unofficial"
 STAGING_P="wine-staging-${PV}"
 STAGING_DIR="${WORKDIR}/${STAGING_P}${SUFFIX}"
@@ -30,11 +32,20 @@ WINE_GENTOO="wine-gentoo-2015.03.07"
 DESCRIPTION="Free implementation of Windows(tm) on Unix"
 HOMEPAGE="http://www.winehq.org/"
 SRC_URI="${SRC_URI}
-       gecko? (
-               abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
-               abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+       !staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
+       )
+       staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${STAGING_MV}/wine-mono-${STAGING_MV}.msi )
        )
-       mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
        https://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
 
 if [[ ${PV} == "9999" ]] ; then
@@ -46,32 +57,22 @@ fi
 
 LICENSE="LGPL-2.1"
 SLOT="0"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
-       test? ( abi_x86_32 )
+       X? ( truetype )
        elibc_glibc? ( threads )
        mono? ( abi_x86_32 )
+       osmesa? ( opengl )
        pipelight? ( staging )
        s3tc? ( staging )
-       vaapi? ( staging )
-       osmesa? ( opengl )" #286560
+       test? ( abi_x86_32 )
+       vaapi? ( staging )" # osmesa-opengl #286560 # X-truetype #551124
 
 # FIXME: the test suite is unsuitable for us; many tests require net access
 # or fail due to Xvfb's opengl limitations.
 RESTRICT="test"
 
 COMMON_DEPEND="
-       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
-       capi? ( net-dialup/capi4k-utils )
-       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
-       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
-       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
-       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
-       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
-       gstreamer? (
-               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
-               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
-       )
        X? (
                x11-libs/libXcursor[${MULTILIB_USEDEP}]
                x11-libs/libXext[${MULTILIB_USEDEP}]
@@ -79,36 +80,47 @@ COMMON_DEPEND="
                x11-libs/libXi[${MULTILIB_USEDEP}]
                x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
        )
-       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
        alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+       capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
        cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
-       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
-       opengl? (
-               virtual/glu[${MULTILIB_USEDEP}]
-               virtual/opengl[${MULTILIB_USEDEP}]
-       )
+       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
        gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+       gstreamer? (
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+       )
        jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
-       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
        netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
        nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
        odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+       opengl? (
+               virtual/glu[${MULTILIB_USEDEP}]
+               virtual/opengl[${MULTILIB_USEDEP}]
+       )
        osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
        pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
        pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
-       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
-       xml? (
-               dev-libs/libxml2[${MULTILIB_USEDEP}]
-               dev-libs/libxslt[${MULTILIB_USEDEP}]
-       )
        scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
        ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
-       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
        v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
        vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
        xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+       xml? (
+               dev-libs/libxml2[${MULTILIB_USEDEP}]
+               dev-libs/libxslt[${MULTILIB_USEDEP}]
+       )
        abi_x86_32? (
                !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
                !<app-emulation/emul-linux-x86-baselibs-20140508-r14
@@ -127,28 +139,36 @@ COMMON_DEPEND="
        )"
 
 RDEPEND="${COMMON_DEPEND}
-       dos? ( games-emulation/dosbox )
-       perl? ( dev-lang/perl dev-perl/XML-Simple )
+       dos? ( >=games-emulation/dosbox-0.74_p20160629 )
+       perl? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       pulseaudio? (
+               realtime? ( sys-auth/rtkit )
+       )
        s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
        samba? ( >=net-fs/samba-3.0.25[winbind] )
        selinux? ( sec-policy/selinux-wine )
-       udisks? ( sys-fs/udisks:2 )
-       pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+       udisks? ( sys-fs/udisks:2 )"
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       staging? ( dev-lang/perl dev-perl/XML-Simple )
+       sys-devel/flex
+       >=sys-kernel/linux-headers-2.6
+       virtual/pkgconfig
+       virtual/yacc
        X? (
                x11-proto/inputproto
                x11-proto/xextproto
                x11-proto/xf86vidmodeproto
        )
-       xinerama? ( x11-proto/xineramaproto )
        prelink? ( sys-devel/prelink )
-       >=sys-kernel/linux-headers-2.6
-       virtual/pkgconfig
-       virtual/yacc
-       sys-devel/flex"
+       staging? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       xinerama? ( x11-proto/xineramaproto )"
 
 # These use a non-standard "Wine" category, which is provided by
 # /etc/xdg/applications-merged/wine.menu
@@ -157,42 +177,51 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
-wine_build_environment_check() {
+wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
-       # bug #549768
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
-               einfo "Checking for gcc-5 ms_abi compiler bug ..."
-               $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
-               # Run in subshell to prevent "Aborted" message
-               if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
-                       eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/549768"
-                       eerror
-                       return 1
+       # GCC-specific bugs
+       if tc-is-gcc; then
+               # bug #549768
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+                       ebegin "Checking for gcc-5 ms_abi compiler bug"
+                       $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+                       # Run in subshell to prevent "Aborted" message
+                       ( "${T}"/pr66838 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/549768"
+                               eerror
+                               return 1
+                       fi
                fi
-       fi
-       # bug #574044
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
-               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
-               # Compile in subshell to prevent "Aborted" message
-               if ! ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1; then
-                       eerror "Wine cannot be built with this version of gcc-5.3"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/574044"
-                       eerror
-                       return 1
+               # bug #574044
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+                       ebegin "Checking for gcc-5-3 stack realignment compiler bug"
+                       # Compile in subshell to prevent "Aborted" message
+                       ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "Wine cannot be built with this version of gcc-5.3"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/574044"
+                               eerror
+                               return 1
+                       fi
                fi
        fi
 
+       # Ensure compiler support
        if use abi_x86_64; then
-               einfo "Checking for builtin_ms_va_list ..."
-               if ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1) ; then
-                       einfo "$(tc-getCC) supports builtin_ms_va_list, enabling 64-bit wine"
-               else
+               ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
+               # Compile in subshell to prevent "Aborted" message
+               ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
+               eend $?
+               if [[ $? -ne 0 ]]; then
                        eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
                        eerror
                        eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
@@ -200,6 +229,10 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+}
+
+wine_build_environment_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
        if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
                eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
@@ -210,7 +243,19 @@ wine_build_environment_check() {
 }
 
 pkg_pretend() {
+       wine_compiler_check || die
        wine_build_environment_check || die
+
+       # Verify OSS support
+       if use oss && ! use kernel_FreeBSD; then
+               local oss_vers=$(best_version media-sound/oss)
+               if [[ -z ${oss_vers} ]] || ! version_is_at_least "4" ${oss_vers}; then
+                       eerror "You cannot build wine with USE=oss without having support from a"
+                       eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
+                       eerror
+                       die
+               fi
+       fi
 }
 
 pkg_setup() {
@@ -254,6 +299,7 @@ src_prepare() {
                "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
                "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
                "${FILESDIR}"/${PN}-sysmacros.patch #580046
+               "${FILESDIR}"/${PN}-1.8-gnutls-3.5-compat.patch #587028
        )
        if use staging; then
                ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
@@ -411,6 +457,13 @@ multilib_src_install_all() {
                rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
        fi
 
+       # Remove wineconsole if neither backend is installed #551124
+       if ! use X && ! use ncurses; then
+               rm      "${D}"/usr/{bin/,man/man1/}wineconsole* || die
+               use abi_x86_32 && rm "${D}"/usr/lib32/wine/{,fakedlls/}wineconsole.exe* || die
+               use abi_x86_64 && rm "${D}"/usr/lib64/wine/{,fakedlls/}wineconsole.exe* || die
+       fi
+
        use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
        use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
 
similarity index 76%
rename from app-emulation/wine/wine-1.9.5-r1.ebuild
rename to app-emulation/wine/wine-1.9.5-r2.ebuild
index c42e24d6a34b213cd751e46447db6b37e58734e6..48e5cdceaad04e90c37e65f2f332077012cc8228 100644 (file)
@@ -23,6 +23,8 @@ fi
 
 GV="2.44"
 MV="4.6.0"
+STAGING_GV="2.44"
+STAGING_MV="4.6.0"
 [[ ${MAJOR_V} == "1.8" ]] && SUFFIX="-unofficial"
 STAGING_P="wine-staging-${PV}"
 STAGING_DIR="${WORKDIR}/${STAGING_P}${SUFFIX}"
@@ -30,11 +32,20 @@ WINE_GENTOO="wine-gentoo-2015.03.07"
 DESCRIPTION="Free implementation of Windows(tm) on Unix"
 HOMEPAGE="http://www.winehq.org/"
 SRC_URI="${SRC_URI}
-       gecko? (
-               abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
-               abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+       !staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
+       )
+       staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${STAGING_MV}/wine-mono-${STAGING_MV}.msi )
        )
-       mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
        https://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
 
 if [[ ${PV} == "9999" ]] ; then
@@ -46,31 +57,21 @@ fi
 
 LICENSE="LGPL-2.1"
 SLOT="0"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
-       test? ( abi_x86_32 )
+       X? ( truetype )
        elibc_glibc? ( threads )
+       osmesa? ( opengl )
        pipelight? ( staging )
        s3tc? ( staging )
-       vaapi? ( staging )
-       osmesa? ( opengl )" #286560
+       test? ( abi_x86_32 )
+       vaapi? ( staging )" # osmesa-opengl #286560 # X-truetype #551124
 
 # FIXME: the test suite is unsuitable for us; many tests require net access
 # or fail due to Xvfb's opengl limitations.
 RESTRICT="test"
 
 COMMON_DEPEND="
-       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
-       capi? ( net-dialup/capi4k-utils )
-       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
-       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
-       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
-       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
-       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
-       gstreamer? (
-               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
-               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
-       )
        X? (
                x11-libs/libXcursor[${MULTILIB_USEDEP}]
                x11-libs/libXext[${MULTILIB_USEDEP}]
@@ -78,36 +79,47 @@ COMMON_DEPEND="
                x11-libs/libXi[${MULTILIB_USEDEP}]
                x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
        )
-       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
        alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+       capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
        cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
-       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
-       opengl? (
-               virtual/glu[${MULTILIB_USEDEP}]
-               virtual/opengl[${MULTILIB_USEDEP}]
-       )
+       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
        gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+       gstreamer? (
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+       )
        jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
-       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
        netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
        nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
        odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+       opengl? (
+               virtual/glu[${MULTILIB_USEDEP}]
+               virtual/opengl[${MULTILIB_USEDEP}]
+       )
        osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
        pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
        pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
-       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
-       xml? (
-               dev-libs/libxml2[${MULTILIB_USEDEP}]
-               dev-libs/libxslt[${MULTILIB_USEDEP}]
-       )
        scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
        ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
-       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
        v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
        vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
        xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+       xml? (
+               dev-libs/libxml2[${MULTILIB_USEDEP}]
+               dev-libs/libxslt[${MULTILIB_USEDEP}]
+       )
        abi_x86_32? (
                !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
                !<app-emulation/emul-linux-x86-baselibs-20140508-r14
@@ -126,28 +138,36 @@ COMMON_DEPEND="
        )"
 
 RDEPEND="${COMMON_DEPEND}
-       dos? ( games-emulation/dosbox )
-       perl? ( dev-lang/perl dev-perl/XML-Simple )
+       dos? ( >=games-emulation/dosbox-0.74_p20160629 )
+       perl? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       pulseaudio? (
+               realtime? ( sys-auth/rtkit )
+       )
        s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
        samba? ( >=net-fs/samba-3.0.25[winbind] )
        selinux? ( sec-policy/selinux-wine )
-       udisks? ( sys-fs/udisks:2 )
-       pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+       udisks? ( sys-fs/udisks:2 )"
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       staging? ( dev-lang/perl dev-perl/XML-Simple )
+       sys-devel/flex
+       >=sys-kernel/linux-headers-2.6
+       virtual/pkgconfig
+       virtual/yacc
        X? (
                x11-proto/inputproto
                x11-proto/xextproto
                x11-proto/xf86vidmodeproto
        )
-       xinerama? ( x11-proto/xineramaproto )
        prelink? ( sys-devel/prelink )
-       >=sys-kernel/linux-headers-2.6
-       virtual/pkgconfig
-       virtual/yacc
-       sys-devel/flex"
+       staging? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       xinerama? ( x11-proto/xineramaproto )"
 
 # These use a non-standard "Wine" category, which is provided by
 # /etc/xdg/applications-merged/wine.menu
@@ -156,42 +176,51 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
-wine_build_environment_check() {
+wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
-       # bug #549768
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
-               einfo "Checking for gcc-5 ms_abi compiler bug ..."
-               $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
-               # Run in subshell to prevent "Aborted" message
-               if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
-                       eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/549768"
-                       eerror
-                       return 1
+       # GCC-specific bugs
+       if tc-is-gcc; then
+               # bug #549768
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+                       ebegin "Checking for gcc-5 ms_abi compiler bug"
+                       $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+                       # Run in subshell to prevent "Aborted" message
+                       ( "${T}"/pr66838 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/549768"
+                               eerror
+                               return 1
+                       fi
                fi
-       fi
-       # bug #574044
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
-               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
-               # Compile in subshell to prevent "Aborted" message
-               if ! ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1; then
-                       eerror "Wine cannot be built with this version of gcc-5.3"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/574044"
-                       eerror
-                       return 1
+               # bug #574044
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+                       ebegin "Checking for gcc-5-3 stack realignment compiler bug"
+                       # Compile in subshell to prevent "Aborted" message
+                       ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "Wine cannot be built with this version of gcc-5.3"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/574044"
+                               eerror
+                               return 1
+                       fi
                fi
        fi
 
+       # Ensure compiler support
        if use abi_x86_64; then
-               einfo "Checking for builtin_ms_va_list ..."
-               if ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1) ; then
-                       einfo "$(tc-getCC) supports builtin_ms_va_list, enabling 64-bit wine"
-               else
+               ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
+               # Compile in subshell to prevent "Aborted" message
+               ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
+               eend $?
+               if [[ $? -ne 0 ]]; then
                        eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
                        eerror
                        eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
@@ -199,6 +228,10 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+}
+
+wine_build_environment_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
        if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
                eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
@@ -209,7 +242,19 @@ wine_build_environment_check() {
 }
 
 pkg_pretend() {
+       wine_compiler_check || die
        wine_build_environment_check || die
+
+       # Verify OSS support
+       if use oss && ! use kernel_FreeBSD; then
+               local oss_vers=$(best_version media-sound/oss)
+               if [[ -z ${oss_vers} ]] || ! version_is_at_least "4" ${oss_vers}; then
+                       eerror "You cannot build wine with USE=oss without having support from a"
+                       eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
+                       eerror
+                       die
+               fi
+       fi
 }
 
 pkg_setup() {
@@ -253,6 +298,7 @@ src_prepare() {
                "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
                "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
                "${FILESDIR}"/${PN}-sysmacros.patch #580046
+               "${FILESDIR}"/${PN}-1.8-gnutls-3.5-compat.patch #587028
        )
        if use staging; then
                ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
@@ -413,6 +459,13 @@ multilib_src_install_all() {
                rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
        fi
 
+       # Remove wineconsole if neither backend is installed #551124
+       if ! use X && ! use ncurses; then
+               rm      "${D}"/usr/{bin/,man/man1/}wineconsole* || die
+               use abi_x86_32 && rm "${D}"/usr/lib32/wine/{,fakedlls/}wineconsole.exe* || die
+               use abi_x86_64 && rm "${D}"/usr/lib64/wine/{,fakedlls/}wineconsole.exe* || die
+       fi
+
        use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
        use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
 
similarity index 76%
rename from app-emulation/wine/wine-1.9.7-r1.ebuild
rename to app-emulation/wine/wine-1.9.6-r2.ebuild
index cab49fb06f347d25be9ebf4a9688f05e3ac26a4b..f9bb12c92a95afda92ad04c1b43e031f9a5e8b91 100644 (file)
@@ -23,6 +23,8 @@ fi
 
 GV="2.44"
 MV="4.6.0"
+STAGING_GV="2.44"
+STAGING_MV="4.6.0"
 [[ ${MAJOR_V} == "1.8" ]] && SUFFIX="-unofficial"
 STAGING_P="wine-staging-${PV}"
 STAGING_DIR="${WORKDIR}/${STAGING_P}${SUFFIX}"
@@ -30,11 +32,20 @@ WINE_GENTOO="wine-gentoo-2015.03.07"
 DESCRIPTION="Free implementation of Windows(tm) on Unix"
 HOMEPAGE="http://www.winehq.org/"
 SRC_URI="${SRC_URI}
-       gecko? (
-               abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
-               abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+       !staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
+       )
+       staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${STAGING_MV}/wine-mono-${STAGING_MV}.msi )
        )
-       mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
        https://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
 
 if [[ ${PV} == "9999" ]] ; then
@@ -46,31 +57,21 @@ fi
 
 LICENSE="LGPL-2.1"
 SLOT="0"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
-       test? ( abi_x86_32 )
+       X? ( truetype )
        elibc_glibc? ( threads )
+       osmesa? ( opengl )
        pipelight? ( staging )
        s3tc? ( staging )
-       vaapi? ( staging )
-       osmesa? ( opengl )" #286560
+       test? ( abi_x86_32 )
+       vaapi? ( staging )" # osmesa-opengl #286560 # X-truetype #551124
 
 # FIXME: the test suite is unsuitable for us; many tests require net access
 # or fail due to Xvfb's opengl limitations.
 RESTRICT="test"
 
 COMMON_DEPEND="
-       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
-       capi? ( net-dialup/capi4k-utils )
-       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
-       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
-       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
-       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
-       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
-       gstreamer? (
-               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
-               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
-       )
        X? (
                x11-libs/libXcursor[${MULTILIB_USEDEP}]
                x11-libs/libXext[${MULTILIB_USEDEP}]
@@ -78,36 +79,47 @@ COMMON_DEPEND="
                x11-libs/libXi[${MULTILIB_USEDEP}]
                x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
        )
-       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
        alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+       capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
        cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
-       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
-       opengl? (
-               virtual/glu[${MULTILIB_USEDEP}]
-               virtual/opengl[${MULTILIB_USEDEP}]
-       )
+       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
        gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+       gstreamer? (
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+       )
        jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
-       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
        netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
        nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
        odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+       opengl? (
+               virtual/glu[${MULTILIB_USEDEP}]
+               virtual/opengl[${MULTILIB_USEDEP}]
+       )
        osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
        pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
        pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
-       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
-       xml? (
-               dev-libs/libxml2[${MULTILIB_USEDEP}]
-               dev-libs/libxslt[${MULTILIB_USEDEP}]
-       )
        scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
        ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
-       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
        v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
        vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
        xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+       xml? (
+               dev-libs/libxml2[${MULTILIB_USEDEP}]
+               dev-libs/libxslt[${MULTILIB_USEDEP}]
+       )
        abi_x86_32? (
                !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
                !<app-emulation/emul-linux-x86-baselibs-20140508-r14
@@ -126,28 +138,36 @@ COMMON_DEPEND="
        )"
 
 RDEPEND="${COMMON_DEPEND}
-       dos? ( games-emulation/dosbox )
-       perl? ( dev-lang/perl dev-perl/XML-Simple )
+       dos? ( >=games-emulation/dosbox-0.74_p20160629 )
+       perl? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       pulseaudio? (
+               realtime? ( sys-auth/rtkit )
+       )
        s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
        samba? ( >=net-fs/samba-3.0.25[winbind] )
        selinux? ( sec-policy/selinux-wine )
-       udisks? ( sys-fs/udisks:2 )
-       pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+       udisks? ( sys-fs/udisks:2 )"
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       staging? ( dev-lang/perl dev-perl/XML-Simple )
+       sys-devel/flex
+       >=sys-kernel/linux-headers-2.6
+       virtual/pkgconfig
+       virtual/yacc
        X? (
                x11-proto/inputproto
                x11-proto/xextproto
                x11-proto/xf86vidmodeproto
        )
-       xinerama? ( x11-proto/xineramaproto )
        prelink? ( sys-devel/prelink )
-       >=sys-kernel/linux-headers-2.6
-       virtual/pkgconfig
-       virtual/yacc
-       sys-devel/flex"
+       staging? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       xinerama? ( x11-proto/xineramaproto )"
 
 # These use a non-standard "Wine" category, which is provided by
 # /etc/xdg/applications-merged/wine.menu
@@ -156,42 +176,51 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
-wine_build_environment_check() {
+wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
-       # bug #549768
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
-               einfo "Checking for gcc-5 ms_abi compiler bug ..."
-               $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
-               # Run in subshell to prevent "Aborted" message
-               if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
-                       eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/549768"
-                       eerror
-                       return 1
+       # GCC-specific bugs
+       if tc-is-gcc; then
+               # bug #549768
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+                       ebegin "Checking for gcc-5 ms_abi compiler bug"
+                       $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+                       # Run in subshell to prevent "Aborted" message
+                       ( "${T}"/pr66838 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/549768"
+                               eerror
+                               return 1
+                       fi
                fi
-       fi
-       # bug #574044
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
-               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
-               # Compile in subshell to prevent "Aborted" message
-               if ! ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1; then
-                       eerror "Wine cannot be built with this version of gcc-5.3"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/574044"
-                       eerror
-                       return 1
+               # bug #574044
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+                       ebegin "Checking for gcc-5-3 stack realignment compiler bug"
+                       # Compile in subshell to prevent "Aborted" message
+                       ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "Wine cannot be built with this version of gcc-5.3"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/574044"
+                               eerror
+                               return 1
+                       fi
                fi
        fi
 
+       # Ensure compiler support
        if use abi_x86_64; then
-               einfo "Checking for builtin_ms_va_list ..."
-               if ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1) ; then
-                       einfo "$(tc-getCC) supports builtin_ms_va_list, enabling 64-bit wine"
-               else
+               ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
+               # Compile in subshell to prevent "Aborted" message
+               ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
+               eend $?
+               if [[ $? -ne 0 ]]; then
                        eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
                        eerror
                        eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
@@ -199,6 +228,10 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+}
+
+wine_build_environment_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
        if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
                eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
@@ -209,7 +242,19 @@ wine_build_environment_check() {
 }
 
 pkg_pretend() {
+       wine_compiler_check || die
        wine_build_environment_check || die
+
+       # Verify OSS support
+       if use oss && ! use kernel_FreeBSD; then
+               local oss_vers=$(best_version media-sound/oss)
+               if [[ -z ${oss_vers} ]] || ! version_is_at_least "4" ${oss_vers}; then
+                       eerror "You cannot build wine with USE=oss without having support from a"
+                       eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
+                       eerror
+                       die
+               fi
+       fi
 }
 
 pkg_setup() {
@@ -253,6 +298,7 @@ src_prepare() {
                "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
                "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
                "${FILESDIR}"/${PN}-sysmacros.patch #580046
+               "${FILESDIR}"/${PN}-1.8-gnutls-3.5-compat.patch #587028
        )
        if use staging; then
                ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
@@ -410,6 +456,13 @@ multilib_src_install_all() {
                rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
        fi
 
+       # Remove wineconsole if neither backend is installed #551124
+       if ! use X && ! use ncurses; then
+               rm      "${D}"/usr/{bin/,man/man1/}wineconsole* || die
+               use abi_x86_32 && rm "${D}"/usr/lib32/wine/{,fakedlls/}wineconsole.exe* || die
+               use abi_x86_64 && rm "${D}"/usr/lib64/wine/{,fakedlls/}wineconsole.exe* || die
+       fi
+
        use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
        use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
 
similarity index 76%
rename from app-emulation/wine/wine-1.9.6-r1.ebuild
rename to app-emulation/wine/wine-1.9.7-r2.ebuild
index cab49fb06f347d25be9ebf4a9688f05e3ac26a4b..f9bb12c92a95afda92ad04c1b43e031f9a5e8b91 100644 (file)
@@ -23,6 +23,8 @@ fi
 
 GV="2.44"
 MV="4.6.0"
+STAGING_GV="2.44"
+STAGING_MV="4.6.0"
 [[ ${MAJOR_V} == "1.8" ]] && SUFFIX="-unofficial"
 STAGING_P="wine-staging-${PV}"
 STAGING_DIR="${WORKDIR}/${STAGING_P}${SUFFIX}"
@@ -30,11 +32,20 @@ WINE_GENTOO="wine-gentoo-2015.03.07"
 DESCRIPTION="Free implementation of Windows(tm) on Unix"
 HOMEPAGE="http://www.winehq.org/"
 SRC_URI="${SRC_URI}
-       gecko? (
-               abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
-               abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+       !staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
+       )
+       staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${STAGING_MV}/wine-mono-${STAGING_MV}.msi )
        )
-       mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
        https://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
 
 if [[ ${PV} == "9999" ]] ; then
@@ -46,31 +57,21 @@ fi
 
 LICENSE="LGPL-2.1"
 SLOT="0"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
-       test? ( abi_x86_32 )
+       X? ( truetype )
        elibc_glibc? ( threads )
+       osmesa? ( opengl )
        pipelight? ( staging )
        s3tc? ( staging )
-       vaapi? ( staging )
-       osmesa? ( opengl )" #286560
+       test? ( abi_x86_32 )
+       vaapi? ( staging )" # osmesa-opengl #286560 # X-truetype #551124
 
 # FIXME: the test suite is unsuitable for us; many tests require net access
 # or fail due to Xvfb's opengl limitations.
 RESTRICT="test"
 
 COMMON_DEPEND="
-       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
-       capi? ( net-dialup/capi4k-utils )
-       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
-       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
-       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
-       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
-       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
-       gstreamer? (
-               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
-               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
-       )
        X? (
                x11-libs/libXcursor[${MULTILIB_USEDEP}]
                x11-libs/libXext[${MULTILIB_USEDEP}]
@@ -78,36 +79,47 @@ COMMON_DEPEND="
                x11-libs/libXi[${MULTILIB_USEDEP}]
                x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
        )
-       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
        alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+       capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
        cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
-       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
-       opengl? (
-               virtual/glu[${MULTILIB_USEDEP}]
-               virtual/opengl[${MULTILIB_USEDEP}]
-       )
+       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
        gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+       gstreamer? (
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+       )
        jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
-       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
        netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
        nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
        odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+       opengl? (
+               virtual/glu[${MULTILIB_USEDEP}]
+               virtual/opengl[${MULTILIB_USEDEP}]
+       )
        osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
        pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
        pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
-       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
-       xml? (
-               dev-libs/libxml2[${MULTILIB_USEDEP}]
-               dev-libs/libxslt[${MULTILIB_USEDEP}]
-       )
        scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
        ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
-       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
        v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
        vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
        xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+       xml? (
+               dev-libs/libxml2[${MULTILIB_USEDEP}]
+               dev-libs/libxslt[${MULTILIB_USEDEP}]
+       )
        abi_x86_32? (
                !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
                !<app-emulation/emul-linux-x86-baselibs-20140508-r14
@@ -126,28 +138,36 @@ COMMON_DEPEND="
        )"
 
 RDEPEND="${COMMON_DEPEND}
-       dos? ( games-emulation/dosbox )
-       perl? ( dev-lang/perl dev-perl/XML-Simple )
+       dos? ( >=games-emulation/dosbox-0.74_p20160629 )
+       perl? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       pulseaudio? (
+               realtime? ( sys-auth/rtkit )
+       )
        s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
        samba? ( >=net-fs/samba-3.0.25[winbind] )
        selinux? ( sec-policy/selinux-wine )
-       udisks? ( sys-fs/udisks:2 )
-       pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+       udisks? ( sys-fs/udisks:2 )"
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       staging? ( dev-lang/perl dev-perl/XML-Simple )
+       sys-devel/flex
+       >=sys-kernel/linux-headers-2.6
+       virtual/pkgconfig
+       virtual/yacc
        X? (
                x11-proto/inputproto
                x11-proto/xextproto
                x11-proto/xf86vidmodeproto
        )
-       xinerama? ( x11-proto/xineramaproto )
        prelink? ( sys-devel/prelink )
-       >=sys-kernel/linux-headers-2.6
-       virtual/pkgconfig
-       virtual/yacc
-       sys-devel/flex"
+       staging? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       xinerama? ( x11-proto/xineramaproto )"
 
 # These use a non-standard "Wine" category, which is provided by
 # /etc/xdg/applications-merged/wine.menu
@@ -156,42 +176,51 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
-wine_build_environment_check() {
+wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
-       # bug #549768
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
-               einfo "Checking for gcc-5 ms_abi compiler bug ..."
-               $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
-               # Run in subshell to prevent "Aborted" message
-               if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
-                       eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/549768"
-                       eerror
-                       return 1
+       # GCC-specific bugs
+       if tc-is-gcc; then
+               # bug #549768
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+                       ebegin "Checking for gcc-5 ms_abi compiler bug"
+                       $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+                       # Run in subshell to prevent "Aborted" message
+                       ( "${T}"/pr66838 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/549768"
+                               eerror
+                               return 1
+                       fi
                fi
-       fi
-       # bug #574044
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
-               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
-               # Compile in subshell to prevent "Aborted" message
-               if ! ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1; then
-                       eerror "Wine cannot be built with this version of gcc-5.3"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/574044"
-                       eerror
-                       return 1
+               # bug #574044
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+                       ebegin "Checking for gcc-5-3 stack realignment compiler bug"
+                       # Compile in subshell to prevent "Aborted" message
+                       ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "Wine cannot be built with this version of gcc-5.3"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/574044"
+                               eerror
+                               return 1
+                       fi
                fi
        fi
 
+       # Ensure compiler support
        if use abi_x86_64; then
-               einfo "Checking for builtin_ms_va_list ..."
-               if ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1) ; then
-                       einfo "$(tc-getCC) supports builtin_ms_va_list, enabling 64-bit wine"
-               else
+               ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
+               # Compile in subshell to prevent "Aborted" message
+               ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
+               eend $?
+               if [[ $? -ne 0 ]]; then
                        eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
                        eerror
                        eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
@@ -199,6 +228,10 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+}
+
+wine_build_environment_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
        if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
                eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
@@ -209,7 +242,19 @@ wine_build_environment_check() {
 }
 
 pkg_pretend() {
+       wine_compiler_check || die
        wine_build_environment_check || die
+
+       # Verify OSS support
+       if use oss && ! use kernel_FreeBSD; then
+               local oss_vers=$(best_version media-sound/oss)
+               if [[ -z ${oss_vers} ]] || ! version_is_at_least "4" ${oss_vers}; then
+                       eerror "You cannot build wine with USE=oss without having support from a"
+                       eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
+                       eerror
+                       die
+               fi
+       fi
 }
 
 pkg_setup() {
@@ -253,6 +298,7 @@ src_prepare() {
                "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
                "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
                "${FILESDIR}"/${PN}-sysmacros.patch #580046
+               "${FILESDIR}"/${PN}-1.8-gnutls-3.5-compat.patch #587028
        )
        if use staging; then
                ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
@@ -410,6 +456,13 @@ multilib_src_install_all() {
                rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
        fi
 
+       # Remove wineconsole if neither backend is installed #551124
+       if ! use X && ! use ncurses; then
+               rm      "${D}"/usr/{bin/,man/man1/}wineconsole* || die
+               use abi_x86_32 && rm "${D}"/usr/lib32/wine/{,fakedlls/}wineconsole.exe* || die
+               use abi_x86_64 && rm "${D}"/usr/lib64/wine/{,fakedlls/}wineconsole.exe* || die
+       fi
+
        use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
        use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
 
similarity index 76%
rename from app-emulation/wine/wine-1.9.8.ebuild
rename to app-emulation/wine/wine-1.9.8-r1.ebuild
index 7edb22948c86ec2d5d5dae526cc891aa5736aca9..bd899efb190d22ec5d40bd182ca413fd7838bd01 100644 (file)
@@ -23,6 +23,8 @@ fi
 
 GV="2.44"
 MV="4.6.2"
+STAGING_GV="2.44"
+STAGING_MV="4.6.2"
 [[ ${MAJOR_V} == "1.8" ]] && SUFFIX="-unofficial"
 STAGING_P="wine-staging-${PV}"
 STAGING_DIR="${WORKDIR}/${STAGING_P}${SUFFIX}"
@@ -30,11 +32,20 @@ WINE_GENTOO="wine-gentoo-2015.03.07"
 DESCRIPTION="Free implementation of Windows(tm) on Unix"
 HOMEPAGE="http://www.winehq.org/"
 SRC_URI="${SRC_URI}
-       gecko? (
-               abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
-               abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+       !staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
+       )
+       staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${STAGING_MV}/wine-mono-${STAGING_MV}.msi )
        )
-       mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
        https://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
 
 if [[ ${PV} == "9999" ]] ; then
@@ -46,31 +57,21 @@ fi
 
 LICENSE="LGPL-2.1"
 SLOT="0"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
-       test? ( abi_x86_32 )
+       X? ( truetype )
        elibc_glibc? ( threads )
+       osmesa? ( opengl )
        pipelight? ( staging )
        s3tc? ( staging )
-       vaapi? ( staging )
-       osmesa? ( opengl )" #286560
+       test? ( abi_x86_32 )
+       vaapi? ( staging )" # osmesa-opengl #286560 # X-truetype #551124
 
 # FIXME: the test suite is unsuitable for us; many tests require net access
 # or fail due to Xvfb's opengl limitations.
 RESTRICT="test"
 
 COMMON_DEPEND="
-       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
-       capi? ( net-dialup/capi4k-utils )
-       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
-       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
-       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
-       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
-       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
-       gstreamer? (
-               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
-               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
-       )
        X? (
                x11-libs/libXcursor[${MULTILIB_USEDEP}]
                x11-libs/libXext[${MULTILIB_USEDEP}]
@@ -78,36 +79,47 @@ COMMON_DEPEND="
                x11-libs/libXi[${MULTILIB_USEDEP}]
                x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
        )
-       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
        alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+       capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
        cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
-       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
-       opengl? (
-               virtual/glu[${MULTILIB_USEDEP}]
-               virtual/opengl[${MULTILIB_USEDEP}]
-       )
+       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
        gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+       gstreamer? (
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+       )
        jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
-       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
        netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
        nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
        odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+       opengl? (
+               virtual/glu[${MULTILIB_USEDEP}]
+               virtual/opengl[${MULTILIB_USEDEP}]
+       )
        osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
        pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
        pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
-       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
-       xml? (
-               dev-libs/libxml2[${MULTILIB_USEDEP}]
-               dev-libs/libxslt[${MULTILIB_USEDEP}]
-       )
        scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
        ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
-       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
        v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
        vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
        xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+       xml? (
+               dev-libs/libxml2[${MULTILIB_USEDEP}]
+               dev-libs/libxslt[${MULTILIB_USEDEP}]
+       )
        abi_x86_32? (
                !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
                !<app-emulation/emul-linux-x86-baselibs-20140508-r14
@@ -126,28 +138,36 @@ COMMON_DEPEND="
        )"
 
 RDEPEND="${COMMON_DEPEND}
-       dos? ( games-emulation/dosbox )
-       perl? ( dev-lang/perl dev-perl/XML-Simple )
+       dos? ( >=games-emulation/dosbox-0.74_p20160629 )
+       perl? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       pulseaudio? (
+               realtime? ( sys-auth/rtkit )
+       )
        s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
        samba? ( >=net-fs/samba-3.0.25[winbind] )
        selinux? ( sec-policy/selinux-wine )
-       udisks? ( sys-fs/udisks:2 )
-       pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+       udisks? ( sys-fs/udisks:2 )"
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       staging? ( dev-lang/perl dev-perl/XML-Simple )
+       sys-devel/flex
+       >=sys-kernel/linux-headers-2.6
+       virtual/pkgconfig
+       virtual/yacc
        X? (
                x11-proto/inputproto
                x11-proto/xextproto
                x11-proto/xf86vidmodeproto
        )
-       xinerama? ( x11-proto/xineramaproto )
        prelink? ( sys-devel/prelink )
-       >=sys-kernel/linux-headers-2.6
-       virtual/pkgconfig
-       virtual/yacc
-       sys-devel/flex"
+       staging? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       xinerama? ( x11-proto/xineramaproto )"
 
 # These use a non-standard "Wine" category, which is provided by
 # /etc/xdg/applications-merged/wine.menu
@@ -156,42 +176,51 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
-wine_build_environment_check() {
+wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
-       # bug #549768
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
-               einfo "Checking for gcc-5 ms_abi compiler bug ..."
-               $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
-               # Run in subshell to prevent "Aborted" message
-               if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
-                       eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/549768"
-                       eerror
-                       return 1
+       # GCC-specific bugs
+       if tc-is-gcc; then
+               # bug #549768
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+                       ebegin "Checking for gcc-5 ms_abi compiler bug"
+                       $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+                       # Run in subshell to prevent "Aborted" message
+                       ( "${T}"/pr66838 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/549768"
+                               eerror
+                               return 1
+                       fi
                fi
-       fi
-       # bug #574044
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
-               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
-               # Compile in subshell to prevent "Aborted" message
-               if ! ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1; then
-                       eerror "Wine cannot be built with this version of gcc-5.3"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/574044"
-                       eerror
-                       return 1
+               # bug #574044
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+                       ebegin "Checking for gcc-5-3 stack realignment compiler bug"
+                       # Compile in subshell to prevent "Aborted" message
+                       ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "Wine cannot be built with this version of gcc-5.3"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/574044"
+                               eerror
+                               return 1
+                       fi
                fi
        fi
 
+       # Ensure compiler support
        if use abi_x86_64; then
-               einfo "Checking for builtin_ms_va_list ..."
-               if ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1) ; then
-                       einfo "$(tc-getCC) supports builtin_ms_va_list, enabling 64-bit wine"
-               else
+               ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
+               # Compile in subshell to prevent "Aborted" message
+               ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
+               eend $?
+               if [[ $? -ne 0 ]]; then
                        eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
                        eerror
                        eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
@@ -199,6 +228,10 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+}
+
+wine_build_environment_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
        if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
                eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
@@ -209,7 +242,19 @@ wine_build_environment_check() {
 }
 
 pkg_pretend() {
+       wine_compiler_check || die
        wine_build_environment_check || die
+
+       # Verify OSS support
+       if use oss && ! use kernel_FreeBSD; then
+               local oss_vers=$(best_version media-sound/oss)
+               if [[ -z ${oss_vers} ]] || ! version_is_at_least "4" ${oss_vers}; then
+                       eerror "You cannot build wine with USE=oss without having support from a"
+                       eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
+                       eerror
+                       die
+               fi
+       fi
 }
 
 pkg_setup() {
@@ -253,6 +298,7 @@ src_prepare() {
                "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
                "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
                "${FILESDIR}"/${PN}-sysmacros.patch #580046
+               "${FILESDIR}"/${PN}-1.8-gnutls-3.5-compat.patch #587028
        )
        if use staging; then
                ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
@@ -410,6 +456,13 @@ multilib_src_install_all() {
                rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
        fi
 
+       # Remove wineconsole if neither backend is installed #551124
+       if ! use X && ! use ncurses; then
+               rm      "${D}"/usr/{bin/,man/man1/}wineconsole* || die
+               use abi_x86_32 && rm "${D}"/usr/lib32/wine/{,fakedlls/}wineconsole.exe* || die
+               use abi_x86_64 && rm "${D}"/usr/lib64/wine/{,fakedlls/}wineconsole.exe* || die
+       fi
+
        use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
        use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
 
similarity index 77%
rename from app-emulation/wine/wine-1.9.9.ebuild
rename to app-emulation/wine/wine-1.9.9-r1.ebuild
index 529dfbe03cd811b96b620498c56139fed47c108b..243e83294528f6ec37196b61da533f85f1f4ee0d 100644 (file)
@@ -23,6 +23,8 @@ fi
 
 GV="2.44"
 MV="4.6.2"
+STAGING_GV="2.44"
+STAGING_MV="4.6.2"
 [[ ${MAJOR_V} == "1.8" ]] && SUFFIX="-unofficial"
 STAGING_P="wine-staging-${PV}"
 STAGING_DIR="${WORKDIR}/${STAGING_P}${SUFFIX}"
@@ -32,11 +34,20 @@ WINE_GENTOO="wine-gentoo-2015.03.07"
 DESCRIPTION="Free implementation of Windows(tm) on Unix"
 HOMEPAGE="http://www.winehq.org/"
 SRC_URI="${SRC_URI}
-       gecko? (
-               abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
-               abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+       !staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
+       )
+       staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${STAGING_MV}/wine-mono-${STAGING_MV}.msi )
        )
-       mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
        https://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
 
 if [[ ${PV} == "9999" ]] ; then
@@ -50,32 +61,21 @@ fi
 
 LICENSE="LGPL-2.1"
 SLOT="0"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
-       test? ( abi_x86_32 )
+       X? ( truetype )
        elibc_glibc? ( threads )
+       osmesa? ( opengl )
        pipelight? ( staging )
        s3tc? ( staging )
-       vaapi? ( staging )
-       osmesa? ( opengl )" #286560
+       test? ( abi_x86_32 )
+       vaapi? ( staging )" # osmesa-opengl #286560 # X-truetype #551124
 
 # FIXME: the test suite is unsuitable for us; many tests require net access
 # or fail due to Xvfb's opengl limitations.
 RESTRICT="test"
 
 COMMON_DEPEND="
-       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
-       capi? ( net-dialup/capi4k-utils )
-       d3d9? ( media-libs/mesa[d3d9,${MULTILIB_USEDEP}] )
-       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
-       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
-       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
-       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
-       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
-       gstreamer? (
-               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
-               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
-       )
        X? (
                x11-libs/libXcursor[${MULTILIB_USEDEP}]
                x11-libs/libXext[${MULTILIB_USEDEP}]
@@ -83,36 +83,48 @@ COMMON_DEPEND="
                x11-libs/libXi[${MULTILIB_USEDEP}]
                x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
        )
-       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
        alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+       capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
        cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
-       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
-       opengl? (
-               virtual/glu[${MULTILIB_USEDEP}]
-               virtual/opengl[${MULTILIB_USEDEP}]
-       )
+       d3d9? ( media-libs/mesa[d3d9,${MULTILIB_USEDEP}] )
+       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
        gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+       gstreamer? (
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+       )
        jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
-       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
        netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
        nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
        odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+       opengl? (
+               virtual/glu[${MULTILIB_USEDEP}]
+               virtual/opengl[${MULTILIB_USEDEP}]
+       )
        osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
        pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
        pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
-       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
-       xml? (
-               dev-libs/libxml2[${MULTILIB_USEDEP}]
-               dev-libs/libxslt[${MULTILIB_USEDEP}]
-       )
        scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
        ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
-       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
        v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
        vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
        xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+       xml? (
+               dev-libs/libxml2[${MULTILIB_USEDEP}]
+               dev-libs/libxslt[${MULTILIB_USEDEP}]
+       )
        abi_x86_32? (
                !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
                !<app-emulation/emul-linux-x86-baselibs-20140508-r14
@@ -131,28 +143,36 @@ COMMON_DEPEND="
        )"
 
 RDEPEND="${COMMON_DEPEND}
-       dos? ( games-emulation/dosbox )
-       perl? ( dev-lang/perl dev-perl/XML-Simple )
+       dos? ( >=games-emulation/dosbox-0.74_p20160629 )
+       perl? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       pulseaudio? (
+               realtime? ( sys-auth/rtkit )
+       )
        s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
        samba? ( >=net-fs/samba-3.0.25[winbind] )
        selinux? ( sec-policy/selinux-wine )
-       udisks? ( sys-fs/udisks:2 )
-       pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+       udisks? ( sys-fs/udisks:2 )"
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       staging? ( dev-lang/perl dev-perl/XML-Simple )
+       sys-devel/flex
+       >=sys-kernel/linux-headers-2.6
+       virtual/pkgconfig
+       virtual/yacc
        X? (
                x11-proto/inputproto
                x11-proto/xextproto
                x11-proto/xf86vidmodeproto
        )
-       xinerama? ( x11-proto/xineramaproto )
        prelink? ( sys-devel/prelink )
-       >=sys-kernel/linux-headers-2.6
-       virtual/pkgconfig
-       virtual/yacc
-       sys-devel/flex"
+       staging? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       xinerama? ( x11-proto/xineramaproto )"
 
 # These use a non-standard "Wine" category, which is provided by
 # /etc/xdg/applications-merged/wine.menu
@@ -161,42 +181,51 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
-wine_build_environment_check() {
+wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
-       # bug #549768
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
-               einfo "Checking for gcc-5 ms_abi compiler bug ..."
-               $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
-               # Run in subshell to prevent "Aborted" message
-               if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
-                       eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/549768"
-                       eerror
-                       return 1
+       # GCC-specific bugs
+       if tc-is-gcc; then
+               # bug #549768
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+                       ebegin "Checking for gcc-5 ms_abi compiler bug"
+                       $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+                       # Run in subshell to prevent "Aborted" message
+                       ( "${T}"/pr66838 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/549768"
+                               eerror
+                               return 1
+                       fi
                fi
-       fi
-       # bug #574044
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
-               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
-               # Compile in subshell to prevent "Aborted" message
-               if ! ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1; then
-                       eerror "Wine cannot be built with this version of gcc-5.3"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/574044"
-                       eerror
-                       return 1
+               # bug #574044
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+                       ebegin "Checking for gcc-5-3 stack realignment compiler bug"
+                       # Compile in subshell to prevent "Aborted" message
+                       ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "Wine cannot be built with this version of gcc-5.3"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/574044"
+                               eerror
+                               return 1
+                       fi
                fi
        fi
 
+       # Ensure compiler support
        if use abi_x86_64; then
-               einfo "Checking for builtin_ms_va_list ..."
-               if ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1) ; then
-                       einfo "$(tc-getCC) supports builtin_ms_va_list, enabling 64-bit wine"
-               else
+               ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
+               # Compile in subshell to prevent "Aborted" message
+               ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
+               eend $?
+               if [[ $? -ne 0 ]]; then
                        eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
                        eerror
                        eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
@@ -204,6 +233,10 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+}
+
+wine_build_environment_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
        if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
                eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
@@ -214,7 +247,19 @@ wine_build_environment_check() {
 }
 
 pkg_pretend() {
+       wine_compiler_check || die
        wine_build_environment_check || die
+
+       # Verify OSS support
+       if use oss && ! use kernel_FreeBSD; then
+               local oss_vers=$(best_version media-sound/oss)
+               if [[ -z ${oss_vers} ]] || ! version_is_at_least "4" ${oss_vers}; then
+                       eerror "You cannot build wine with USE=oss without having support from a"
+                       eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
+                       eerror
+                       die
+               fi
+       fi
 }
 
 pkg_setup() {
@@ -263,6 +308,7 @@ src_prepare() {
                "${FILESDIR}"/${PN}-1.9.5-multilib-portage.patch #395615
                "${FILESDIR}"/${PN}-1.7.12-osmesa-check.patch #429386
                "${FILESDIR}"/${PN}-1.6-memset-O3.patch #480508
+               "${FILESDIR}"/${PN}-1.8-gnutls-3.5-compat.patch #587028
        )
        if use staging; then
                ewarn "Applying the Wine-Staging patchset. Any bug reports to the"
@@ -429,6 +475,13 @@ multilib_src_install_all() {
                rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
        fi
 
+       # Remove wineconsole if neither backend is installed #551124
+       if ! use X && ! use ncurses; then
+               rm      "${D}"/usr/{bin/,man/man1/}wineconsole* || die
+               use abi_x86_32 && rm "${D}"/usr/lib32/wine/{,fakedlls/}wineconsole.exe* || die
+               use abi_x86_64 && rm "${D}"/usr/lib64/wine/{,fakedlls/}wineconsole.exe* || die
+       fi
+
        use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
        use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}
 
index 529dfbe03cd811b96b620498c56139fed47c108b..e7bbd724f49c5c2cd9ea176204fb8f09d8e78680 100644 (file)
@@ -21,8 +21,10 @@ else
        KEYWORDS="-* ~amd64 ~x86 ~x86-fbsd"
 fi
 
-GV="2.44"
+GV="2.47"
 MV="4.6.2"
+STAGING_GV="2.47"
+STAGING_MV="4.6.2"
 [[ ${MAJOR_V} == "1.8" ]] && SUFFIX="-unofficial"
 STAGING_P="wine-staging-${PV}"
 STAGING_DIR="${WORKDIR}/${STAGING_P}${SUFFIX}"
@@ -32,11 +34,20 @@ WINE_GENTOO="wine-gentoo-2015.03.07"
 DESCRIPTION="Free implementation of Windows(tm) on Unix"
 HOMEPAGE="http://www.winehq.org/"
 SRC_URI="${SRC_URI}
-       gecko? (
-               abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
-               abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+       !staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${GV}/wine_gecko-${GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
+       )
+       staging? (
+               gecko? (
+                       abi_x86_32? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86.msi )
+                       abi_x86_64? ( https://dl.winehq.org/wine/wine-gecko/${STAGING_GV}/wine_gecko-${STAGING_GV}-x86_64.msi )
+               )
+               mono? ( https://dl.winehq.org/wine/wine-mono/${STAGING_MV}/wine-mono-${STAGING_MV}.msi )
        )
-       mono? ( https://dl.winehq.org/wine/wine-mono/${MV}/wine-mono-${MV}.msi )
        https://dev.gentoo.org/~tetromino/distfiles/${PN}/${WINE_GENTOO}.tar.bz2"
 
 if [[ ${PV} == "9999" ]] ; then
@@ -50,32 +61,21 @@ fi
 
 LICENSE="LGPL-2.1"
 SLOT="0"
-IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
+IUSE="+abi_x86_32 +abi_x86_64 +alsa capi cups custom-cflags d3d9 dos elibc_glibc +fontconfig +gecko gphoto2 gsm gstreamer +jpeg kernel_FreeBSD +lcms ldap +mono mp3 ncurses netapi nls odbc openal opencl +opengl osmesa oss +perl pcap pipelight +png prelink pulseaudio +realtime +run-exes s3tc samba scanner selinux +ssl staging test +threads +truetype +udisks v4l vaapi +X +xcomposite xinerama +xml"
 REQUIRED_USE="|| ( abi_x86_32 abi_x86_64 )
-       test? ( abi_x86_32 )
+       X? ( truetype )
        elibc_glibc? ( threads )
+       osmesa? ( opengl )
        pipelight? ( staging )
        s3tc? ( staging )
-       vaapi? ( staging )
-       osmesa? ( opengl )" #286560
+       test? ( abi_x86_32 )
+       vaapi? ( staging )" # osmesa-opengl #286560 # X-truetype #551124
 
 # FIXME: the test suite is unsuitable for us; many tests require net access
 # or fail due to Xvfb's opengl limitations.
 RESTRICT="test"
 
 COMMON_DEPEND="
-       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
-       capi? ( net-dialup/capi4k-utils )
-       d3d9? ( media-libs/mesa[d3d9,${MULTILIB_USEDEP}] )
-       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
-       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
-       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
-       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
-       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
-       gstreamer? (
-               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
-               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
-       )
        X? (
                x11-libs/libXcursor[${MULTILIB_USEDEP}]
                x11-libs/libXext[${MULTILIB_USEDEP}]
@@ -83,36 +83,48 @@ COMMON_DEPEND="
                x11-libs/libXi[${MULTILIB_USEDEP}]
                x11-libs/libXxf86vm[${MULTILIB_USEDEP}]
        )
-       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
        alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
+       capi? ( net-libs/libcapi[${MULTILIB_USEDEP}] )
        cups? ( net-print/cups:=[${MULTILIB_USEDEP}] )
-       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
-       opengl? (
-               virtual/glu[${MULTILIB_USEDEP}]
-               virtual/opengl[${MULTILIB_USEDEP}]
-       )
+       d3d9? ( media-libs/mesa[d3d9,${MULTILIB_USEDEP}] )
+       fontconfig? ( media-libs/fontconfig:=[${MULTILIB_USEDEP}] )
+       gphoto2? ( media-libs/libgphoto2:=[${MULTILIB_USEDEP}] )
        gsm? ( media-sound/gsm:=[${MULTILIB_USEDEP}] )
+       gstreamer? (
+               media-libs/gstreamer:1.0[${MULTILIB_USEDEP}]
+               media-plugins/gst-plugins-meta:1.0[${MULTILIB_USEDEP}]
+       )
        jpeg? ( virtual/jpeg:0=[${MULTILIB_USEDEP}] )
-       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        lcms? ( media-libs/lcms:2=[${MULTILIB_USEDEP}] )
+       ldap? ( net-nds/openldap:=[${MULTILIB_USEDEP}] )
        mp3? ( >=media-sound/mpg123-1.5.0[${MULTILIB_USEDEP}] )
+       ncurses? ( >=sys-libs/ncurses-5.2:0=[${MULTILIB_USEDEP}] )
        netapi? ( net-fs/samba[netapi(+),${MULTILIB_USEDEP}] )
        nls? ( sys-devel/gettext[${MULTILIB_USEDEP}] )
        odbc? ( dev-db/unixODBC:=[${MULTILIB_USEDEP}] )
+       openal? ( media-libs/openal:=[${MULTILIB_USEDEP}] )
+       opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
+       opengl? (
+               virtual/glu[${MULTILIB_USEDEP}]
+               virtual/opengl[${MULTILIB_USEDEP}]
+       )
        osmesa? ( media-libs/mesa[osmesa,${MULTILIB_USEDEP}] )
        pcap? ( net-libs/libpcap[${MULTILIB_USEDEP}] )
+       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
        pulseaudio? ( media-sound/pulseaudio[${MULTILIB_USEDEP}] )
-       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
-       xml? (
-               dev-libs/libxml2[${MULTILIB_USEDEP}]
-               dev-libs/libxslt[${MULTILIB_USEDEP}]
-       )
        scanner? ( media-gfx/sane-backends:=[${MULTILIB_USEDEP}] )
        ssl? ( net-libs/gnutls:=[${MULTILIB_USEDEP}] )
-       png? ( media-libs/libpng:0=[${MULTILIB_USEDEP}] )
+       staging? ( sys-apps/attr[${MULTILIB_USEDEP}] )
+       truetype? ( >=media-libs/freetype-2.0.0[${MULTILIB_USEDEP}] )
+       udisks? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
        v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
        vaapi? ( x11-libs/libva[X,${MULTILIB_USEDEP}] )
        xcomposite? ( x11-libs/libXcomposite[${MULTILIB_USEDEP}] )
+       xinerama? ( x11-libs/libXinerama[${MULTILIB_USEDEP}] )
+       xml? (
+               dev-libs/libxml2[${MULTILIB_USEDEP}]
+               dev-libs/libxslt[${MULTILIB_USEDEP}]
+       )
        abi_x86_32? (
                !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
                !<app-emulation/emul-linux-x86-baselibs-20140508-r14
@@ -131,28 +143,36 @@ COMMON_DEPEND="
        )"
 
 RDEPEND="${COMMON_DEPEND}
-       dos? ( games-emulation/dosbox )
-       perl? ( dev-lang/perl dev-perl/XML-Simple )
+       dos? ( >=games-emulation/dosbox-0.74_p20160629 )
+       perl? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       pulseaudio? (
+               realtime? ( sys-auth/rtkit )
+       )
        s3tc? ( >=media-libs/libtxc_dxtn-1.0.1-r1[${MULTILIB_USEDEP}] )
        samba? ( >=net-fs/samba-3.0.25[winbind] )
        selinux? ( sec-policy/selinux-wine )
-       udisks? ( sys-fs/udisks:2 )
-       pulseaudio? ( realtime? ( sys-auth/rtkit ) )"
+       udisks? ( sys-fs/udisks:2 )"
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       staging? ( dev-lang/perl dev-perl/XML-Simple )
+       sys-devel/flex
+       >=sys-kernel/linux-headers-2.6
+       virtual/pkgconfig
+       virtual/yacc
        X? (
                x11-proto/inputproto
                x11-proto/xextproto
                x11-proto/xf86vidmodeproto
        )
-       xinerama? ( x11-proto/xineramaproto )
        prelink? ( sys-devel/prelink )
-       >=sys-kernel/linux-headers-2.6
-       virtual/pkgconfig
-       virtual/yacc
-       sys-devel/flex"
+       staging? (
+               dev-lang/perl
+               dev-perl/XML-Simple
+       )
+       xinerama? ( x11-proto/xineramaproto )"
 
 # These use a non-standard "Wine" category, which is provided by
 # /etc/xdg/applications-merged/wine.menu
@@ -161,42 +181,51 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
-wine_build_environment_check() {
+wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
-       # bug #549768
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
-               einfo "Checking for gcc-5 ms_abi compiler bug ..."
-               $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
-               # Run in subshell to prevent "Aborted" message
-               if ! ( "${T}"/pr66838 || false ) >/dev/null 2>&1; then
-                       eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/549768"
-                       eerror
-                       return 1
+       # GCC-specific bugs
+       if tc-is-gcc; then
+               # bug #549768
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) -le 2 ]]; then
+                       ebegin "Checking for gcc-5 ms_abi compiler bug"
+                       $(tc-getCC) -O2 "${FILESDIR}"/pr66838.c -o "${T}"/pr66838 || die
+                       # Run in subshell to prevent "Aborted" message
+                       ( "${T}"/pr66838 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "64-bit wine cannot be built with gcc-5.1 or initial patchset of 5.2.0"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.2.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/549768"
+                               eerror
+                               return 1
+                       fi
                fi
-       fi
-       # bug #574044
-       if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
-               einfo "Checking for gcc-5-3 stack realignment compiler bug ..."
-               # Compile in subshell to prevent "Aborted" message
-               if ! ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1; then
-                       eerror "Wine cannot be built with this version of gcc-5.3"
-                       eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
-                       eerror "or use gcc-config to select a different compiler version."
-                       eerror "See https://bugs.gentoo.org/574044"
-                       eerror
-                       return 1
+               # bug #574044
+               if use abi_x86_64 && [[ $(gcc-major-version) = 5 && $(gcc-minor-version) = 3 ]]; then
+                       ebegin "Checking for gcc-5-3 stack realignment compiler bug"
+                       # Compile in subshell to prevent "Aborted" message
+                       ( $(tc-getCC) -O2 -mincoming-stack-boundary=3 "${FILESDIR}"/pr69140.c -o "${T}"/pr69140 || false ) >/dev/null 2>&1
+                       eend $?
+                       if [[ $? -ne 0 ]] ; then
+                               eerror "Wine cannot be built with this version of gcc-5.3"
+                               eerror "due to compiler bugs; please re-emerge the latest gcc-5.3.x ebuild,"
+                               eerror "or use gcc-config to select a different compiler version."
+                               eerror "See https://bugs.gentoo.org/574044"
+                               eerror
+                               return 1
+                       fi
                fi
        fi
 
+       # Ensure compiler support
        if use abi_x86_64; then
-               einfo "Checking for builtin_ms_va_list ..."
-               if ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1) ; then
-                       einfo "$(tc-getCC) supports builtin_ms_va_list, enabling 64-bit wine"
-               else
+               ebegin "Checking for 64-bit compiler with builtin_ms_va_list support"
+               # Compile in subshell to prevent "Aborted" message
+               ( $(tc-getCC) -O2 "${FILESDIR}"/builtin_ms_va_list.c -o "${T}"/builtin_ms_va_list >/dev/null 2>&1)
+               eend $?
+               if [[ $? -ne 0 ]]; then
                        eerror "This version of $(tc-getCC) does not support builtin_ms_va_list, can't enable 64-bit wine"
                        eerror
                        eerror "You need gcc-4.4+ or clang 3.8+ to build 64-bit wine"
@@ -204,6 +233,10 @@ wine_build_environment_check() {
                        return 1
                fi
        fi
+}
+
+wine_build_environment_check() {
+       [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
        if use abi_x86_32 && use opencl && [[ x$(eselect opencl show 2> /dev/null) = "xintel" ]]; then
                eerror "You cannot build wine with USE=opencl because intel-ocl-sdk is 64-bit only."
@@ -214,7 +247,19 @@ wine_build_environment_check() {
 }
 
 pkg_pretend() {
+       wine_compiler_check || die
        wine_build_environment_check || die
+
+       # Verify OSS support
+       if use oss && ! use kernel_FreeBSD; then
+               local oss_vers=$(best_version media-sound/oss)
+               if [[ -z ${oss_vers} ]] || ! version_is_at_least "4" ${oss_vers}; then
+                       eerror "You cannot build wine with USE=oss without having support from a"
+                       eerror "FreeBSD kernel or >=media-sound/oss-4 (only available through external repos)"
+                       eerror
+                       die
+               fi
+       fi
 }
 
 pkg_setup() {
@@ -429,6 +474,13 @@ multilib_src_install_all() {
                rm "${D}"usr/bin/{wine{dump,maker},function_grep.pl} "${D}"usr/share/man/man1/wine{dump,maker}.1 || die
        fi
 
+       # Remove wineconsole if neither backend is installed #551124
+       if ! use X && ! use ncurses; then
+               rm      "${D}"/usr/{bin/,man/man1/}wineconsole* || die
+               use abi_x86_32 && rm "${D}"/usr/lib32/wine/{,fakedlls/}wineconsole.exe* || die
+               use abi_x86_64 && rm "${D}"/usr/lib64/wine/{,fakedlls/}wineconsole.exe* || die
+       fi
+
        use abi_x86_32 && pax-mark psmr "${D}"usr/bin/wine{,-preloader} #255055
        use abi_x86_64 && pax-mark psmr "${D}"usr/bin/wine64{,-preloader}