commit:     66f821f2e7070911693cadb92cdf88e2101abb86
Author:     NP-Hardass <NP-Hardass <AT> gentoo <DOT> org>
AuthorDate: Sun Nov  5 05:37:27 2017 +0000
Commit:     NP Hardass <np-hardass <AT> gentoo <DOT> org>
CommitDate: Sun Nov  5 05:53:13 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66f821f2

app-emulation/wine-any: Refactor to dynamically add patchbin dep

Closes: https://bugs.gentoo.org/show_bug.cgi?id=635222
Package-Manager: Portage-2.3.13, Repoman-2.3.4

 app-emulation/wine-any/wine-any-2.0-r1.ebuild  | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.1-r1.ebuild  | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.10-r1.ebuild | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.11-r1.ebuild | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.12-r1.ebuild | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.13-r1.ebuild | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.14-r1.ebuild | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.15-r1.ebuild | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.16-r1.ebuild | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.17-r1.ebuild | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.2-r1.ebuild  | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.3-r1.ebuild  | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.4-r1.ebuild  | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.5-r1.ebuild  | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.6-r1.ebuild  | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.7-r1.ebuild  | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.8-r1.ebuild  | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-2.9-r1.ebuild  | 30 +++++++++++++++-----------
 app-emulation/wine-any/wine-any-9999.ebuild    | 23 ++++++++++++--------
 19 files changed, 338 insertions(+), 225 deletions(-)

diff --git a/app-emulation/wine-any/wine-any-2.0-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.0-r1.ebuild
index 1f852d12933..dc51b1c096d 100644
--- a/app-emulation/wine-any/wine-any-2.0-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.0-r1.ebuild
@@ -162,7 +162,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -186,6 +185,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -361,17 +377,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.1-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.1-r1.ebuild
index a3ff004af12..046c4b34f30 100644
--- a/app-emulation/wine-any/wine-any-2.1-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.1-r1.ebuild
@@ -162,7 +162,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -186,6 +185,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -361,17 +377,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.10-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.10-r1.ebuild
index fa9d38ad8f3..61c306c39f6 100644
--- a/app-emulation/wine-any/wine-any-2.10-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.10-r1.ebuild
@@ -163,7 +163,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -187,6 +186,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -362,17 +378,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.11-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.11-r1.ebuild
index fa9d38ad8f3..61c306c39f6 100644
--- a/app-emulation/wine-any/wine-any-2.11-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.11-r1.ebuild
@@ -163,7 +163,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -187,6 +186,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -362,17 +378,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.12-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.12-r1.ebuild
index fa9d38ad8f3..61c306c39f6 100644
--- a/app-emulation/wine-any/wine-any-2.12-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.12-r1.ebuild
@@ -163,7 +163,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -187,6 +186,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -362,17 +378,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.13-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.13-r1.ebuild
index fa9d38ad8f3..61c306c39f6 100644
--- a/app-emulation/wine-any/wine-any-2.13-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.13-r1.ebuild
@@ -163,7 +163,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -187,6 +186,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -362,17 +378,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.14-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.14-r1.ebuild
index 9c433244fe9..759f602d174 100644
--- a/app-emulation/wine-any/wine-any-2.14-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.14-r1.ebuild
@@ -163,7 +163,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -187,6 +186,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -362,17 +378,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.15-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.15-r1.ebuild
index 9c433244fe9..759f602d174 100644
--- a/app-emulation/wine-any/wine-any-2.15-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.15-r1.ebuild
@@ -163,7 +163,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -187,6 +186,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -362,17 +378,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.16-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.16-r1.ebuild
index 9c433244fe9..759f602d174 100644
--- a/app-emulation/wine-any/wine-any-2.16-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.16-r1.ebuild
@@ -163,7 +163,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -187,6 +186,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -362,17 +378,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.17-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.17-r1.ebuild
index 9c433244fe9..759f602d174 100644
--- a/app-emulation/wine-any/wine-any-2.17-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.17-r1.ebuild
@@ -163,7 +163,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -187,6 +186,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -362,17 +378,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.2-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.2-r1.ebuild
index a3ff004af12..046c4b34f30 100644
--- a/app-emulation/wine-any/wine-any-2.2-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.2-r1.ebuild
@@ -162,7 +162,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -186,6 +185,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -361,17 +377,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.3-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.3-r1.ebuild
index a3ff004af12..046c4b34f30 100644
--- a/app-emulation/wine-any/wine-any-2.3-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.3-r1.ebuild
@@ -162,7 +162,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -186,6 +185,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -361,17 +377,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.4-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.4-r1.ebuild
index d088dfeca61..26addaa023d 100644
--- a/app-emulation/wine-any/wine-any-2.4-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.4-r1.ebuild
@@ -162,7 +162,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -186,6 +185,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -361,17 +377,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.5-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.5-r1.ebuild
index d088dfeca61..26addaa023d 100644
--- a/app-emulation/wine-any/wine-any-2.5-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.5-r1.ebuild
@@ -162,7 +162,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -186,6 +185,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -361,17 +377,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.6-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.6-r1.ebuild
index d088dfeca61..26addaa023d 100644
--- a/app-emulation/wine-any/wine-any-2.6-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.6-r1.ebuild
@@ -162,7 +162,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -186,6 +185,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -361,17 +377,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.7-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.7-r1.ebuild
index d088dfeca61..26addaa023d 100644
--- a/app-emulation/wine-any/wine-any-2.7-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.7-r1.ebuild
@@ -162,7 +162,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -186,6 +185,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -361,17 +377,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.8-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.8-r1.ebuild
index d088dfeca61..26addaa023d 100644
--- a/app-emulation/wine-any/wine-any-2.8-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.8-r1.ebuild
@@ -162,7 +162,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -186,6 +185,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -361,17 +377,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-2.9-r1.ebuild 
b/app-emulation/wine-any/wine-any-2.9-r1.ebuild
index fa9d38ad8f3..61c306c39f6 100644
--- a/app-emulation/wine-any/wine-any-2.9-r1.ebuild
+++ b/app-emulation/wine-any/wine-any-2.9-r1.ebuild
@@ -163,7 +163,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -187,6 +186,23 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+       "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
+       "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
+)
+PATCHES_BIN=(
+       "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
+)
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -362,17 +378,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-               "${PATCHDIR}/patches/freetype-2.8.1-segfault.patch" #631676
-               "${PATCHDIR}/patches/freetype-2.8.1-drop-glyphs.patch" #631376
-       )
-       local PATCHES_BIN=(
-               "${PATCHDIR}/patches/freetype-2.8.1-patch-fonts.patch" #631376
-       )
+
        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."

diff --git a/app-emulation/wine-any/wine-any-9999.ebuild 
b/app-emulation/wine-any/wine-any-9999.ebuild
index 028bc0199d4..5fb96a29e62 100644
--- a/app-emulation/wine-any/wine-any-9999.ebuild
+++ b/app-emulation/wine-any/wine-any-9999.ebuild
@@ -163,7 +163,6 @@ RDEPEND="${COMMON_DEPEND}
 
 # tools/make_requests requires perl
 DEPEND="${COMMON_DEPEND}
-       dev-util/patchbin
        sys-devel/flex
        >=sys-kernel/linux-headers-2.6
        virtual/pkgconfig
@@ -187,6 +186,19 @@ usr/share/applications/wine-notepad.desktop
 usr/share/applications/wine-uninstaller.desktop
 usr/share/applications/wine-winecfg.desktop"
 
+PATCHES=(
+       "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
+       "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" #395615
+       "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
+       "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
+)
+PATCHES_BIN=()
+
+# https://bugs.gentoo.org/show_bug.cgi?id=635222
+if [[ ${#PATCHES_BIN[@]} -ge 1 ]] || [[ ${PV} == 9999 ]]; then
+       DEPEND+=" dev-util/patchbin"
+fi
+
 wine_compiler_check() {
        [[ ${MERGE_TYPE} = "binary" ]] && return 0
 
@@ -362,14 +374,7 @@ src_prepare() {
        }
 
        local md5="$(md5sum server/protocol.def)"
-       local PATCHES=(
-               "${PATCHDIR}/patches/${MY_PN}-1.5.26-winegcc.patch" #260726
-               "${PATCHDIR}/patches/${MY_PN}-1.9.5-multilib-portage.patch" 
#395615
-               "${PATCHDIR}/patches/${MY_PN}-1.6-memset-O3.patch" #480508
-               "${PATCHDIR}/patches/${MY_PN}-2.0-multislot-apploader.patch"
-       )
-       local PATCHES_BIN=(
-       )
+
        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."

Reply via email to