commit:     e04596531f1f4eed078d0f65694f28e01bfc660c
Author:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 24 23:25:27 2018 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Sat Feb 24 23:25:27 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0459653

net-misc/ntpsec: improve python

Package-Manager: Portage-2.3.19, Repoman-2.3.6

 ...psec-1.0.0-r1.ebuild => ntpsec-1.0.0-r2.ebuild} | 52 +++++++++++++++-------
 1 file changed, 37 insertions(+), 15 deletions(-)

diff --git a/net-misc/ntpsec/ntpsec-1.0.0-r1.ebuild 
b/net-misc/ntpsec/ntpsec-1.0.0-r2.ebuild
similarity index 72%
rename from net-misc/ntpsec/ntpsec-1.0.0-r1.ebuild
rename to net-misc/ntpsec/ntpsec-1.0.0-r2.ebuild
index 91a7ea1e911..46136f2fa0e 100644
--- a/net-misc/ntpsec/ntpsec-1.0.0-r1.ebuild
+++ b/net-misc/ntpsec/ntpsec-1.0.0-r2.ebuild
@@ -3,10 +3,10 @@
 
 EAPI=6
 
-PYTHON_COMPAT=( python3_{4,5,6} )
+PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
 PYTHON_REQ_USE='threads(+)'
 
-inherit flag-o-matic python-any-r1 waf-utils systemd user
+inherit flag-o-matic python-r1 waf-utils systemd user
 
 if [[ ${PV} == *9999* ]]; then
        inherit git-r3
@@ -39,7 +39,7 @@ REQUIRED_USE="${PYTHON_REQUIRED_USE}"
 CDEPEND="${PYTHON_DEPS}
        ${BDEPEND}
        sys-libs/libcap
-       dev-python/psutil
+       dev-python/psutil[${PYTHON_USEDEP}]
        libressl? ( dev-libs/libressl:0= )
        !libressl? ( dev-libs/openssl:0= )
        seccomp? ( sys-libs/libseccomp )
@@ -58,11 +58,15 @@ DEPEND="${CDEPEND}
 "
 
 pkg_setup() {
-       python-any-r1_pkg_setup
        enewgroup ntp 123
        enewuser ntp 123 -1 /dev/null ntp
 }
 
+src_prepare() {
+       default
+       python_copy_sources
+}
+
 src_configure() {
        is-flagq -flto* && filter-flags -flto* -fuse-linker-plugin
 
@@ -80,20 +84,38 @@ src_configure() {
        # Remove autostripping of binaries
        sed -i -e '/Strip binaries/d' wscript
 
-       waf-utils_src_configure --nopyc --nopyo --refclock="${CLOCKSTRING}" \
-               $(use   doc                     && echo "--enable-doc") \
-               $(use   early           && echo "--enable-early-droproot") \
-               $(use   gdb                     && echo "--enable-debug-gdb") \
-               $(use   nist            && echo "--enable-lockclock") \
-               $(use   samba           && echo "--enable-mssntp") \
-               $(use   seccomp         && echo "--enable-seccomp") \
-               $(use   smear           && echo "--enable-leap-smear") \
-               $(use   tests           && echo "--alltests") \
-               $(use_enable debug debug)
+       local myconf=(
+               --nopyc
+               --nopyo
+               --refclock="${CLOCKSTRING}"
+               $(use doc       && echo "--enable-doc")
+               $(use early     && echo "--enable-early-droproot")
+               $(use gdb       && echo "--enable-debug-gdb")
+               $(use nist      && echo "--enable-lockclock")
+               $(use samba     && echo "--enable-mssntp")
+               $(use seccomp   && echo "--enable-seccomp")
+               $(use smear     && echo "--enable-leap-smear")
+               $(use tests     && echo "--alltests")
+               $(use_enable debug debug) )
+
+       python_configure() {
+               waf-utils_src_configure "${myconf[@]}"
+       }
+       python_foreach_impl run_in_build_dir python_configure
+}
+
+src_compile() {
+       python_compile() {
+               waf-utils_src_compile
+       }
+       python_foreach_impl run_in_build_dir python_compile
 }
 
 src_install() {
-       waf-utils_src_install
+       python_install() {
+               waf-utils_src_install
+       }
+       python_foreach_impl run_in_build_dir python_install
 
        # Install heat generating scripts
        use heat && dosbin "${S}/contrib/ntpheat"{,usb}

Reply via email to