commit:     fc44b576f81ef08320480c9b4c1cfe00f842bee9
Author:     Akinori Hattori <hattya <AT> gentoo <DOT> org>
AuthorDate: Sat May 16 14:32:02 2020 +0000
Commit:     Akinori Hattori <hattya <AT> gentoo <DOT> org>
CommitDate: Sat May 16 14:47:45 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc44b576

app-i18n/nkf: fix build with USE=python

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Akinori Hattori <hattya <AT> gentoo.org>

 app-i18n/nkf/nkf-2.1.3-r2.ebuild | 19 +++++++++++++++++++
 app-i18n/nkf/nkf-2.1.4.ebuild    | 19 +++++++++++++++++++
 2 files changed, 38 insertions(+)

diff --git a/app-i18n/nkf/nkf-2.1.3-r2.ebuild b/app-i18n/nkf/nkf-2.1.3-r2.ebuild
index 5aebc9371fa..6c07e5dae6e 100644
--- a/app-i18n/nkf/nkf-2.1.3-r2.ebuild
+++ b/app-i18n/nkf/nkf-2.1.3-r2.ebuild
@@ -3,6 +3,8 @@
 
 EAPI="6"
 PYTHON_COMPAT=( python2_7 )
+DISTUTILS_OPTIONAL="1"
+DISTUTILS_USE_SETUPTOOLS="no"
 
 inherit distutils-r1 perl-module toolchain-funcs
 
@@ -16,6 +18,15 @@ LICENSE="ZLIB"
 SLOT="0"
 KEYWORDS="~alpha amd64 hppa ~ia64 ppc ppc64 sparc x86 ~x86-macos"
 IUSE="perl python l10n_ja"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="python? (
+               ${PYTHON_DEPS}
+               $(python_gen_cond_dep '
+                       dev-python/setuptools[${PYTHON_USEDEP}]
+               ')
+       )"
+DEPEND="${RDEPEND}"
 
 src_prepare() {
        sed -i \
@@ -28,6 +39,9 @@ src_prepare() {
        if use python; then
                mv "${WORKDIR}"/NKF.python . || die
                eapply "${FILESDIR}"/${P}-strip.patch
+               cd NKF.python
+               distutils-r1_src_prepare
+               cd - >/dev/null
        fi
 
        default
@@ -40,6 +54,11 @@ src_configure() {
                perl-module_src_configure
                cd - >/dev/null
        fi
+       if use python; then
+               cd NKF.python
+               distutils-r1_src_configure
+               cd - >/dev/null
+       fi
 }
 
 src_compile() {

diff --git a/app-i18n/nkf/nkf-2.1.4.ebuild b/app-i18n/nkf/nkf-2.1.4.ebuild
index 0e5fcaa2bbe..e229db43399 100644
--- a/app-i18n/nkf/nkf-2.1.4.ebuild
+++ b/app-i18n/nkf/nkf-2.1.4.ebuild
@@ -3,6 +3,8 @@
 
 EAPI="7"
 PYTHON_COMPAT=( python3_{6,7,8} )
+DISTUTILS_OPTIONAL="1"
+DISTUTILS_USE_SETUPTOOLS="no"
 
 inherit distutils-r1 perl-module toolchain-funcs vcs-snapshot
 
@@ -18,6 +20,15 @@ LICENSE="ZLIB python? ( BSD )"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-macos"
 IUSE="perl python l10n_ja"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="python? (
+               ${PYTHON_DEPS}
+               $(python_gen_cond_dep '
+                       dev-python/setuptools[${PYTHON_USEDEP}]
+               ')
+       )"
+DEPEND="${RDEPEND}"
 
 src_unpack() {
        use python && vcs-snapshot_src_unpack || default
@@ -31,6 +42,9 @@ src_prepare() {
        if use python; then
                mv "${WORKDIR}"/${PY_P} NKF.python || die
                eapply "${FILESDIR}"/${P}-python.patch
+               cd NKF.python
+               distutils-r1_src_prepare
+               cd - >/dev/null
        fi
 
        default
@@ -43,6 +57,11 @@ src_configure() {
                perl-module_src_configure
                cd - >/dev/null
        fi
+       if use python; then
+               cd NKF.python
+               distutils-r1_src_configure
+               cd - >/dev/null
+       fi
 }
 
 src_compile() {

Reply via email to