commit:     039fcf5b81122e14fa915eb4755fc2271ffcec80
Author:     NP-Hardass <NP-Hardass <AT> gentoo <DOT> org>
AuthorDate: Sun Nov  5 05:06:58 2017 +0000
Commit:     NP Hardass <np-hardass <AT> gentoo <DOT> org>
CommitDate: Sun Nov  5 05:53:03 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=039fcf5b

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

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

 .../wine-staging/wine-staging-2.0-r1.ebuild        | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.1-r1.ebuild        | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.10-r1.ebuild       | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.11-r1.ebuild       | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.12-r1.ebuild       | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.13-r1.ebuild       | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.14-r1.ebuild       | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.15-r1.ebuild       | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.16-r1.ebuild       | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.17-r1.ebuild       | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.18.ebuild          | 23 ++++++++++-------
 .../wine-staging/wine-staging-2.2-r1.ebuild        | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.3-r1.ebuild        | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.4-r1.ebuild        | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.5-r1.ebuild        | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.6-r1.ebuild        | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.7-r1.ebuild        | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.8-r1.ebuild        | 30 +++++++++++++---------
 .../wine-staging/wine-staging-2.9-r1.ebuild        | 30 +++++++++++++---------
 .../wine-staging/wine-staging-9999.ebuild          | 23 ++++++++++-------
 20 files changed, 352 insertions(+), 234 deletions(-)

diff --git a/app-emulation/wine-staging/wine-staging-2.0-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.0-r1.ebuild
index 0c4b6b962ec..1aeafd492e5 100644
--- a/app-emulation/wine-staging/wine-staging-2.0-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.0-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.1-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.1-r1.ebuild
index 04fe221e510..1177c5533ac 100644
--- a/app-emulation/wine-staging/wine-staging-2.1-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.1-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.10-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.10-r1.ebuild
index d41fb3977fc..f4d14b26fc4 100644
--- a/app-emulation/wine-staging/wine-staging-2.10-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.10-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.11-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.11-r1.ebuild
index d41fb3977fc..f4d14b26fc4 100644
--- a/app-emulation/wine-staging/wine-staging-2.11-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.11-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.12-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.12-r1.ebuild
index d41fb3977fc..f4d14b26fc4 100644
--- a/app-emulation/wine-staging/wine-staging-2.12-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.12-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.13-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.13-r1.ebuild
index d41fb3977fc..f4d14b26fc4 100644
--- a/app-emulation/wine-staging/wine-staging-2.13-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.13-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.14-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.14-r1.ebuild
index 72cf8da0423..a5b3fa57a03 100644
--- a/app-emulation/wine-staging/wine-staging-2.14-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.14-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.15-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.15-r1.ebuild
index 72cf8da0423..a5b3fa57a03 100644
--- a/app-emulation/wine-staging/wine-staging-2.15-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.15-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.16-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.16-r1.ebuild
index 72cf8da0423..a5b3fa57a03 100644
--- a/app-emulation/wine-staging/wine-staging-2.16-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.16-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.17-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.17-r1.ebuild
index 72cf8da0423..a5b3fa57a03 100644
--- a/app-emulation/wine-staging/wine-staging-2.17-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.17-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.18.ebuild 
b/app-emulation/wine-staging/wine-staging-2.18.ebuild
index 64f408768d4..cacc432e250 100644
--- a/app-emulation/wine-staging/wine-staging-2.18.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.18.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,14 +359,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."

diff --git a/app-emulation/wine-staging/wine-staging-2.2-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.2-r1.ebuild
index 04fe221e510..1177c5533ac 100644
--- a/app-emulation/wine-staging/wine-staging-2.2-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.2-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.3-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.3-r1.ebuild
index 04fe221e510..1177c5533ac 100644
--- a/app-emulation/wine-staging/wine-staging-2.3-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.3-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.4-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.4-r1.ebuild
index d41fb3977fc..f4d14b26fc4 100644
--- a/app-emulation/wine-staging/wine-staging-2.4-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.4-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.5-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.5-r1.ebuild
index d41fb3977fc..f4d14b26fc4 100644
--- a/app-emulation/wine-staging/wine-staging-2.5-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.5-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.6-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.6-r1.ebuild
index d41fb3977fc..f4d14b26fc4 100644
--- a/app-emulation/wine-staging/wine-staging-2.6-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.6-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.7-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.7-r1.ebuild
index d41fb3977fc..f4d14b26fc4 100644
--- a/app-emulation/wine-staging/wine-staging-2.7-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.7-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.8-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.8-r1.ebuild
index d41fb3977fc..f4d14b26fc4 100644
--- a/app-emulation/wine-staging/wine-staging-2.8-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.8-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-2.9-r1.ebuild 
b/app-emulation/wine-staging/wine-staging-2.9-r1.ebuild
index d41fb3977fc..f4d14b26fc4 100644
--- a/app-emulation/wine-staging/wine-staging-2.9-r1.ebuild
+++ b/app-emulation/wine-staging/wine-staging-2.9-r1.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,17 +363,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-staging/wine-staging-9999.ebuild 
b/app-emulation/wine-staging/wine-staging-9999.ebuild
index 64f408768d4..cacc432e250 100644
--- a/app-emulation/wine-staging/wine-staging-9999.ebuild
+++ b/app-emulation/wine-staging/wine-staging-9999.ebuild
@@ -152,7 +152,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
@@ -176,6 +175,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
 
@@ -347,14 +359,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