From d3273e0b880ef207daf296b3586de72a7dcdc0cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B8=D1=80=D0=B5=D1=86=D0=BA=D0=B8=D0=B9=20=D0=9C?= =?UTF-8?q?=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Mon, 1 Feb 2021 11:32:26 +0300 Subject: [PATCH] Restore python2 eclasses --- ....ebuild => PyQt5-python2-5.14.2-r3.ebuild} | 2 +- ...ld => PyQt5-sip-python2-4.19.22-r2.ebuild} | 2 +- ...ebuild => certifi-python2-10001-r1.ebuild} | 6 +- ...4.ebuild => cffi-python2-1.14.0-r5.ebuild} | 4 +- ...ild => cryptography-python2-2.9-r4.ebuild} | 4 +- ...build => cython-python2-0.29.21-r3.ebuild} | 6 +- ...1.ebuild => dbus-python2-1.2.16-r2.ebuild} | 2 +- ...1.1.6-r2.ebuild => enum34-1.1.6-r3.ebuild} | 4 +- ...ild => faulthandler-python2-3.0-r2.ebuild} | 4 +- ...3-r1.ebuild => ipaddress-1.0.23-r2.ebuild} | 4 +- ...r2.ebuild => lxml-python2-4.5.2-r3.ebuild} | 8 +- ...uild => m2crypto-python2-0.36.0-r3.ebuild} | 8 +- ....ebuild => numpy-python2-1.16.6-r2.ebuild} | 10 +- ...ebuild => pexpect-python2-4.8.0-r2.ebuild} | 6 +- ...1-r1.ebuild => ply-python2-3.11-r2.ebuild} | 4 +- ...ild => ptyprocess-python2-0.6.0-r2.ebuild} | 4 +- ...r1.ebuild => py-smbpasswd-1.0.2-r2.ebuild} | 2 +- ...=> pyasn1-modules-python2-0.2.8-r2.ebuild} | 4 +- ....ebuild => pyasn1-python2-0.4.8-r2.ebuild} | 4 +- .../pycairo-python2-1.18.2-r1.ebuild | 6 +- ...build => pycparser-python2-2.20-r2.ebuild} | 8 +- ...uild => pyinotify-python2-0.9.6-r2.ebuild} | 4 +- ...build => pymilter-python2-0.9.3-r2.ebuild} | 4 +- ...build => pyopengl-python2-3.1.0-r3.ebuild} | 2 +- ...ild => pyopenssl-python2-19.1.0-r3.ebuild} | 6 +- ...r1.ebuild => python2-ldap-3.2.0-r2.ebuild} | 8 +- ...1.ebuild => pytz-python2-2020.1-r2.ebuild} | 4 +- ....6.0-r4.ebuild => pyxattr-0.6.0-r5.ebuild} | 6 +- ...-0.8.4-r4.ebuild => pyxml-0.8.4-r5.ebuild} | 8 +- ...ld => setuptools-python2-46.4.0-r4.ebuild} | 6 +- ...2.ebuild => sip-python2-4.19.22-r3.ebuild} | 2 +- ...r1.ebuild => six-python2-1.15.0-r2.ebuild} | 4 +- dev-python/sjcl/sjcl-0.2.1.ebuild | 2 +- ....0.0-r5.ebuild => soaplib-1.0.0-r6.ebuild} | 4 +- ...1.0.1-r2.ebuild => sudsds-1.0.1-r3.ebuild} | 2 +- ...build => typing-python2-3.7.4.3-r2.ebuild} | 4 +- ...-r1.ebuild => wxpython2-3.0.2.0-r2.ebuild} | 10 +- eclass/calculate-utils-r10.eclass | 325 ---- ...-r11.eclass => calculate-utils-r12.eclass} | 20 +- eclass/distutils2.eclass | 1232 ++++++++++++++ eclass/python2-utils.eclass | 1450 +++++++++++++++++ eclass/python2.eclass | 868 ++++++++++ ...r3.ebuild => displaycal-3.8.9.3-r4.ebuild} | 4 +- net-libs/dslib/dslib-3.0-r3.ebuild | 2 +- ....ebuild => calculate-lib-2.1.12-r7.ebuild} | 2 +- .../calculate-lib-2.1.9999.ebuild | 2 +- .../calculate-server-2.1.19-r15.ebuild | 196 --- ...ild => calculate-server-2.1.19-r21.ebuild} | 6 +- .../calculate-server-2.1.9999.ebuild | 2 +- ...ild => calculate-utils-3.6.8.10-r1.ebuild} | 2 +- ...ild => calculate-utils-3.6.8.11-r1.ebuild} | 2 +- ...ild => calculate-utils-3.6.8.14-r1.ebuild} | 2 +- ...ild => calculate-utils-3.6.8.15-r4.ebuild} | 2 +- ...ild => calculate-utils-3.6.8.16-r1.ebuild} | 2 +- ...ild => calculate-utils-3.6.8.17-r1.ebuild} | 2 +- ...ild => calculate-utils-3.6.8.18-r1.ebuild} | 2 +- .../calculate-utils-3.6.9999.ebuild | 2 +- 57 files changed, 3666 insertions(+), 637 deletions(-) rename dev-python/PyQt5-python2/{PyQt5-python2-5.14.2-r2.ebuild => PyQt5-python2-5.14.2-r3.ebuild} (99%) rename dev-python/PyQt5-sip-python2/{PyQt5-sip-python2-4.19.22-r1.ebuild => PyQt5-sip-python2-4.19.22-r2.ebuild} (98%) rename dev-python/certifi-python2/{certifi-python2-10001.ebuild => certifi-python2-10001-r1.ebuild} (92%) rename dev-python/cffi-python2/{cffi-python2-1.14.0-r4.ebuild => cffi-python2-1.14.0-r5.ebuild} (94%) rename dev-python/cryptography-python2/{cryptography-python2-2.9-r3.ebuild => cryptography-python2-2.9-r4.ebuild} (96%) rename dev-python/cython-python2/{cython-python2-0.29.21-r2.ebuild => cython-python2-0.29.21-r3.ebuild} (93%) rename dev-python/dbus-python2/{dbus-python2-1.2.16-r1.ebuild => dbus-python2-1.2.16-r2.ebuild} (98%) rename dev-python/enum34/{enum34-1.1.6-r2.ebuild => enum34-1.1.6-r3.ebuild} (93%) rename dev-python/faulthandler-python2/{faulthandler-python2-3.0-r1.ebuild => faulthandler-python2-3.0-r2.ebuild} (93%) rename dev-python/ipaddress/{ipaddress-1.0.23-r1.ebuild => ipaddress-1.0.23-r2.ebuild} (93%) rename dev-python/lxml-python2/{lxml-python2-4.5.2-r2.ebuild => lxml-python2-4.5.2-r3.ebuild} (92%) rename dev-python/m2crypto-python2/{m2crypto-python2-0.36.0-r2.ebuild => m2crypto-python2-0.36.0-r3.ebuild} (90%) rename dev-python/numpy-python2/{numpy-python2-1.16.6-r1.ebuild => numpy-python2-1.16.6-r2.ebuild} (94%) rename dev-python/pexpect-python2/{pexpect-python2-4.8.0-r1.ebuild => pexpect-python2-4.8.0-r2.ebuild} (92%) rename dev-python/ply-python2/{ply-python2-3.11-r1.ebuild => ply-python2-3.11-r2.ebuild} (94%) rename dev-python/ptyprocess-python2/{ptyprocess-python2-0.6.0-r1.ebuild => ptyprocess-python2-0.6.0-r2.ebuild} (92%) rename dev-python/py-smbpasswd/{py-smbpasswd-1.0.2-r1.ebuild => py-smbpasswd-1.0.2-r2.ebuild} (96%) rename dev-python/pyasn1-modules-python2/{pyasn1-modules-python2-0.2.8-r1.ebuild => pyasn1-modules-python2-0.2.8-r2.ebuild} (93%) rename dev-python/pyasn1-python2/{pyasn1-python2-0.4.8-r1.ebuild => pyasn1-python2-0.4.8-r2.ebuild} (93%) rename dev-python/pycparser-python2/{pycparser-python2-2.20-r1.ebuild => pycparser-python2-2.20-r2.ebuild} (93%) rename dev-python/pyinotify-python2/{pyinotify-python2-0.9.6-r1.ebuild => pyinotify-python2-0.9.6-r2.ebuild} (93%) rename dev-python/pymilter-python2/{pymilter-python2-0.9.3-r1.ebuild => pymilter-python2-0.9.3-r2.ebuild} (93%) rename dev-python/pyopengl-python2/{pyopengl-python2-3.1.0-r2.ebuild => pyopengl-python2-3.1.0-r3.ebuild} (97%) rename dev-python/pyopenssl-python2/{pyopenssl-python2-19.1.0-r2.ebuild => pyopenssl-python2-19.1.0-r3.ebuild} (92%) rename dev-python/python2-ldap/{python2-ldap-3.2.0-r1.ebuild => python2-ldap-3.2.0-r2.ebuild} (93%) rename dev-python/pytz-python2/{pytz-python2-2020.1-r1.ebuild => pytz-python2-2020.1-r2.ebuild} (95%) rename dev-python/pyxattr/{pyxattr-0.6.0-r4.ebuild => pyxattr-0.6.0-r5.ebuild} (90%) rename dev-python/pyxml/{pyxml-0.8.4-r4.ebuild => pyxml-0.8.4-r5.ebuild} (91%) rename dev-python/setuptools-python2/{setuptools-python2-46.4.0-r3.ebuild => setuptools-python2-46.4.0-r4.ebuild} (96%) rename dev-python/sip-python2/{sip-python2-4.19.22-r2.ebuild => sip-python2-4.19.22-r3.ebuild} (98%) rename dev-python/six-python2/{six-python2-1.15.0-r1.ebuild => six-python2-1.15.0-r2.ebuild} (94%) rename dev-python/soaplib/{soaplib-1.0.0-r5.ebuild => soaplib-1.0.0-r6.ebuild} (91%) rename dev-python/sudsds/{sudsds-1.0.1-r2.ebuild => sudsds-1.0.1-r3.ebuild} (95%) rename dev-python/typing-python2/{typing-python2-3.7.4.3-r1.ebuild => typing-python2-3.7.4.3-r2.ebuild} (93%) rename dev-python/wxpython2/{wxpython2-3.0.2.0-r1.ebuild => wxpython2-3.0.2.0-r2.ebuild} (95%) delete mode 100644 eclass/calculate-utils-r10.eclass rename eclass/{calculate-utils-r11.eclass => calculate-utils-r12.eclass} (95%) create mode 100644 eclass/distutils2.eclass create mode 100644 eclass/python2-utils.eclass create mode 100644 eclass/python2.eclass rename media-gfx/displaycal/{displaycal-3.8.9.3-r3.ebuild => displaycal-3.8.9.3-r4.ebuild} (96%) rename sys-apps/calculate-lib/{calculate-lib-2.1.12-r6.ebuild => calculate-lib-2.1.12-r7.ebuild} (97%) delete mode 100644 sys-apps/calculate-server/calculate-server-2.1.19-r15.ebuild rename sys-apps/calculate-server/{calculate-server-2.1.19-r20.ebuild => calculate-server-2.1.19-r21.ebuild} (98%) rename sys-apps/calculate-utils/{calculate-utils-3.6.8.10.ebuild => calculate-utils-3.6.8.10-r1.ebuild} (94%) rename sys-apps/calculate-utils/{calculate-utils-3.6.8.11.ebuild => calculate-utils-3.6.8.11-r1.ebuild} (94%) rename sys-apps/calculate-utils/{calculate-utils-3.6.8.14.ebuild => calculate-utils-3.6.8.14-r1.ebuild} (95%) rename sys-apps/calculate-utils/{calculate-utils-3.6.8.15-r3.ebuild => calculate-utils-3.6.8.15-r4.ebuild} (95%) rename sys-apps/calculate-utils/{calculate-utils-3.6.8.16.ebuild => calculate-utils-3.6.8.16-r1.ebuild} (95%) rename sys-apps/calculate-utils/{calculate-utils-3.6.8.17.ebuild => calculate-utils-3.6.8.17-r1.ebuild} (95%) rename sys-apps/calculate-utils/{calculate-utils-3.6.8.18.ebuild => calculate-utils-3.6.8.18-r1.ebuild} (95%) diff --git a/dev-python/PyQt5-python2/PyQt5-python2-5.14.2-r2.ebuild b/dev-python/PyQt5-python2/PyQt5-python2-5.14.2-r3.ebuild similarity index 99% rename from dev-python/PyQt5-python2/PyQt5-python2-5.14.2-r2.ebuild rename to dev-python/PyQt5-python2/PyQt5-python2-5.14.2-r3.ebuild index d3f61ce71..7cd6dfe22 100644 --- a/dev-python/PyQt5-python2/PyQt5-python2-5.14.2-r2.ebuild +++ b/dev-python/PyQt5-python2/PyQt5-python2-5.14.2-r3.ebuild @@ -4,7 +4,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) -inherit multibuild python-r1 qmake-utils +inherit multibuild python2 qmake-utils DESCRIPTION="Python bindings for the Qt framework" HOMEPAGE="https://www.riverbankcomputing.com/software/pyqt/intro" diff --git a/dev-python/PyQt5-sip-python2/PyQt5-sip-python2-4.19.22-r1.ebuild b/dev-python/PyQt5-sip-python2/PyQt5-sip-python2-4.19.22-r2.ebuild similarity index 98% rename from dev-python/PyQt5-sip-python2/PyQt5-sip-python2-4.19.22-r1.ebuild rename to dev-python/PyQt5-sip-python2/PyQt5-sip-python2-4.19.22-r2.ebuild index c0b548efe..54604a867 100644 --- a/dev-python/PyQt5-sip-python2/PyQt5-sip-python2-4.19.22-r1.ebuild +++ b/dev-python/PyQt5-sip-python2/PyQt5-sip-python2-4.19.22-r2.ebuild @@ -4,7 +4,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) -inherit python-r1 toolchain-funcs +inherit python2 toolchain-funcs DESCRIPTION="Private sip module for PyQt5" HOMEPAGE="https://www.riverbankcomputing.com/software/sip/intro" diff --git a/dev-python/certifi-python2/certifi-python2-10001.ebuild b/dev-python/certifi-python2/certifi-python2-10001-r1.ebuild similarity index 92% rename from dev-python/certifi-python2/certifi-python2-10001.ebuild rename to dev-python/certifi-python2/certifi-python2-10001-r1.ebuild index d49ae181f..0808165fe 100644 --- a/dev-python/certifi-python2/certifi-python2-10001.ebuild +++ b/dev-python/certifi-python2/certifi-python2-10001-r1.ebuild @@ -6,7 +6,7 @@ EAPI=7 DISTUTILS_USE_SETUPTOOLS=no PYTHON_COMPAT=( python2_7 ) -inherit distutils-r1 +inherit distutils2 MY_P=certifi-shim-${PV} DESCRIPTION="Thin replacement for certifi using system certificate store" @@ -31,11 +31,11 @@ distutils_enable_tests unittest src_prepare() { sed -i -e "s^/etc^${EPREFIX}/etc^" certifi/core.py || die - distutils-r1_src_prepare + distutils2_src_prepare } python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/cffi-python2/cffi-python2-1.14.0-r4.ebuild b/dev-python/cffi-python2/cffi-python2-1.14.0-r5.ebuild similarity index 94% rename from dev-python/cffi-python2/cffi-python2-1.14.0-r4.ebuild rename to dev-python/cffi-python2/cffi-python2-1.14.0-r5.ebuild index 4bbc33a17..974ab5bb4 100644 --- a/dev-python/cffi-python2/cffi-python2-1.14.0-r4.ebuild +++ b/dev-python/cffi-python2/cffi-python2-1.14.0-r5.ebuild @@ -8,7 +8,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 toolchain-funcs +inherit distutils2 toolchain-funcs MY_PN=cffi MY_P=$MY_PN-$PV @@ -44,6 +44,6 @@ src_configure() { python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/cryptography-python2/cryptography-python2-2.9-r3.ebuild b/dev-python/cryptography-python2/cryptography-python2-2.9-r4.ebuild similarity index 96% rename from dev-python/cryptography-python2/cryptography-python2-2.9-r3.ebuild rename to dev-python/cryptography-python2/cryptography-python2-2.9-r4.ebuild index c81092797..4916e5a01 100644 --- a/dev-python/cryptography-python2/cryptography-python2-2.9-r3.ebuild +++ b/dev-python/cryptography-python2/cryptography-python2-2.9-r4.ebuild @@ -7,7 +7,7 @@ PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="threads(+)" DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 flag-o-matic +inherit distutils2 flag-o-matic MY_PN=cryptography MY_P=$MY_PN-$PV @@ -50,6 +50,6 @@ python_configure_all() { } python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/cython-python2/cython-python2-0.29.21-r2.ebuild b/dev-python/cython-python2/cython-python2-0.29.21-r3.ebuild similarity index 93% rename from dev-python/cython-python2/cython-python2-0.29.21-r2.ebuild rename to dev-python/cython-python2/cython-python2-0.29.21-r3.ebuild index aaa10cda2..2fc03ee16 100644 --- a/dev-python/cython-python2/cython-python2-0.29.21-r2.ebuild +++ b/dev-python/cython-python2/cython-python2-0.29.21-r3.ebuild @@ -7,7 +7,7 @@ PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="threads(+)" DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 toolchain-funcs elisp-common +inherit distutils2 toolchain-funcs elisp-common MY_PN=cython MY_P=$MY_PN-$PV @@ -43,7 +43,7 @@ python_compile() { # Python gets confused when it is in sys.path before build. local -x PYTHONPATH= - distutils-r1_python_compile + distutils2_python_compile } python_compile_all() { @@ -60,7 +60,7 @@ python_test() { python_install_all() { local DOCS=( CHANGES.rst README.rst ToDo.txt USAGE.txt ) - distutils-r1_python_install_all + distutils2_python_install_all if use emacs; then elisp-install ${PN} Tools/cython-mode.* diff --git a/dev-python/dbus-python2/dbus-python2-1.2.16-r1.ebuild b/dev-python/dbus-python2/dbus-python2-1.2.16-r2.ebuild similarity index 98% rename from dev-python/dbus-python2/dbus-python2-1.2.16-r1.ebuild rename to dev-python/dbus-python2/dbus-python2-1.2.16-r2.ebuild index 7cd126844..ad249c972 100644 --- a/dev-python/dbus-python2/dbus-python2-1.2.16-r1.ebuild +++ b/dev-python/dbus-python2/dbus-python2-1.2.16-r2.ebuild @@ -7,7 +7,7 @@ PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="threads(+)" DISTUTILS_USE_SETUPTOOLS=manual -inherit autotools python-r1 +inherit autotools python2 MY_PN=dbus-python MY_P=$MY_PN-$PV diff --git a/dev-python/enum34/enum34-1.1.6-r2.ebuild b/dev-python/enum34/enum34-1.1.6-r3.ebuild similarity index 93% rename from dev-python/enum34/enum34-1.1.6-r2.ebuild rename to dev-python/enum34/enum34-1.1.6-r3.ebuild index 8ac1e9a26..9f40e6309 100644 --- a/dev-python/enum34/enum34-1.1.6-r2.ebuild +++ b/dev-python/enum34/enum34-1.1.6-r3.ebuild @@ -6,7 +6,7 @@ EAPI=5 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 DESCRIPTION="Python 3.4 Enum backported" HOMEPAGE="https://pypi.org/project/enum34/" @@ -26,5 +26,5 @@ python_test() { python_install_all() { use doc && local DOCS=( enum/doc/. enum/README ) - distutils-r1_python_install_all + distutils2_python_install_all } diff --git a/dev-python/faulthandler-python2/faulthandler-python2-3.0-r1.ebuild b/dev-python/faulthandler-python2/faulthandler-python2-3.0-r2.ebuild similarity index 93% rename from dev-python/faulthandler-python2/faulthandler-python2-3.0-r1.ebuild rename to dev-python/faulthandler-python2/faulthandler-python2-3.0-r2.ebuild index 1792eeba9..a58bac06e 100644 --- a/dev-python/faulthandler-python2/faulthandler-python2-3.0-r1.ebuild +++ b/dev-python/faulthandler-python2/faulthandler-python2-3.0-r2.ebuild @@ -6,7 +6,7 @@ EAPI=6 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 MY_PN=faulthandler MY_P=$MY_PN-$PV @@ -28,6 +28,6 @@ RDEPEND=" S="${WORKDIR}/${MY_PN}-${PV}" python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/ipaddress/ipaddress-1.0.23-r1.ebuild b/dev-python/ipaddress/ipaddress-1.0.23-r2.ebuild similarity index 93% rename from dev-python/ipaddress/ipaddress-1.0.23-r1.ebuild rename to dev-python/ipaddress/ipaddress-1.0.23-r2.ebuild index e9d120f11..560072f82 100644 --- a/dev-python/ipaddress/ipaddress-1.0.23-r1.ebuild +++ b/dev-python/ipaddress/ipaddress-1.0.23-r2.ebuild @@ -6,7 +6,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 DESCRIPTION="IPv4/IPv6 manipulation library, backport of the ipaddress module" HOMEPAGE="https://github.com/phihag/ipaddress" @@ -23,7 +23,7 @@ python_prepare_all() { sed -i 's:unittest.main():unittest.main(verbosity=2):' \ test_ipaddress.py || die - distutils-r1_python_prepare_all + distutils2_python_prepare_all } python_test() { diff --git a/dev-python/lxml-python2/lxml-python2-4.5.2-r2.ebuild b/dev-python/lxml-python2/lxml-python2-4.5.2-r3.ebuild similarity index 92% rename from dev-python/lxml-python2/lxml-python2-4.5.2-r2.ebuild rename to dev-python/lxml-python2/lxml-python2-4.5.2-r3.ebuild index a97035202..d8d293893 100644 --- a/dev-python/lxml-python2/lxml-python2-4.5.2-r2.ebuild +++ b/dev-python/lxml-python2/lxml-python2-4.5.2-r3.ebuild @@ -6,7 +6,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 optfeature toolchain-funcs +inherit distutils2 optfeature toolchain-funcs MY_PN=lxml MY_P=$MY_PN-$PV @@ -47,7 +47,7 @@ python_prepare_all() { sed -i -e '/_ldflags =/s/=.*isysroot.*darwin.*None/= None/' \ setupinfo.py || die - distutils-r1_python_prepare_all + distutils2_python_prepare_all } python_compile() { @@ -55,11 +55,11 @@ python_compile() { local -x CFLAGS="${CFLAGS} -fno-strict-aliasing" fi tc-export PKG_CONFIG - distutils-r1_python_compile + distutils2_python_compile } python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/m2crypto-python2/m2crypto-python2-0.36.0-r2.ebuild b/dev-python/m2crypto-python2/m2crypto-python2-0.36.0-r3.ebuild similarity index 90% rename from dev-python/m2crypto-python2/m2crypto-python2-0.36.0-r2.ebuild rename to dev-python/m2crypto-python2/m2crypto-python2-0.36.0-r3.ebuild index 35a651554..85ed9eaf4 100644 --- a/dev-python/m2crypto-python2/m2crypto-python2-0.36.0-r2.ebuild +++ b/dev-python/m2crypto-python2/m2crypto-python2-0.36.0-r3.ebuild @@ -7,7 +7,7 @@ PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="threads(+)" DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 toolchain-funcs +inherit distutils2 toolchain-funcs MY_PN="M2Crypto" DESCRIPTION="A Python crypto and SSL toolkit" @@ -51,7 +51,7 @@ src_prepare() { # TODO sed -e 's:test_server_simple_timeouts:_&:' \ -i tests/test_ssl.py || die - distutils-r1_src_prepare + distutils2_src_prepare } python_compile() { @@ -65,10 +65,10 @@ python_compile() { # https://bugs.gentoo.org/674112 swig_define __ARM_PCS_VFP - distutils-r1_python_compile --openssl="${ESYSROOT}"/usr + distutils2_python_compile --openssl="${ESYSROOT}"/usr } python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/numpy-python2/numpy-python2-1.16.6-r1.ebuild b/dev-python/numpy-python2/numpy-python2-1.16.6-r2.ebuild similarity index 94% rename from dev-python/numpy-python2/numpy-python2-1.16.6-r1.ebuild rename to dev-python/numpy-python2/numpy-python2-1.16.6-r2.ebuild index f25ad1069..a784ea017 100644 --- a/dev-python/numpy-python2/numpy-python2-1.16.6-r1.ebuild +++ b/dev-python/numpy-python2/numpy-python2-1.16.6-r2.ebuild @@ -9,7 +9,7 @@ PYTHON_REQ_USE="threads(+)" FORTRAN_NEEDED=lapack DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 flag-o-matic fortran-2 multiprocessing toolchain-funcs +inherit distutils2 flag-o-matic fortran-2 multiprocessing toolchain-funcs MY_PN="numpy" DOC_PV="1.16.6" @@ -123,7 +123,7 @@ python_prepare_all() { # very memory- and disk-hungry sed -i -e 's:test_large_zip:_&:' numpy/lib/tests/test_io.py || die - distutils-r1_python_prepare_all + distutils2_python_prepare_all } python_compile() { @@ -131,7 +131,7 @@ python_compile() { local python_makeopts_jobs="" python_is_python3 || python_makeopts_jobs="-j $(makeopts_jobs)" - distutils-r1_python_compile \ + distutils2_python_compile \ ${python_makeopts_jobs} \ ${NUMPY_FCONFIG} } @@ -139,7 +139,7 @@ python_compile() { python_install() { # https://github.com/numpy/numpy/issues/16005 local mydistutilsargs=( build_src ) - distutils-r1_python_install ${NUMPY_FCONFIG} + distutils2_python_install ${NUMPY_FCONFIG} python_optimize } @@ -151,7 +151,7 @@ python_install_all() { DOCS+=( "${DISTDIR}"/${MY_PN}-{user,ref}-${DOC_PV}.pdf ) fi - distutils-r1_python_install_all + distutils2_python_install_all # Let latest version to provide f2py link rm "${ED}"/usr/bin/f2py || die diff --git a/dev-python/pexpect-python2/pexpect-python2-4.8.0-r1.ebuild b/dev-python/pexpect-python2/pexpect-python2-4.8.0-r2.ebuild similarity index 92% rename from dev-python/pexpect-python2/pexpect-python2-4.8.0-r1.ebuild rename to dev-python/pexpect-python2/pexpect-python2-4.8.0-r2.ebuild index 6250467b6..a498b84c5 100644 --- a/dev-python/pexpect-python2/pexpect-python2-4.8.0-r1.ebuild +++ b/dev-python/pexpect-python2/pexpect-python2-4.8.0-r2.ebuild @@ -7,7 +7,7 @@ PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="threads(+)" DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 MY_PN=pexpect MY_P=$MY_PN-$PV @@ -31,11 +31,11 @@ DEPEND=" S="${WORKDIR}/${MY_PN}-${PV}" python_install() { - distutils-r1_python_install + distutils2_python_install rm "${D}$(python_get_sitedir)/pexpect/_async.py" || die } python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/ply-python2/ply-python2-3.11-r1.ebuild b/dev-python/ply-python2/ply-python2-3.11-r2.ebuild similarity index 94% rename from dev-python/ply-python2/ply-python2-3.11-r1.ebuild rename to dev-python/ply-python2/ply-python2-3.11-r2.ebuild index 6d3c7b902..ef66a19ed 100644 --- a/dev-python/ply-python2/ply-python2-3.11-r1.ebuild +++ b/dev-python/ply-python2/ply-python2-3.11-r2.ebuild @@ -6,7 +6,7 @@ EAPI=6 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 MY_PN=ply MY_P=$MY_PN-$PV @@ -29,6 +29,6 @@ RDEPEND=" S="${WORKDIR}/${MY_PN}-${PV}" python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/ptyprocess-python2/ptyprocess-python2-0.6.0-r1.ebuild b/dev-python/ptyprocess-python2/ptyprocess-python2-0.6.0-r2.ebuild similarity index 92% rename from dev-python/ptyprocess-python2/ptyprocess-python2-0.6.0-r1.ebuild rename to dev-python/ptyprocess-python2/ptyprocess-python2-0.6.0-r2.ebuild index 119aa6884..8725c050a 100644 --- a/dev-python/ptyprocess-python2/ptyprocess-python2-0.6.0-r1.ebuild +++ b/dev-python/ptyprocess-python2/ptyprocess-python2-0.6.0-r2.ebuild @@ -6,7 +6,7 @@ EAPI=7 DISTUTILS_USE_SETUPTOOLS=no PYTHON_COMPAT=( python2_7 ) -inherit distutils-r1 +inherit distutils2 MY_PN=ptyprocess MY_P=$MY_PN-$PV @@ -27,6 +27,6 @@ RDEPEND=" S="${WORKDIR}/${MY_PN}-${PV}" python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/py-smbpasswd/py-smbpasswd-1.0.2-r1.ebuild b/dev-python/py-smbpasswd/py-smbpasswd-1.0.2-r2.ebuild similarity index 96% rename from dev-python/py-smbpasswd/py-smbpasswd-1.0.2-r1.ebuild rename to dev-python/py-smbpasswd/py-smbpasswd-1.0.2-r2.ebuild index bd0bf6af6..06df7cea8 100644 --- a/dev-python/py-smbpasswd/py-smbpasswd-1.0.2-r1.ebuild +++ b/dev-python/py-smbpasswd/py-smbpasswd-1.0.2-r2.ebuild @@ -6,7 +6,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 MY_P="${PN#py-}-${PV}" diff --git a/dev-python/pyasn1-modules-python2/pyasn1-modules-python2-0.2.8-r1.ebuild b/dev-python/pyasn1-modules-python2/pyasn1-modules-python2-0.2.8-r2.ebuild similarity index 93% rename from dev-python/pyasn1-modules-python2/pyasn1-modules-python2-0.2.8-r1.ebuild rename to dev-python/pyasn1-modules-python2/pyasn1-modules-python2-0.2.8-r2.ebuild index a77dc9488..509a92025 100644 --- a/dev-python/pyasn1-modules-python2/pyasn1-modules-python2-0.2.8-r1.ebuild +++ b/dev-python/pyasn1-modules-python2/pyasn1-modules-python2-0.2.8-r2.ebuild @@ -6,7 +6,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 MY_PN=pyasn1-modules MY_P=$MY_PN-$PV @@ -31,6 +31,6 @@ RESTRICT="test" S="${WORKDIR}/${MY_PN}-${PV}" python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/pyasn1-python2/pyasn1-python2-0.4.8-r1.ebuild b/dev-python/pyasn1-python2/pyasn1-python2-0.4.8-r2.ebuild similarity index 93% rename from dev-python/pyasn1-python2/pyasn1-python2-0.4.8-r1.ebuild rename to dev-python/pyasn1-python2/pyasn1-python2-0.4.8-r2.ebuild index 2c03f39ea..217777bad 100644 --- a/dev-python/pyasn1-python2/pyasn1-python2-0.4.8-r1.ebuild +++ b/dev-python/pyasn1-python2/pyasn1-python2-0.4.8-r2.ebuild @@ -6,7 +6,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 MY_PN=pyasn1 MY_P=$MY_PN-$PV @@ -28,6 +28,6 @@ RDEPEND=" " python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/pycairo-python2/pycairo-python2-1.18.2-r1.ebuild b/dev-python/pycairo-python2/pycairo-python2-1.18.2-r1.ebuild index 0c64dcd3f..2e0ae12c6 100644 --- a/dev-python/pycairo-python2/pycairo-python2-1.18.2-r1.ebuild +++ b/dev-python/pycairo-python2/pycairo-python2-1.18.2-r1.ebuild @@ -7,7 +7,7 @@ PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="threads(+)" DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 MY_PN=pycairo MY_P=$MY_PN-$PV @@ -34,12 +34,12 @@ distutils_enable_sphinx docs \ distutils_enable_tests setup.py python_install() { - distutils-r1_python_install \ + distutils2_python_install \ install_pkgconfig --pkgconfigdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig" } python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share rm -r ${D}/usr/lib*/pkgconfig rm -r ${D}/usr/include diff --git a/dev-python/pycparser-python2/pycparser-python2-2.20-r1.ebuild b/dev-python/pycparser-python2/pycparser-python2-2.20-r2.ebuild similarity index 93% rename from dev-python/pycparser-python2/pycparser-python2-2.20-r1.ebuild rename to dev-python/pycparser-python2/pycparser-python2-2.20-r2.ebuild index 873c126be..5df9d9f3c 100644 --- a/dev-python/pycparser-python2/pycparser-python2-2.20-r1.ebuild +++ b/dev-python/pycparser-python2/pycparser-python2-2.20-r2.ebuild @@ -6,7 +6,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 MY_PN=pycparser MY_P=$MY_PN-$PV @@ -33,11 +33,11 @@ python_prepare_all() { # kill sys.path manipulations to force the tests to use built files sed -i -e '/sys\.path/d' tests/*.py || die - distutils-r1_python_prepare_all + distutils2_python_prepare_all } python_compile() { - distutils-r1_python_compile + distutils2_python_compile # note: tables built by py3.5+ are incompatible with older versions # because of 100 group limit of 're' module -- just generate them @@ -48,7 +48,7 @@ python_compile() { } python_install() { - distutils-r1_python_install + distutils2_python_install # setup.py generates {c_ast,lextab,yacctab}.py with bytecode disabled. python_optimize diff --git a/dev-python/pyinotify-python2/pyinotify-python2-0.9.6-r1.ebuild b/dev-python/pyinotify-python2/pyinotify-python2-0.9.6-r2.ebuild similarity index 93% rename from dev-python/pyinotify-python2/pyinotify-python2-0.9.6-r1.ebuild rename to dev-python/pyinotify-python2/pyinotify-python2-0.9.6-r2.ebuild index f19ecd35f..babd73733 100644 --- a/dev-python/pyinotify-python2/pyinotify-python2-0.9.6-r1.ebuild +++ b/dev-python/pyinotify-python2/pyinotify-python2-0.9.6-r2.ebuild @@ -7,7 +7,7 @@ PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="threads(+)" DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 MY_PN=pyinotify MY_P=$MY_PN-$PV @@ -33,6 +33,6 @@ RDEPEND=" S="${WORKDIR}/${MY_PN}-${PV}" python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/pymilter-python2/pymilter-python2-0.9.3-r1.ebuild b/dev-python/pymilter-python2/pymilter-python2-0.9.3-r2.ebuild similarity index 93% rename from dev-python/pymilter-python2/pymilter-python2-0.9.3-r1.ebuild rename to dev-python/pymilter-python2/pymilter-python2-0.9.3-r2.ebuild index 0a80d2847..7e5270253 100644 --- a/dev-python/pymilter-python2/pymilter-python2-0.9.3-r1.ebuild +++ b/dev-python/pymilter-python2/pymilter-python2-0.9.3-r2.ebuild @@ -10,7 +10,7 @@ MY_PN=pymilter MY_P=$MY_PN-$PV DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 SRC_URI="http://downloads.sourceforge.net/project/${MY_PN}/${MY_PN}/${MY_P}/${MY_P}.tar.gz" @@ -32,6 +32,6 @@ RESTRICT="test" S="${WORKDIR}/${MY_PN}-${PV}" python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/pyopengl-python2/pyopengl-python2-3.1.0-r2.ebuild b/dev-python/pyopengl-python2/pyopengl-python2-3.1.0-r3.ebuild similarity index 97% rename from dev-python/pyopengl-python2/pyopengl-python2-3.1.0-r2.ebuild rename to dev-python/pyopengl-python2/pyopengl-python2-3.1.0-r3.ebuild index e71c41cb6..356e15eab 100644 --- a/dev-python/pyopengl-python2/pyopengl-python2-3.1.0-r2.ebuild +++ b/dev-python/pyopengl-python2/pyopengl-python2-3.1.0-r3.ebuild @@ -5,7 +5,7 @@ EAPI=5 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 ORIG_PN=pyopengl MY_PN="PyOpenGL" diff --git a/dev-python/pyopenssl-python2/pyopenssl-python2-19.1.0-r2.ebuild b/dev-python/pyopenssl-python2/pyopenssl-python2-19.1.0-r3.ebuild similarity index 92% rename from dev-python/pyopenssl-python2/pyopenssl-python2-19.1.0-r2.ebuild rename to dev-python/pyopenssl-python2/pyopenssl-python2-19.1.0-r3.ebuild index d90a9937c..078ce0d66 100644 --- a/dev-python/pyopenssl-python2/pyopenssl-python2-19.1.0-r2.ebuild +++ b/dev-python/pyopenssl-python2/pyopenssl-python2-19.1.0-r3.ebuild @@ -7,7 +7,7 @@ PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="threads(+)" DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 flag-o-matic +inherit distutils2 flag-o-matic MY_PN=pyOpenSSL MY_P=${MY_PN}-${PV} @@ -39,10 +39,10 @@ distutils_enable_sphinx doc \ python_prepare_all() { # Requires network access sed -i -e 's/test_set_default_verify_paths/_&/' tests/test_ssl.py || die - distutils-r1_python_prepare_all + distutils2_python_prepare_all } python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/python2-ldap/python2-ldap-3.2.0-r1.ebuild b/dev-python/python2-ldap/python2-ldap-3.2.0-r2.ebuild similarity index 93% rename from dev-python/python2-ldap/python2-ldap-3.2.0-r1.ebuild rename to dev-python/python2-ldap/python2-ldap-3.2.0-r2.ebuild index be9acc624..56d7cd4d7 100644 --- a/dev-python/python2-ldap/python2-ldap-3.2.0-r1.ebuild +++ b/dev-python/python2-ldap/python2-ldap-3.2.0-r2.ebuild @@ -5,7 +5,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 MY_PN=python-ldap MY_P=$MY_PN-$PV @@ -60,15 +60,15 @@ python_prepare_all() { sed -i 's/HAVE_TLS//g' setup.cfg || die fi - distutils-r1_python_prepare_all + distutils2_python_prepare_all } python_install() { - distutils-r1_python_install + distutils2_python_install python_optimize } python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/pytz-python2/pytz-python2-2020.1-r1.ebuild b/dev-python/pytz-python2/pytz-python2-2020.1-r2.ebuild similarity index 95% rename from dev-python/pytz-python2/pytz-python2-2020.1-r1.ebuild rename to dev-python/pytz-python2/pytz-python2-2020.1-r2.ebuild index 1d94c02f3..bbafc8c80 100644 --- a/dev-python/pytz-python2/pytz-python2-2020.1-r1.ebuild +++ b/dev-python/pytz-python2/pytz-python2-2020.1-r2.ebuild @@ -7,7 +7,7 @@ PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="threads(+)" DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 MY_PN=pytz MY_P=$MY_PN-$PV @@ -40,7 +40,7 @@ S="${WORKDIR}/${MY_PN}-${PV}" python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/pyxattr/pyxattr-0.6.0-r4.ebuild b/dev-python/pyxattr/pyxattr-0.6.0-r5.ebuild similarity index 90% rename from dev-python/pyxattr/pyxattr-0.6.0-r4.ebuild rename to dev-python/pyxattr/pyxattr-0.6.0-r5.ebuild index 105510ae9..949586ef8 100644 --- a/dev-python/pyxattr/pyxattr-0.6.0-r4.ebuild +++ b/dev-python/pyxattr/pyxattr-0.6.0-r5.ebuild @@ -5,7 +5,7 @@ EAPI=6 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 eutils +inherit distutils2 eutils DESCRIPTION="Python interface to xattr" HOMEPAGE="https://pyxattr.k1024.org/" @@ -33,10 +33,10 @@ python_prepare_all() { sed -e "s:html_theme = 'default':html_theme = 'classic':" \ -i doc/conf.py || die - distutils-r1_python_prepare_all + distutils2_python_prepare_all } python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/pyxml/pyxml-0.8.4-r4.ebuild b/dev-python/pyxml/pyxml-0.8.4-r5.ebuild similarity index 91% rename from dev-python/pyxml/pyxml-0.8.4-r4.ebuild rename to dev-python/pyxml/pyxml-0.8.4-r5.ebuild index 625fd6097..fc2d7d8d5 100644 --- a/dev-python/pyxml/pyxml-0.8.4-r4.ebuild +++ b/dev-python/pyxml/pyxml-0.8.4-r5.ebuild @@ -5,7 +5,7 @@ EAPI=5 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 eutils +inherit distutils2 eutils MY_P=${P/pyxml/PyXML} @@ -33,12 +33,12 @@ python_prepare_all() { "${FILESDIR}/${P}-python-2.6.patch" ) - distutils-r1_python_prepare_all + distutils2_python_prepare_all } python_compile() { # use the already-installed shared copy of libexpat - distutils-r1_python_compile --with-libexpat="${EPREFIX}/usr" + distutils2_python_compile --with-libexpat="${EPREFIX}/usr" } python_test() { @@ -66,7 +66,7 @@ python_test() { python_install_all() { local DOCS=( ANNOUNCE CREDITS doc/*.txt ) - distutils-r1_python_install_all + distutils2_python_install_all doman doc/man/* if use doc; then diff --git a/dev-python/setuptools-python2/setuptools-python2-46.4.0-r3.ebuild b/dev-python/setuptools-python2/setuptools-python2-46.4.0-r4.ebuild similarity index 96% rename from dev-python/setuptools-python2/setuptools-python2-46.4.0-r3.ebuild rename to dev-python/setuptools-python2/setuptools-python2-46.4.0-r4.ebuild index d30f34734..5005ac0b7 100644 --- a/dev-python/setuptools-python2/setuptools-python2-46.4.0-r3.ebuild +++ b/dev-python/setuptools-python2/setuptools-python2-46.4.0-r4.ebuild @@ -7,7 +7,7 @@ DISTUTILS_USE_SETUPTOOLS=manual PYTHON_COMPAT=( python2_7 ) PYTHON_REQ_USE="xml(+)" -inherit distutils-r1 +inherit distutils2 MY_PN=setuptools MY_P=$MY_PN-$PV @@ -60,7 +60,7 @@ python_prepare_all() { # avoid pointless dep on flake8 sed -i -e 's:--flake8::' pytest.ini || die - distutils-r1_python_prepare_all + distutils2_python_prepare_all } python_test() { @@ -77,7 +77,7 @@ python_test() { python_install() { export DISTRIBUTE_DISABLE_VERSIONED_EASY_INSTALL_SCRIPT=1 - distutils-r1_python_install + distutils2_python_install } python_install_all() { diff --git a/dev-python/sip-python2/sip-python2-4.19.22-r2.ebuild b/dev-python/sip-python2/sip-python2-4.19.22-r3.ebuild similarity index 98% rename from dev-python/sip-python2/sip-python2-4.19.22-r2.ebuild rename to dev-python/sip-python2/sip-python2-4.19.22-r3.ebuild index c7369ee23..52b9b2252 100644 --- a/dev-python/sip-python2/sip-python2-4.19.22-r2.ebuild +++ b/dev-python/sip-python2/sip-python2-4.19.22-r3.ebuild @@ -4,7 +4,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) -inherit python-r1 toolchain-funcs +inherit python2 toolchain-funcs DESCRIPTION="Python extension module generator for C and C++ libraries" HOMEPAGE="https://www.riverbankcomputing.com/software/sip/intro" diff --git a/dev-python/six-python2/six-python2-1.15.0-r1.ebuild b/dev-python/six-python2/six-python2-1.15.0-r2.ebuild similarity index 94% rename from dev-python/six-python2/six-python2-1.15.0-r1.ebuild rename to dev-python/six-python2/six-python2-1.15.0-r2.ebuild index f8e2591ab..676547507 100644 --- a/dev-python/six-python2/six-python2-1.15.0-r1.ebuild +++ b/dev-python/six-python2/six-python2-1.15.0-r2.ebuild @@ -6,7 +6,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 MY_PN=six MY_P=$MY_PN-$PV @@ -32,6 +32,6 @@ RDEPEND=" distutils_enable_sphinx documentation --no-autodoc python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/sjcl/sjcl-0.2.1.ebuild b/dev-python/sjcl/sjcl-0.2.1.ebuild index 438a80718..b94164324 100644 --- a/dev-python/sjcl/sjcl-0.2.1.ebuild +++ b/dev-python/sjcl/sjcl-0.2.1.ebuild @@ -3,7 +3,7 @@ EAPI=7 -PYTHON_COMPAT=( pypy3 python3_{6,7,8} ) +PYTHON_COMPAT=( pypy3 python3_{7,8} ) inherit distutils-r1 diff --git a/dev-python/soaplib/soaplib-1.0.0-r5.ebuild b/dev-python/soaplib/soaplib-1.0.0-r6.ebuild similarity index 91% rename from dev-python/soaplib/soaplib-1.0.0-r5.ebuild rename to dev-python/soaplib/soaplib-1.0.0-r6.ebuild index 581913430..739c170bd 100644 --- a/dev-python/soaplib/soaplib-1.0.0-r5.ebuild +++ b/dev-python/soaplib/soaplib-1.0.0-r6.ebuild @@ -6,7 +6,7 @@ EAPI="5" PYTHON_COMPAT=(python2_7) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 eutils python-r1 +inherit distutils2 eutils python2 DESCRIPTION="A simple library for writing soap web services." HOMEPAGE="http://wiki.github.com/jkp/soaplib" @@ -28,7 +28,7 @@ DEPEND="${RDEPEND} S="${WORKDIR}/soaplib-soaplib-2801978" python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -rf "${ED}$(python_get_sitedir)/tests/" diff --git a/dev-python/sudsds/sudsds-1.0.1-r2.ebuild b/dev-python/sudsds/sudsds-1.0.1-r3.ebuild similarity index 95% rename from dev-python/sudsds/sudsds-1.0.1-r2.ebuild rename to dev-python/sudsds/sudsds-1.0.1-r3.ebuild index fff87c487..b60047d0d 100644 --- a/dev-python/sudsds/sudsds-1.0.1-r2.ebuild +++ b/dev-python/sudsds/sudsds-1.0.1-r3.ebuild @@ -6,7 +6,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 DESCRIPTION="Lightweight SOAP client - Czech NIC labs fork" HOMEPAGE="https://labs.nic.cz/page/969/" diff --git a/dev-python/typing-python2/typing-python2-3.7.4.3-r1.ebuild b/dev-python/typing-python2/typing-python2-3.7.4.3-r2.ebuild similarity index 93% rename from dev-python/typing-python2/typing-python2-3.7.4.3-r1.ebuild rename to dev-python/typing-python2/typing-python2-3.7.4.3-r2.ebuild index 39366b8ca..a71701688 100644 --- a/dev-python/typing-python2/typing-python2-3.7.4.3-r1.ebuild +++ b/dev-python/typing-python2/typing-python2-3.7.4.3-r2.ebuild @@ -6,7 +6,7 @@ EAPI=7 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 MY_PN=typing MY_P=$MY_PN-$PV @@ -26,6 +26,6 @@ RDEPEND="!dev-python/${MY_PN}[python_targets_python2_7]" S="${WORKDIR}/${MY_PN}-${PV}" python_install_all() { - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/dev-python/wxpython2/wxpython2-3.0.2.0-r1.ebuild b/dev-python/wxpython2/wxpython2-3.0.2.0-r2.ebuild similarity index 95% rename from dev-python/wxpython2/wxpython2-3.0.2.0-r1.ebuild rename to dev-python/wxpython2/wxpython2-3.0.2.0-r2.ebuild index 9a134f679..1746079e0 100644 --- a/dev-python/wxpython2/wxpython2-3.0.2.0-r1.ebuild +++ b/dev-python/wxpython2/wxpython2-3.0.2.0-r2.ebuild @@ -7,7 +7,7 @@ PYTHON_COMPAT=( python2_7 ) WX_GTK_VER="3.0" DISTUTILS_USE_SETUPTOOLS=manual -inherit alternatives distutils-r1 eutils flag-o-matic wxwidgets +inherit alternatives distutils2 eutils flag-o-matic wxwidgets ORIG_PN="wxpython" MY_PN="wxPython-src" @@ -60,7 +60,7 @@ python_prepare_all() { "${FILESDIR}"/${ORIG_PN}-2.8.12.1-disable-egging-mode.patch ) - distutils-r1_python_prepare_all + distutils2_python_prepare_all } src_configure() { @@ -76,12 +76,12 @@ src_configure() { python_compile() { # We need to have separate libdirs due to hackery, bug #455332. - distutils-r1_python_compile \ + distutils2_python_compile \ build --build-purelib "${BUILD_DIR}"/lib.common } python_install() { - distutils-r1_python_install \ + distutils2_python_install \ build --build-purelib "${BUILD_DIR}"/lib.common # adjust the filenames for wxPython slots. @@ -110,7 +110,7 @@ python_install_all() { newicon wx/py/PySlices_32.png PySlices-${SLOT}.png newicon wx/tools/XRCed/XRCed_32.png XRCed-${SLOT}.png - distutils-r1_python_install_all + distutils2_python_install_all rm -r ${D}/usr/share } diff --git a/eclass/calculate-utils-r10.eclass b/eclass/calculate-utils-r10.eclass deleted file mode 100644 index dd3bb08af..000000000 --- a/eclass/calculate-utils-r10.eclass +++ /dev/null @@ -1,325 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -# @ECLASS: calculate-utils-r10.eclass -# @MAINTAINER: -# support@calculate.ru -# @AUTHOR: -# Author: Mir Calculate -# @BLURB: Functions for calculate-utils -# @DESCRIPTION: -# This eclass use for calculate-utils ebuild - -PYTHON_COMPAT=(python2_7) - -inherit distutils-r1 eutils - -EXPORTED_FUNCTIONS="src_compile src_install pkg_preinst" - -CALCULATE_URI="ftp://ftp.calculate-linux.org/calculate/source/calculate3" -MIRROR_URI="http://mirror.yandex.ru/calculate/source/calculate3" - -# @ECLASS-VARIABLE: CALCULATE_MODULES -# @DESCRIPTION: -# Associative array module names and versions -# Example: -# declare -A CALCULATE_MODULES=( -# ["console-gui"]="3.2.3.4" -# ) - -# @ECLASS-VARIABLE: CALCULATE_MODULES_USE -# @DESCRIPTION: -# Associative array module names and use for IUSE -# Example: -# declare -A CALCULATE_MODULES_USE=( -# ["console-gui"]="" -# ) - -# @ECLASS-VARIABLE: CALCULATE_TARBALL -# @DESCRIPTION: -# Associative array module names and tarball archive name -# Example: -# declare -A CALCULATE_TARBALL=( ["lib"]="calculate-lib-3.2.3-r1.tar.bz2" ) - -# @ECLASS-VARIABLE: UTILS_PV -# @DESCRIPTION: -# Default version of all components -# Example: -: ${UTILS_PV:=$(ver_cut 1-3 ${PV})} - -declare -g -A CALCULATE_TARBALL_=() - -declare -g -A CALCULATE_MODULES_=( - ["lib"]="$UTILS_PV" - ["builder"]="$UTILS_PV" - ["install"]="$UTILS_PV" - ["core"]="$UTILS_PV" - ["i18n"]="$UTILS_PV" - ["update"]="$UTILS_PV" - ["desktop"]="$UTILS_PV" - ["client"]="$UTILS_PV" - ["console-gui"]="$UTILS_PV" - ["console"]="$UTILS_PV" - ["server"]="$UTILS_PV" - ["ldap"]="$UTILS_PV" - ["unix"]="$UTILS_PV") - -declare -g -A CALCULATE_MODULES_USE_=( - ["desktop"]="desktop" - ["client"]="client" - ["console-gui"]="qt5" - ["console"]="console" - ["server"]="server" - ["ldap"]="server" - ["unix"]="server" -) - -EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} - -# @FUNCTION: prepare_variables -# @DESCRIPTION: -# Prepare variables for ebuild -prepare_variables() { - for module in ${!CALCULATE_MODULES[@]} - do - CALCULATE_MODULES_[$module]=${CALCULATE_MODULES[$module]} - done - - for module in ${!CALCULATE_MODULES_USE[@]} - do - CALCULATE_MODULES_USE_[$module]=${CALCULATE_MODULES_USE[$module]} - done - - for module in ${!CALCULATE_MODULES_[@]} - do - MODULE_PN=calculate-${module} - MODULE_PV=${CALCULATE_MODULES_[$module]} - if [[ -n ${CALCULATE_TARBALL[$module]} ]] - then - CALCULATE_TARBALL_[$module]="${MODULE_PN}/${CALCULATE_TARBALL[$module]}" - else - CALCULATE_TARBALL_[$module]="${MODULE_PN}/${MODULE_PN}-${MODULE_PV}.tar.bz2" - fi - done - - for module in ${!CALCULATE_MODULES_[@]} - do - MODULE_USE=${CALCULATE_MODULES_USE_[$module]} - MODULE_URI="" - for URI in $CALCULATE_URI $MIRROR_URI - do - MODULE_URI="${MODULE_URI} ${URI}/${CALCULATE_TARBALL_[$module]}" - done - if [[ -n $MODULE_USE ]] - then - MODULE_URI="${MODULE_USE}? ( $MODULE_URI )" - fi - SRC_URI="$SRC_URI $MODULE_URI" - done - - IUSE="+install dbus +gpg minimal pxe backup ${CALCULATE_MODULES_USE_[@]}" - S="${WORKDIR}" -} - -# @FUNCTION: prepare_module_info -# @DESCRIPTION: -# Prepare module info for compile and install -prepare_module_info() { - MODULE_INFO=() - for module in ${!CALCULATE_MODULES_[@]} - do - MODULE_USE=${CALCULATE_MODULES_USE_[$module]} - if [[ -z $MODULE_USE ]] || use $MODULE_USE - then - MODULE_INFO+=("calculate-$module ${CALCULATE_MODULES_[$module]}") - fi - done -} - -prepare_variables - -RDEPEND=" - install? ( >=app-cdr/cdrtools-3.01_alpha13 - >=sys-boot/grub-2.00-r3 - >=sys-boot/syslinux-5 - sys-fs/squashfs-tools - sys-fs/dosfstools - sys-block/parted - sys-apps/gptfdisk - sys-fs/lvm2 - sys-fs/mdadm - ) - !minimal? ( - >=sys-apps/util-linux-2.19.1 - net-misc/rsync - dev-python/sudsds[python_targets_python2_7] - net-libs/dslib[python_targets_python2_7] - >=dev-python/pyopenssl-python2-0.14 - dev-libs/openssl - dev-python/m2crypto-python2 - dev-python/pytz-python2 - ) - gpg? ( - app-crypt/gnupg - app-crypt/openpgp-keys-calculate-release - ) - >=dev-python/pyxml-0.8 - sys-apps/iproute2[-minimal] - sys-apps/pciutils - app-arch/xz-utils - - app-eselect/eselect-repository - || ( - sys-apps/portage[python_targets_python3_6] - sys-apps/portage[python_targets_python3_7] - sys-apps/portage[python_targets_python3_8] - ) - >=virtual/udev-197 - !app-misc/livecd-tools - sys-apps/coreutils[xattr] - - pxe? ( sys-apps/calculate-server - net-ftp/tftp-hpa - net-misc/dhcp - net-fs/nfs-utils - ) - - >=dev-python/soaplib-1.0-r3 - !=dev-python/python2-ldap-2.0[ssl] - sys-auth/pam_client - >=sys-auth/pam_ldap-180[ssl] - >=sys-auth/nss_ldap-239 - ) - - qt5? ( - dev-python/dbus-python2 - || ( - dev-python/pillow[python_targets_python2_7] - dev-python/imaging[python_targets_python2_7] - ) - dev-python/PyQt5-python2 - ) - - dbus? ( - dev-python/dbus-python2 - ) - - dev-python/pexpect-python2 - - ! +# @AUTHOR: +# Author: Michał Górny +# Based on the work of: Krzysztof Pawlik +# @SUPPORTED_EAPIS: 5 6 7 +# @BLURB: A simple eclass to build Python packages using distutils. +# @DESCRIPTION: +# A simple eclass providing functions to build Python packages using +# the distutils build system. It exports phase functions for all +# the src_* phases. Each of the phases runs two pseudo-phases: +# python_..._all() (e.g. python_prepare_all()) once in ${S}, then +# python_...() (e.g. python_prepare()) for each implementation +# (see: python_foreach_impl() in python2). +# +# In distutils2_src_prepare(), the 'all' function is run before +# per-implementation ones (because it creates the implementations), +# per-implementation functions are run in a random order. +# +# In remaining phase functions, the per-implementation functions are run +# before the 'all' one, and they are ordered from the least to the most +# preferred implementation (so that 'better' files overwrite 'worse' +# ones). +# +# If the ebuild doesn't specify a particular pseudo-phase function, +# the default one will be used (distutils2_...). Defaults are provided +# for all per-implementation pseudo-phases, python_prepare_all() +# and python_install_all(); whenever writing your own pseudo-phase +# functions, you should consider calling the defaults (and especially +# distutils2_python_prepare_all). +# +# Please note that distutils2 sets RDEPEND and DEPEND unconditionally +# for you. +# +# Also, please note that distutils2 will always inherit python2 +# as well. Thus, all the variables defined and documented there are +# relevant to the packages using distutils2. +# +# For more information, please see the Python Guide: +# https://dev.gentoo.org/~mgorny/python-guide/ + +case "${EAPI:-0}" in + 0|1|2|3|4) + die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" + ;; + 5|6|7) + ;; + *) + die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" + ;; +esac + +# @ECLASS-VARIABLE: DISTUTILS_OPTIONAL +# @DEFAULT_UNSET +# @DESCRIPTION: +# If set to a non-null value, distutils part in the ebuild will +# be considered optional. No dependencies will be added and no phase +# functions will be exported. +# +# If you enable DISTUTILS_OPTIONAL, you have to set proper dependencies +# for your package (using ${PYTHON_DEPS}) and to either call +# distutils2 default phase functions or call the build system +# manually. + +# @ECLASS-VARIABLE: DISTUTILS_SINGLE_IMPL +# @DEFAULT_UNSET +# @DESCRIPTION: +# If set to a non-null value, the ebuild will support setting a single +# Python implementation only. It will effectively replace the python2 +# eclass inherit with python-single-r1. +# +# Note that inheriting python-single-r1 will cause pkg_setup() +# to be exported. It must be run in order for the eclass functions +# to function properly. + +# @ECLASS-VARIABLE: DISTUTILS_USE_SETUPTOOLS +# @PRE_INHERIT +# @DESCRIPTION: +# Controls adding dev-python/setuptools dependency. The allowed values +# are: +# +# - no -- do not add the dependency (pure distutils package) +# - bdepend -- add it to BDEPEND (the default) +# - rdepend -- add it to BDEPEND+RDEPEND (when using entry_points) +# - pyproject.toml -- use pyproject2setuptools to install a project +# using pyproject.toml (flit, poetry...) +# - manual -- do not add the depedency and suppress the checks +# (assumes you will take care of doing it correctly) +# +# This variable is effective only if DISTUTILS_OPTIONAL is disabled. +# It needs to be set before the inherit line. +: ${DISTUTILS_USE_SETUPTOOLS:=bdepend} + +if [[ ! ${_DISTUTILS_R1} ]]; then + +[[ ${EAPI} == [456] ]] && inherit eutils +[[ ${EAPI} == [56] ]] && inherit xdg-utils +inherit multiprocessing toolchain-funcs + +if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then + inherit python2 +else + inherit python-single-r1 +fi + +fi + +if [[ ! ${DISTUTILS_OPTIONAL} ]]; then + EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install +fi + +if [[ ! ${_DISTUTILS_R1} ]]; then + +_distutils_set_globals() { + local rdep bdep + local setuptools_dep='>=dev-python/setuptools-42.0.2[${PYTHON_USEDEP}]' + + case ${DISTUTILS_USE_SETUPTOOLS} in + no|manual) + ;; + bdepend) + bdep+=" ${setuptools_dep}" + ;; + rdepend) + bdep+=" ${setuptools_dep}" + rdep+=" ${setuptools_dep}" + ;; + pyproject.toml) + bdep+=' dev-python/pyproject2setuppy[${PYTHON_USEDEP}]' + ;; + *) + die "Invalid DISTUTILS_USE_SETUPTOOLS=${DISTUTILS_USE_SETUPTOOLS}" + ;; + esac + + if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then + bdep=${bdep//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}} + rdep=${rdep//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}} + else + [[ -n ${bdep} ]] && bdep="$(python_gen_cond_dep "${bdep}")" + [[ -n ${rdep} ]] && rdep="$(python_gen_cond_dep "${rdep}")" + fi + + RDEPEND="${PYTHON_DEPS} ${rdep}" + if [[ ${EAPI} != [56] ]]; then + BDEPEND="${PYTHON_DEPS} ${bdep}" + else + DEPEND="${PYTHON_DEPS} ${bdep}" + fi + REQUIRED_USE=${PYTHON_REQUIRED_USE} +} +[[ ! ${DISTUTILS_OPTIONAL} ]] && _distutils_set_globals +unset -f _distutils_set_globals + +# @ECLASS-VARIABLE: PATCHES +# @DEFAULT_UNSET +# @DESCRIPTION: +# An array containing patches to be applied to the sources before +# copying them. +# +# If unset, no custom patches will be applied. +# +# Please note, however, that at some point the eclass may apply +# additional distutils patches/quirks independently of this variable. +# +# Example: +# @CODE +# PATCHES=( "${FILESDIR}"/${P}-make-gentoo-happy.patch ) +# @CODE + +# @ECLASS-VARIABLE: DOCS +# @DEFAULT_UNSET +# @DESCRIPTION: +# An array containing documents installed using dodoc. The files listed +# there must exist in the directory from which +# distutils2_python_install_all() is run (${S} by default). +# +# If unset, the function will instead look up files matching default +# filename pattern list (from the Package Manager Specification), +# and install those found. +# +# Example: +# @CODE +# DOCS=( NEWS README ) +# @CODE + +# @ECLASS-VARIABLE: HTML_DOCS +# @DEFAULT_UNSET +# @DESCRIPTION: +# An array containing documents installed using dohtml. The files +# and directories listed there must exist in the directory from which +# distutils2_python_install_all() is run (${S} by default). +# +# If unset, no HTML docs will be installed. +# +# Example: +# @CODE +# HTML_DOCS=( doc/html/. ) +# @CODE + +# @ECLASS-VARIABLE: EXAMPLES +# @DEFAULT_UNSET +# @DESCRIPTION: +# OBSOLETE: this variable is deprecated and banned in EAPI 6 +# +# An array containing examples installed into 'examples' doc +# subdirectory. The files and directories listed there must exist +# in the directory from which distutils2_python_install_all() is run +# (${S} by default). +# +# The 'examples' subdirectory will be marked not to be compressed +# automatically. +# +# If unset, no examples will be installed. +# +# Example: +# @CODE +# EXAMPLES=( examples/. demos/. ) +# @CODE + +# @ECLASS-VARIABLE: DISTUTILS_IN_SOURCE_BUILD +# @DEFAULT_UNSET +# @DESCRIPTION: +# If set to a non-null value, in-source builds will be enabled. +# If unset, the default is to use in-source builds when python_prepare() +# is declared, and out-of-source builds otherwise. +# +# If in-source builds are used, the eclass will create a copy of package +# sources for each Python implementation in python_prepare_all(), +# and work on that copy afterwards. +# +# If out-of-source builds are used, the eclass will instead work +# on the sources directly, prepending setup.py arguments with +# 'build --build-base ${BUILD_DIR}' to enforce keeping & using built +# files in the specific root. + +# @ECLASS-VARIABLE: DISTUTILS_ALL_SUBPHASE_IMPLS +# @DEFAULT_UNSET +# @DESCRIPTION: +# An array of patterns specifying which implementations can be used +# for *_all() sub-phase functions. If undefined, defaults to '*' +# (allowing any implementation). If multiple values are specified, +# implementations matching any of the patterns will be accepted. +# +# The patterns can be either fnmatch-style patterns (matched via bash +# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate +# appropriately all enabled Python 2/3 implementations (alike +# python_is_python3). Remember to escape or quote the fnmatch patterns +# to prevent accidental shell filename expansion. +# +# If the restriction needs to apply conditionally to a USE flag, +# the variable should be set conditionally as well (e.g. in an early +# phase function or other convenient location). +# +# Please remember to add a matching || block to REQUIRED_USE, +# to ensure that at least one implementation matching the patterns will +# be enabled. +# +# Example: +# @CODE +# REQUIRED_USE="doc? ( || ( $(python_gen_useflags 'python2*') ) )" +# +# pkg_setup() { +# use doc && DISTUTILS_ALL_SUBPHASE_IMPLS=( 'python2*' ) +# } +# @CODE + +# @ECLASS-VARIABLE: mydistutilsargs +# @DEFAULT_UNSET +# @DESCRIPTION: +# An array containing options to be passed to setup.py. +# +# Example: +# @CODE +# python_configure_all() { +# mydistutilsargs=( --enable-my-hidden-option ) +# } +# @CODE + +# @FUNCTION: distutils_enable_sphinx +# @USAGE: [--no-autodoc | ...] +# @DESCRIPTION: +# Set up IUSE, BDEPEND, python_check_deps() and python_compile_all() for +# building HTML docs via dev-python/sphinx. python_compile_all() will +# append to HTML_DOCS if docs are enabled. +# +# This helper is meant for the most common case, that is a single Sphinx +# subdirectory with standard layout, building and installing HTML docs +# behind USE=doc. It assumes it's the only consumer of the three +# aforementioned functions. If you need to use a custom implemention, +# you can't use it. +# +# If your package uses additional Sphinx plugins, they should be passed +# (without PYTHON_USEDEP) as . The function will take care +# of setting appropriate any-of dep and python_check_deps(). +# +# If no plugin packages are specified, the eclass will still utilize +# any-r1 API to support autodoc (documenting source code). +# If the package uses neither autodoc nor additional plugins, you should +# pass --no-autodoc to disable this API and simplify the resulting code. +# +# This function must be called in global scope. Take care not to +# overwrite the variables set by it. If you need to extend +# python_compile_all(), you can call the original implementation +# as sphinx_compile_all. +distutils_enable_sphinx() { + debug-print-function ${FUNCNAME} "${@}" + [[ ${#} -ge 1 ]] || die "${FUNCNAME} takes at least one arg: " + + _DISTUTILS_SPHINX_SUBDIR=${1} + shift + _DISTUTILS_SPHINX_PLUGINS=( "${@}" ) + + local deps autodoc=1 d + deps="dev-python/sphinx[\${PYTHON_USEDEP}]" + for d; do + if [[ ${d} == --no-autodoc ]]; then + autodoc= + else + deps+=" + ${d}[\${PYTHON_USEDEP}]" + if [[ ! ${autodoc} ]]; then + die "${FUNCNAME}: do not pass --no-autodoc if external plugins are used" + fi + fi + done + + if [[ ${autodoc} ]]; then + if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then + deps="$(python_gen_cond_dep "${deps}")" + else + deps="$(python_gen_any_dep "${deps}")" + fi + + python_check_deps() { + use doc || return 0 + local p + for p in dev-python/sphinx "${_DISTUTILS_SPHINX_PLUGINS[@]}"; do + has_version "${p}[${PYTHON_USEDEP}]" || return 1 + done + } + else + deps="dev-python/sphinx" + fi + + sphinx_compile_all() { + use doc || return + + local confpy=${_DISTUTILS_SPHINX_SUBDIR}/conf.py + [[ -f ${confpy} ]] || + die "${confpy} not found, distutils_enable_sphinx call wrong" + + if [[ ${_DISTUTILS_SPHINX_PLUGINS[0]} == --no-autodoc ]]; then + if grep -F -q 'sphinx.ext.autodoc' "${confpy}"; then + die "distutils_enable_sphinx: --no-autodoc passed but sphinx.ext.autodoc found in ${confpy}" + fi + elif [[ -z ${_DISTUTILS_SPHINX_PLUGINS[@]} ]]; then + if ! grep -F -q 'sphinx.ext.autodoc' "${confpy}"; then + die "distutils_enable_sphinx: sphinx.ext.autodoc not found in ${confpy}, pass --no-autodoc" + fi + fi + + build_sphinx "${_DISTUTILS_SPHINX_SUBDIR}" + } + python_compile_all() { sphinx_compile_all; } + + IUSE+=" doc" + if [[ ${EAPI} == [56] ]]; then + DEPEND+=" doc? ( ${deps} )" + else + BDEPEND+=" doc? ( ${deps} )" + fi + + # we need to ensure successful return in case we're called last, + # otherwise Portage may wrongly assume sourcing failed + return 0 +} + +# @FUNCTION: distutils_enable_tests +# @USAGE: [--install] +# @DESCRIPTION: +# Set up IUSE, RESTRICT, BDEPEND and python_test() for running tests +# with the specified test runner. Also copies the current value +# of RDEPEND to test?-BDEPEND. The test-runner argument must be one of: +# +# - nose: nosetests (dev-python/nose) +# - pytest: dev-python/pytest +# - setup.py: setup.py test (no deps included) +# - unittest: for built-in Python unittest module +# +# Additionally, if --install is passed as the first parameter, +# 'distutils_install_for_testing --via-root' is called before running +# the test suite. +# +# This function is meant as a helper for common use cases, and it only +# takes care of basic setup. You still need to list additional test +# dependencies manually. If you have uncommon use case, you should +# not use it and instead enable tests manually. +# +# This function must be called in global scope, after RDEPEND has been +# declared. Take care not to overwrite the variables set by it. +distutils_enable_tests() { + debug-print-function ${FUNCNAME} "${@}" + + local do_install= + case ${1} in + --install) + do_install=1 + shift + ;; + esac + + [[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: test-runner" + local test_pkg + case ${1} in + nose) + test_pkg=">=dev-python/nose-1.3.7-r4" + if [[ ${do_install} ]]; then + python_test() { + distutils_install_for_testing --via-root + nosetests -v || die "Tests fail with ${EPYTHON}" + } + else + python_test() { + nosetests -v || die "Tests fail with ${EPYTHON}" + } + fi + ;; + pytest) + test_pkg=">=dev-python/pytest-4.5.0" + if [[ ${do_install} ]]; then + python_test() { + distutils_install_for_testing --via-root + pytest -vv || die "Tests fail with ${EPYTHON}" + } + else + python_test() { + pytest -vv || die "Tests fail with ${EPYTHON}" + } + fi + ;; + setup.py) + if [[ ${do_install} ]]; then + python_test() { + distutils_install_for_testing --via-root + nonfatal esetup.py test --verbose || + die "Tests fail with ${EPYTHON}" + } + else + python_test() { + nonfatal esetup.py test --verbose || + die "Tests fail with ${EPYTHON}" + } + fi + ;; + unittest) + if [[ ${do_install} ]]; then + python_test() { + distutils_install_for_testing --via-root + "${EPYTHON}" -m unittest discover -v || + die "Tests fail with ${EPYTHON}" + } + else + python_test() { + "${EPYTHON}" -m unittest discover -v || + die "Tests fail with ${EPYTHON}" + } + fi + ;; + *) + die "${FUNCNAME}: unsupported argument: ${1}" + esac + + local test_deps=${RDEPEND} + if [[ -n ${test_pkg} ]]; then + if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then + test_deps+=" ${test_pkg}[${PYTHON_USEDEP}]" + else + test_deps+=" $(python_gen_cond_dep " + ${test_pkg}[\${PYTHON_MULTI_USEDEP}] + ")" + fi + fi + if [[ -n ${test_deps} ]]; then + IUSE+=" test" + RESTRICT+=" !test? ( test )" + if [[ ${EAPI} == [56] ]]; then + DEPEND+=" test? ( ${test_deps} )" + else + BDEPEND+=" test? ( ${test_deps} )" + fi + fi + + # we need to ensure successful return in case we're called last, + # otherwise Portage may wrongly assume sourcing failed + return 0 +} + +# @FUNCTION: esetup.py +# @USAGE: [...] +# @DESCRIPTION: +# Run setup.py using currently selected Python interpreter +# (if ${EPYTHON} is set; fallback 'python' otherwise). +# +# setup.py will be passed the following, in order: +# 1. ${mydistutilsargs[@]} +# 2. additional arguments passed to the esetup.py function. +# +# Please note that setup.py will respect defaults (unless overridden +# via command-line options) from setup.cfg that is created +# in distutils2_python_compile and in distutils2_python_install. +# +# This command dies on failure. +esetup.py() { + debug-print-function ${FUNCNAME} "${@}" + + local die_args=() + [[ ${EAPI} != [45] ]] && die_args+=( -n ) + + [[ ${BUILD_DIR} ]] && _distutils2_create_setup_cfg + + set -- "${EPYTHON:-python}" setup.py "${mydistutilsargs[@]}" "${@}" + + echo "${@}" >&2 + "${@}" || die "${die_args[@]}" + local ret=${?} + + if [[ ${BUILD_DIR} ]]; then + rm "${HOME}"/.pydistutils.cfg || die "${die_args[@]}" + fi + + return ${ret} +} + +# @FUNCTION: distutils_install_for_testing +# @USAGE: [--via-root|--via-home] [...] +# @DESCRIPTION: +# Install the package into a temporary location for running tests. +# Update PYTHONPATH appropriately and set TEST_DIR to the test +# installation root. The Python packages will be installed in 'lib' +# subdir, and scripts in 'scripts' subdir (like in BUILD_DIR). +# +# Please note that this function should be only used if package uses +# namespaces (and therefore proper install needs to be done to enforce +# PYTHONPATH) or tests rely on the results of install command. +# For most of the packages, tests built in BUILD_DIR are good enough. +# +# The function supports two install modes. The current default is +# --via-root mode. Previously, the function defaulted to --via-home +# mode but it has been broken by new versions of setuptools (50.3.0+). +# If you find that --via-root does not work but --via-home does, please +# file a bug to let us know. Please note that proper testing sometimes +# requires unmerging the package first. +distutils_install_for_testing() { + debug-print-function ${FUNCNAME} "${@}" + + # A few notes: + # 1) because of namespaces, we can't use 'install --root' + # (NB: this is probably no longer true with py3), + # 2) 'install --home' is terribly broken on pypy, so we need + # to override --install-lib and --install-scripts, + # 3) non-root 'install' complains about PYTHONPATH and missing dirs, + # so we need to set it properly and mkdir them, + # 4) it runs a bunch of commands which write random files to cwd, + # in order to avoid that, we add the necessary path overrides + # in _distutils2_create_setup_cfg. + + TEST_DIR=${BUILD_DIR}/test + local bindir=${TEST_DIR}/scripts + local libdir=${TEST_DIR}/lib + PATH=${bindir}:${PATH} + PYTHONPATH=${libdir}:${PYTHONPATH} + + local install_method=root + case ${1} in + --via-home) + install_method=home + shift + ;; + --via-root) + install_method=root + shift + ;; + esac + + local -a add_args + case ${install_method} in + home) + add_args=( + install + --home="${TEST_DIR}" + --install-lib="${libdir}" + --install-scripts="${bindir}" + ) + mkdir -p "${libdir}" || die + ;; + root) + add_args=( + install + --root="${TEST_DIR}" + --install-lib=lib + --install-scripts=scripts + ) + ;; + esac + + esetup.py "${add_args[@]}" "${@}" +} + +# @FUNCTION: _distutils2_disable_ez_setup +# @INTERNAL +# @DESCRIPTION: +# Stub out ez_setup.py and distribute_setup.py to prevent packages +# from trying to download a local copy of setuptools. +_distutils2_disable_ez_setup() { + local stub="def use_setuptools(*args, **kwargs): pass" + if [[ -f ez_setup.py ]]; then + echo "${stub}" > ez_setup.py || die + fi + if [[ -f distribute_setup.py ]]; then + echo "${stub}" > distribute_setup.py || die + fi +} + +# @FUNCTION: _distutils2_handle_pyproject_toml +# @INTERNAL +# @DESCRIPTION: +# Generate setup.py for pyproject.toml if requested. +_distutils2_handle_pyproject_toml() { + if [[ ! -f setup.py && -f pyproject.toml ]]; then + if [[ ${DISTUTILS_USE_SETUPTOOLS} == pyproject.toml ]]; then + cat > setup.py <<-EOF || die + #!/usr/bin/env python + from pyproject2setuppy.main import main + main() + EOF + chmod +x setup.py || die + else + eerror "No setup.py found but pyproject.toml is present. In order to enable" + eerror "pyproject.toml support in distutils2, set:" + eerror " DISTUTILS_USE_SETUPTOOLS=pyproject.toml" + die "No setup.py found and DISTUTILS_USE_SETUPTOOLS!=pyproject.toml" + fi + fi +} + +# @FUNCTION: distutils2_python_prepare_all +# @DESCRIPTION: +# The default python_prepare_all(). It applies the patches from PATCHES +# array, then user patches and finally calls python_copy_sources to +# create copies of resulting sources for each Python implementation. +# +# At some point in the future, it may also apply eclass-specific +# distutils patches and/or quirks. +distutils2_python_prepare_all() { + debug-print-function ${FUNCNAME} "${@}" + + if [[ ! ${DISTUTILS_OPTIONAL} ]]; then + if [[ ${EAPI} != [45] ]]; then + default + else + [[ ${PATCHES} ]] && epatch "${PATCHES[@]}" + epatch_user + fi + fi + + # by default, use in-source build if python_prepare() is used + if [[ ! ${DISTUTILS_IN_SOURCE_BUILD+1} ]]; then + if declare -f python_prepare >/dev/null; then + DISTUTILS_IN_SOURCE_BUILD=1 + fi + fi + + _distutils2_disable_ez_setup + _distutils2_handle_pyproject_toml + + if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]] + then + # create source copies for each implementation + python_copy_sources + fi + + _DISTUTILS_DEFAULT_CALLED=1 +} + +# @FUNCTION: distutils2_python_prepare +# @DESCRIPTION: +# The default python_prepare(). A no-op. +distutils2_python_prepare() { + debug-print-function ${FUNCNAME} "${@}" + + [[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI 6 (it was a no-op)" +} + +# @FUNCTION: distutils2_python_configure +# @DESCRIPTION: +# The default python_configure(). A no-op. +distutils2_python_configure() { + debug-print-function ${FUNCNAME} "${@}" + + [[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI 6 (it was a no-op)" +} + +# @FUNCTION: _distutils2_create_setup_cfg +# @INTERNAL +# @DESCRIPTION: +# Create implementation-specific configuration file for distutils, +# setting proper build-dir (and install-dir) paths. +_distutils2_create_setup_cfg() { + cat > "${HOME}"/.pydistutils.cfg <<-_EOF_ || die + [build] + build-base = ${BUILD_DIR} + + # using a single directory for them helps us export + # ${PYTHONPATH} and ebuilds find the sources independently + # of whether the package installs extensions or not + # + # note: due to some packages (wxpython) relying on separate + # platlib & purelib dirs, we do not set --build-lib (which + # can not be overridden with --build-*lib) + build-platlib = %(build-base)s/lib + build-purelib = %(build-base)s/lib + + # make the ebuild writer lives easier + build-scripts = %(build-base)s/scripts + + # this is needed by distutils_install_for_testing since + # setuptools like to create .egg files for install --home. + [bdist_egg] + dist-dir = ${BUILD_DIR}/dist + _EOF_ + + # we can't refer to ${D} before src_install() + if [[ ${EBUILD_PHASE} == install ]]; then + cat >> "${HOME}"/.pydistutils.cfg <<-_EOF_ || die + + # installation paths -- allow calling extra install targets + # without the default 'install' + [install] + compile = True + optimize = 2 + root = ${D%/} + _EOF_ + + if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then + cat >> "${HOME}"/.pydistutils.cfg <<-_EOF_ || die + install-scripts = $(python_get_scriptdir) + _EOF_ + fi + fi +} + +# @FUNCTION: _distutils2_copy_egg_info +# @INTERNAL +# @DESCRIPTION: +# Copy egg-info files to the ${BUILD_DIR} (that's going to become +# egg-base in esetup.py). This way, we respect whatever's in upstream +# egg-info. +_distutils2_copy_egg_info() { + mkdir -p "${BUILD_DIR}" || die + # stupid freebsd can't do 'cp -t ${BUILD_DIR} {} +' + find -name '*.egg-info' -type d -exec cp -R -p {} "${BUILD_DIR}"/ ';' || die +} + +# @FUNCTION: distutils2_python_compile +# @USAGE: [additional-args...] +# @DESCRIPTION: +# The default python_compile(). Runs 'esetup.py build'. Any parameters +# passed to this function will be appended to setup.py invocation, +# i.e. passed as options to the 'build' command. +# +# This phase also sets up initial setup.cfg with build directories +# and copies upstream egg-info files if supplied. +distutils2_python_compile() { + debug-print-function ${FUNCNAME} "${@}" + + _distutils2_copy_egg_info + + local build_args=() + # distutils is parallel-capable since py3.5 + # to avoid breaking stable ebuilds, enable it only if either: + # a. we're dealing with EAPI 7 + # b. we're dealing with Python 3.7 or PyPy3 + if python_is_python3 && [[ ${EPYTHON} != python3.4 ]]; then + if [[ ${EAPI} != [56] || ${EPYTHON} != python3.[56] ]]; then + local jobs=$(makeopts_jobs "${MAKEOPTS}" INF) + if [[ ${jobs} == INF ]]; then + local nproc=$(get_nproc) + jobs=$(( nproc + 1 )) + fi + build_args+=( -j "${jobs}" ) + fi + fi + + esetup.py build "${build_args[@]}" "${@}" +} + +# @FUNCTION: _distutils2_wrap_scripts +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Moves and wraps all installed scripts/executables as necessary. +_distutils2_wrap_scripts() { + debug-print-function ${FUNCNAME} "${@}" + + [[ ${#} -eq 2 ]] || die "usage: ${FUNCNAME} " + local path=${1} + local bindir=${2} + + local scriptdir=$(python_get_scriptdir) + local f python_files=() non_python_files=() + + if [[ -d ${path}${scriptdir} ]]; then + for f in "${path}${scriptdir}"/*; do + [[ -d ${f} ]] && die "Unexpected directory: ${f}" + debug-print "${FUNCNAME}: found executable at ${f#${path}/}" + + local shebang + read -r shebang < "${f}" + if [[ ${shebang} == '#!'*${EPYTHON}* ]]; then + debug-print "${FUNCNAME}: matching shebang: ${shebang}" + python_files+=( "${f}" ) + else + debug-print "${FUNCNAME}: non-matching shebang: ${shebang}" + non_python_files+=( "${f}" ) + fi + + mkdir -p "${path}${bindir}" || die + done + + for f in "${python_files[@]}"; do + local basename=${f##*/} + + debug-print "${FUNCNAME}: installing wrapper at ${bindir}/${basename}" + _python_ln_rel "${path}${EPREFIX}"/usr/lib/python-exec/python-exec2 \ + "${path}${bindir}/${basename}" || die + done + + for f in "${non_python_files[@]}"; do + local basename=${f##*/} + + debug-print "${FUNCNAME}: moving ${f#${path}/} to ${bindir}/${basename}" + mv "${f}" "${path}${bindir}/${basename}" || die + done + fi +} + +# @FUNCTION: distutils2_python_install +# @USAGE: [additional-args...] +# @DESCRIPTION: +# The default python_install(). Runs 'esetup.py install', doing +# intermediate root install and handling script wrapping afterwards. +# Any parameters passed to this function will be appended +# to the setup.py invocation (i.e. as options to the 'install' command). +# +# This phase updates the setup.cfg file with install directories. +distutils2_python_install() { + debug-print-function ${FUNCNAME} "${@}" + + local args=( "${@}" ) + + # enable compilation for the install phase. + local -x PYTHONDONTWRITEBYTECODE= + + # python likes to compile any module it sees, which triggers sandbox + # failures if some packages haven't compiled their modules yet. + addpredict "${EPREFIX}/usr/lib/${EPYTHON}" + addpredict "${EPREFIX}/usr/$(get_libdir)/${EPYTHON}" + addpredict /usr/lib/pypy2.7 + addpredict /usr/lib/pypy3.6 + addpredict /usr/lib/portage/pym + addpredict /usr/local # bug 498232 + + if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then + # user may override --install-scripts + # note: this is poor but distutils argv parsing is dumb + local mydistutilsargs=( "${mydistutilsargs[@]}" ) + local scriptdir=${EPREFIX}/usr/bin + + # construct a list of mydistutilsargs[0] args[0] args[1]... + local arg arg_vars + [[ ${mydistutilsargs[@]} ]] && eval arg_vars+=( + 'mydistutilsargs['{0..$(( ${#mydistutilsargs[@]} - 1 ))}']' + ) + [[ ${args[@]} ]] && eval arg_vars+=( + 'args['{0..$(( ${#args[@]} - 1 ))}']' + ) + + set -- "${arg_vars[@]}" + while [[ ${@} ]]; do + local arg_var=${1} + shift + local a=${!arg_var} + + case "${a}" in + --install-scripts=*) + scriptdir=${a#--install-scripts=} + unset "${arg_var}" + ;; + --install-scripts) + scriptdir=${!1} + unset "${arg_var}" "${1}" + shift + ;; + esac + done + fi + + local root=${D%/}/_${EPYTHON} + [[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D%/} + + esetup.py install --skip-build --root="${root}" "${args[@]}" + + local forbidden_package_names=( examples test tests .pytest_cache ) + local p + for p in "${forbidden_package_names[@]}"; do + if [[ -d ${root}$(python_get_sitedir)/${p} ]]; then + die "Package installs '${p}' package which is forbidden and likely a bug in the build system." + fi + done + + local shopt_save=$(shopt -p nullglob) + shopt -s nullglob + local pypy_dirs=( + "${root}/usr/$(get_libdir)"/pypy*/share + "${root}/usr/lib"/pypy*/share + ) + ${shopt_save} + + if [[ -n ${pypy_dirs} ]]; then + die "Package installs 'share' in PyPy prefix, see bug #465546." + fi + + if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then + _distutils2_wrap_scripts "${root}" "${scriptdir}" + multibuild_merge_root "${root}" "${D%/}" + fi +} + +# @FUNCTION: distutils2_python_install_all +# @DESCRIPTION: +# The default python_install_all(). It installs the documentation. +distutils2_python_install_all() { + debug-print-function ${FUNCNAME} "${@}" + + einstalldocs + + if declare -p EXAMPLES &>/dev/null; then + [[ ${EAPI} != [45] ]] && die "EXAMPLES are banned in EAPI ${EAPI}" + + ( + docinto examples + dodoc -r "${EXAMPLES[@]}" + ) + docompress -x "/usr/share/doc/${PF}/examples" + fi +} + +# @FUNCTION: distutils2_run_phase +# @USAGE: [...] +# @INTERNAL +# @DESCRIPTION: +# Run the given command. +# +# If out-of-source builds are used, the phase function is run in source +# directory, with BUILD_DIR pointing at the build directory +# and PYTHONPATH having an entry for the module build directory. +# +# If in-source builds are used, the command is executed in the directory +# holding the per-implementation copy of sources. BUILD_DIR points +# to the 'build' subdirectory. +distutils2_run_phase() { + debug-print-function ${FUNCNAME} "${@}" + + if [[ ${DISTUTILS_IN_SOURCE_BUILD} ]]; then + # only force BUILD_DIR if implementation is explicitly enabled + # for building; any-r1 API may select one that is not + # https://bugs.gentoo.org/701506 + if [[ ! ${DISTUTILS_SINGLE_IMPL} ]] && + has "${EPYTHON/./_}" ${PYTHON_TARGETS}; then + cd "${BUILD_DIR}" || die + fi + local BUILD_DIR=${BUILD_DIR}/build + fi + local -x PYTHONPATH="${BUILD_DIR}/lib:${PYTHONPATH}" + + # make PATH local for distutils_install_for_testing calls + # it makes little sense to let user modify PATH in per-impl phases + # and _all() already localizes it + local -x PATH=${PATH} + + # Bug 559644 + # using PYTHONPATH when the ${BUILD_DIR}/lib is not created yet might lead to + # problems in setup.py scripts that try to import modules/packages from that path + # during the build process (Python at startup evaluates PYTHONPATH, if the dir is + # not valid then associates a NullImporter object to ${BUILD_DIR}/lib storing it + # in the sys.path_importer_cache) + mkdir -p "${BUILD_DIR}/lib" || die + + # Set up build environment, bug #513664. + local -x AR=${AR} CC=${CC} CPP=${CPP} CXX=${CXX} + tc-export AR CC CPP CXX + + # How to build Python modules in different worlds... + local ldopts + case "${CHOST}" in + # provided by haubi, 2014-07-08 + *-aix*) ldopts='-shared -Wl,-berok';; # good enough + # provided by grobian, 2014-06-22, bug #513664 c7 + *-darwin*) ldopts='-bundle -undefined dynamic_lookup';; + *) ldopts='-shared';; + esac + + local -x LDSHARED="${CC} ${ldopts}" LDCXXSHARED="${CXX} ${ldopts}" + + "${@}" + + cd "${_DISTUTILS_INITIAL_CWD}" || die +} + +# @FUNCTION: _distutils2_run_common_phase +# @USAGE: [...] +# @INTERNAL +# @DESCRIPTION: +# Run the given command, restoring the state for a most preferred Python +# implementation matching DISTUTILS_ALL_SUBPHASE_IMPLS. +# +# If in-source build is used, the command will be run in the copy +# of sources made for the selected Python interpreter. +_distutils2_run_common_phase() { + local DISTUTILS_ORIG_BUILD_DIR=${BUILD_DIR} + + if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then + # reuse the dedicated code branch + _distutils2_run_foreach_impl "${@}" + else + local -x EPYTHON PYTHON + local -x PATH=${PATH} PKG_CONFIG_PATH=${PKG_CONFIG_PATH} + python_setup "${DISTUTILS_ALL_SUBPHASE_IMPLS[@]}" + + local MULTIBUILD_VARIANTS=( "${EPYTHON/./_}" ) + # store for restoring after distutils2_run_phase. + local _DISTUTILS_INITIAL_CWD=${PWD} + multibuild_foreach_variant \ + distutils2_run_phase "${@}" + fi +} + +# @FUNCTION: _distutils2_run_foreach_impl +# @INTERNAL +# @DESCRIPTION: +# Run the given phase for each implementation if multiple implementations +# are enabled, once otherwise. +_distutils2_run_foreach_impl() { + debug-print-function ${FUNCNAME} "${@}" + + # store for restoring after distutils2_run_phase. + local _DISTUTILS_INITIAL_CWD=${PWD} + set -- distutils2_run_phase "${@}" + + if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then + python_foreach_impl "${@}" + else + if [[ ! ${EPYTHON} ]]; then + die "EPYTHON unset, python-single-r1_pkg_setup not called?!" + fi + local BUILD_DIR=${BUILD_DIR:-${S}} + BUILD_DIR=${BUILD_DIR%%/}_${EPYTHON} + + "${@}" + fi +} + +distutils2_src_prepare() { + debug-print-function ${FUNCNAME} "${@}" + + local _DISTUTILS_DEFAULT_CALLED + + # common preparations + if declare -f python_prepare_all >/dev/null; then + python_prepare_all + else + distutils2_python_prepare_all + fi + + if [[ ! ${_DISTUTILS_DEFAULT_CALLED} ]]; then + local cmd=die + [[ ${EAPI} == [45] ]] && cmd=eqawarn + + "${cmd}" "QA: python_prepare_all() didn't call distutils2_python_prepare_all" + fi + + if declare -f python_prepare >/dev/null; then + _distutils2_run_foreach_impl python_prepare + fi +} + +distutils2_src_configure() { + python_export_utf8_locale + [[ ${EAPI} == [56] ]] && xdg_environment_reset # Bug 577704 + + if declare -f python_configure >/dev/null; then + _distutils2_run_foreach_impl python_configure + fi + + if declare -f python_configure_all >/dev/null; then + _distutils2_run_common_phase python_configure_all + fi +} + +distutils2_src_compile() { + debug-print-function ${FUNCNAME} "${@}" + + if declare -f python_compile >/dev/null; then + _distutils2_run_foreach_impl python_compile + else + _distutils2_run_foreach_impl distutils2_python_compile + fi + + if declare -f python_compile_all >/dev/null; then + _distutils2_run_common_phase python_compile_all + fi +} + +# @FUNCTION: _distutils2_clean_egg_info +# @INTERNAL +# @DESCRIPTION: +# Clean up potential stray egg-info files left by setuptools test phase. +# Those files ended up being unversioned, and caused issues: +# https://bugs.gentoo.org/534058 +_distutils2_clean_egg_info() { + rm -rf "${BUILD_DIR}"/lib/*.egg-info || die +} + +distutils2_src_test() { + debug-print-function ${FUNCNAME} "${@}" + + if declare -f python_test >/dev/null; then + _distutils2_run_foreach_impl python_test + _distutils2_run_foreach_impl _distutils2_clean_egg_info + fi + + if declare -f python_test_all >/dev/null; then + _distutils2_run_common_phase python_test_all + fi +} + +# @FUNCTION: _distutils2_check_namespace_pth +# @INTERNAL +# @DESCRIPTION: +# Check if any *-nspkg.pth files were installed (by setuptools) +# and warn about the policy non-conformance if they were. +_distutils2_check_namespace_pth() { + local f pth=() + + while IFS= read -r -d '' f; do + pth+=( "${f}" ) + done < <(find "${ED%/}" -name '*-nspkg.pth' -print0) + + if [[ ${pth[@]} ]]; then + ewarn "The following *-nspkg.pth files were found installed:" + ewarn + for f in "${pth[@]}"; do + ewarn " ${f#${ED%/}}" + done + ewarn + ewarn "The presence of those files may break namespaces in Python 3.5+. Please" + ewarn "read our documentation on reliable handling of namespaces and update" + ewarn "the ebuild accordingly:" + ewarn + ewarn " https://wiki.gentoo.org/wiki/Project:Python/Namespace_packages" + fi +} + +distutils2_src_install() { + debug-print-function ${FUNCNAME} "${@}" + + if declare -f python_install >/dev/null; then + _distutils2_run_foreach_impl python_install + else + _distutils2_run_foreach_impl distutils2_python_install + fi + + if declare -f python_install_all >/dev/null; then + _distutils2_run_common_phase python_install_all + else + _distutils2_run_common_phase distutils2_python_install_all + fi + + _distutils2_check_namespace_pth +} + +# -- distutils.eclass functions -- + +distutils_get_intermediate_installation_image() { + die "${FUNCNAME}() is invalid for distutils2" +} + +distutils_src_unpack() { + die "${FUNCNAME}() is invalid for distutils2, and you don't want it in EAPI ${EAPI} anyway" +} + +distutils_src_prepare() { + die "${FUNCNAME}() is invalid for distutils2, you probably want: ${FUNCNAME/_/-r1_}" +} + +distutils_src_compile() { + die "${FUNCNAME}() is invalid for distutils2, you probably want: ${FUNCNAME/_/-r1_}" +} + +distutils_src_test() { + die "${FUNCNAME}() is invalid for distutils2, you probably want: ${FUNCNAME/_/-r1_}" +} + +distutils_src_install() { + die "${FUNCNAME}() is invalid for distutils2, you probably want: ${FUNCNAME/_/-r1_}" +} + +distutils_pkg_postinst() { + die "${FUNCNAME}() is invalid for distutils2, and pkg_postinst is unnecessary" +} + +distutils_pkg_postrm() { + die "${FUNCNAME}() is invalid for distutils2, and pkg_postrm is unnecessary" +} + +_DISTUTILS_R1=1 +fi diff --git a/eclass/python2-utils.eclass b/eclass/python2-utils.eclass new file mode 100644 index 000000000..7bf0839c7 --- /dev/null +++ b/eclass/python2-utils.eclass @@ -0,0 +1,1450 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: python2-utils.eclass +# @MAINTAINER: +# Python team +# @AUTHOR: +# Author: Michał Górny +# Based on work of: Krzysztof Pawlik +# @SUPPORTED_EAPIS: 5 6 7 +# @BLURB: Utility functions for packages with Python parts. +# @DESCRIPTION: +# A utility eclass providing functions to query Python implementations, +# install Python modules and scripts. +# +# This eclass does not set any metadata variables nor export any phase +# functions. It can be inherited safely. +# +# For more information, please see the Python Guide: +# https://dev.gentoo.org/~mgorny/python-guide/ + +case "${EAPI:-0}" in + [0-4]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;; + [5-7]) ;; + *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;; +esac + +if [[ ${_PYTHON_ECLASS_INHERITED} ]]; then + die 'python2 suite eclasses can not be used with python.eclass.' +fi + +if [[ ! ${_PYTHON_UTILS_R1} ]]; then + +[[ ${EAPI} == 5 ]] && inherit eutils multilib +inherit toolchain-funcs + +# @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS +# @INTERNAL +# @DESCRIPTION: +# All supported Python implementations, most preferred last. +_PYTHON_ALL_IMPLS=( + pypy3 + python2_7 + python3_7 python3_8 python3_9 +) +readonly _PYTHON_ALL_IMPLS + +# @ECLASS-VARIABLE: _PYTHON_HISTORICAL_IMPLS +# @INTERNAL +# @DESCRIPTION: +# All historical Python implementations that are no longer supported. +_PYTHON_HISTORICAL_IMPLS=( + jython2_7 + pypy pypy1_{8,9} pypy2_0 + python2_{5..7} + python3_{1..6} +) +readonly _PYTHON_HISTORICAL_IMPLS + +# @ECLASS-VARIABLE: PYTHON_COMPAT_NO_STRICT +# @INTERNAL +# @DESCRIPTION: +# Set to a non-empty value in order to make eclass tolerate (ignore) +# unknown implementations in PYTHON_COMPAT. +# +# This is intended to be set by the user when using ebuilds that may +# have unknown (newer) implementations in PYTHON_COMPAT. The assumption +# is that the ebuilds are intended to be used within multiple contexts +# which can involve revisions of this eclass that support a different +# set of Python implementations. + +# @FUNCTION: _python_verify_patterns +# @USAGE: ... +# @INTERNAL +# @DESCRIPTION: +# Verify whether the patterns passed to the eclass function are correct +# (i.e. can match any valid implementation). Dies on wrong pattern. +_python_verify_patterns() { + debug-print-function ${FUNCNAME} "${@}" + + local impl pattern + for pattern; do + [[ ${pattern} == -[23] ]] && continue + + for impl in "${_PYTHON_ALL_IMPLS[@]}" "${_PYTHON_HISTORICAL_IMPLS[@]}" + do + [[ ${impl} == ${pattern/./_} ]] && continue 2 + done + + die "Invalid implementation pattern: ${pattern}" + done +} + +# @FUNCTION: _python_set_impls +# @INTERNAL +# @DESCRIPTION: +# Check PYTHON_COMPAT for well-formedness and validity, then set +# two global variables: +# +# - _PYTHON_SUPPORTED_IMPLS containing valid implementations supported +# by the ebuild (PYTHON_COMPAT - dead implementations), +# +# - and _PYTHON_UNSUPPORTED_IMPLS containing valid implementations that +# are not supported by the ebuild. +# +# Implementations in both variables are ordered using the pre-defined +# eclass implementation ordering. +# +# This function must be called once in global scope by an eclass +# utilizing PYTHON_COMPAT. +_python_set_impls() { + local i + + if ! declare -p PYTHON_COMPAT &>/dev/null; then + die 'PYTHON_COMPAT not declared.' + fi + if [[ $(declare -p PYTHON_COMPAT) != "declare -a"* ]]; then + die 'PYTHON_COMPAT must be an array.' + fi + if [[ ! ${PYTHON_COMPAT_NO_STRICT} ]]; then + for i in "${PYTHON_COMPAT[@]}"; do + # check for incorrect implementations + # we're using pattern matching as an optimization + # please keep them in sync with _PYTHON_ALL_IMPLS + # and _PYTHON_HISTORICAL_IMPLS + case ${i} in + jython2_7|pypy|pypy1_[89]|pypy2_0|pypy3|python2_[5-7]|python3_[1-9]) + ;; + *) + if has "${i}" "${_PYTHON_ALL_IMPLS[@]}" \ + "${_PYTHON_HISTORICAL_IMPLS[@]}" + then + die "Mis-synced patterns in _python_set_impls: missing ${i}" + else + die "Invalid implementation in PYTHON_COMPAT: ${i}" + fi + esac + done + fi + + local supp=() unsupp=() + + for i in "${_PYTHON_ALL_IMPLS[@]}"; do + if has "${i}" "${PYTHON_COMPAT[@]}"; then + supp+=( "${i}" ) + else + unsupp+=( "${i}" ) + fi + done + if [[ ! ${supp[@]} ]]; then + # special-case python2_7 for python-any-r1 + if [[ ${_PYTHON_ALLOW_PY27} ]] && has python2_7 "${PYTHON_COMPAT[@]}" + then + supp+=( python2_7 ) + else + die "No supported implementation in PYTHON_COMPAT." + fi + fi + + if [[ ${_PYTHON_SUPPORTED_IMPLS[@]} ]]; then + # set once already, verify integrity + if [[ ${_PYTHON_SUPPORTED_IMPLS[@]} != ${supp[@]} ]]; then + eerror "Supported impls (PYTHON_COMPAT) changed between inherits!" + eerror "Before: ${_PYTHON_SUPPORTED_IMPLS[*]}" + eerror "Now : ${supp[*]}" + die "_PYTHON_SUPPORTED_IMPLS integrity check failed" + fi + if [[ ${_PYTHON_UNSUPPORTED_IMPLS[@]} != ${unsupp[@]} ]]; then + eerror "Unsupported impls changed between inherits!" + eerror "Before: ${_PYTHON_UNSUPPORTED_IMPLS[*]}" + eerror "Now : ${unsupp[*]}" + die "_PYTHON_UNSUPPORTED_IMPLS integrity check failed" + fi + else + _PYTHON_SUPPORTED_IMPLS=( "${supp[@]}" ) + _PYTHON_UNSUPPORTED_IMPLS=( "${unsupp[@]}" ) + readonly _PYTHON_SUPPORTED_IMPLS _PYTHON_UNSUPPORTED_IMPLS + fi +} + +# @FUNCTION: _python_impl_matches +# @USAGE: [...] +# @INTERNAL +# @DESCRIPTION: +# Check whether the specified matches at least one +# of the patterns following it. Return 0 if it does, 1 otherwise. +# Matches if no patterns are provided. +# +# can be in PYTHON_COMPAT or EPYTHON form. The patterns can be +# either: +# a) fnmatch-style patterns, e.g. 'python2*', 'pypy'... +# b) '-2' to indicate all Python 2 variants (= !python_is_python3) +# c) '-3' to indicate all Python 3 variants (= python_is_python3) +_python_impl_matches() { + [[ ${#} -ge 1 ]] || die "${FUNCNAME}: takes at least 1 parameter" + [[ ${#} -eq 1 ]] && return 0 + + local impl=${1} pattern + shift + + for pattern; do + if [[ ${pattern} == -2 ]]; then + python_is_python3 "${impl}" || return 0 + elif [[ ${pattern} == -3 ]]; then + python_is_python3 "${impl}" && return 0 + return + # unify value style to allow lax matching + elif [[ ${impl/./_} == ${pattern/./_} ]]; then + return 0 + fi + done + + return 1 +} + +# @ECLASS-VARIABLE: PYTHON +# @DEFAULT_UNSET +# @DESCRIPTION: +# The absolute path to the current Python interpreter. +# +# This variable is set automatically in the following contexts: +# +# python2: Set in functions called by python_foreach_impl() or after +# calling python_setup(). +# +# python-single-r1: Set after calling python-single-r1_pkg_setup(). +# +# distutils2: Set within any of the python sub-phase functions. +# +# Example value: +# @CODE +# /usr/bin/python2.7 +# @CODE + +# @ECLASS-VARIABLE: EPYTHON +# @DEFAULT_UNSET +# @DESCRIPTION: +# The executable name of the current Python interpreter. +# +# This variable is set automatically in the following contexts: +# +# python2: Set in functions called by python_foreach_impl() or after +# calling python_setup(). +# +# python-single-r1: Set after calling python-single-r1_pkg_setup(). +# +# distutils2: Set within any of the python sub-phase functions. +# +# Example value: +# @CODE +# python2.7 +# @CODE + +# @FUNCTION: python_export +# @USAGE: [] ... +# @INTERNAL +# @DESCRIPTION: +# Backwards compatibility function. The relevant API is now considered +# private, please use python_get* instead. +python_export() { + debug-print-function ${FUNCNAME} "${@}" + + eqawarn "python_export() is part of private eclass API." + eqawarn "Please call python_get*() instead." + + _python_export "${@}" +} + +# @FUNCTION: _python_export +# @USAGE: [] ... +# @INTERNAL +# @DESCRIPTION: +# Set and export the Python implementation-relevant variables passed +# as parameters. +# +# The optional first parameter may specify the requested Python +# implementation (either as PYTHON_TARGETS value, e.g. python2_7, +# or an EPYTHON one, e.g. python2.7). If no implementation passed, +# the current one will be obtained from ${EPYTHON}. +# +# The variables which can be exported are: PYTHON, EPYTHON, +# PYTHON_SITEDIR. They are described more completely in the eclass +# variable documentation. +_python_export() { + debug-print-function ${FUNCNAME} "${@}" + + local impl var + + case "${1}" in + python*|jython*) + impl=${1/_/.} + shift + ;; + pypy|pypy3) + impl=${1} + shift + ;; + *) + impl=${EPYTHON} + if [[ -z ${impl} ]]; then + die "_python_export called without a python implementation and EPYTHON is unset" + fi + ;; + esac + debug-print "${FUNCNAME}: implementation: ${impl}" + + for var; do + case "${var}" in + EPYTHON) + export EPYTHON=${impl} + debug-print "${FUNCNAME}: EPYTHON = ${EPYTHON}" + ;; + PYTHON) + export PYTHON=${EPREFIX}/usr/bin/${impl} + debug-print "${FUNCNAME}: PYTHON = ${PYTHON}" + ;; + PYTHON_SITEDIR) + [[ -n ${PYTHON} ]] || die "PYTHON needs to be set for ${var} to be exported, or requested before it" + # sysconfig can't be used because: + # 1) pypy doesn't give site-packages but stdlib + # 2) jython gives paths with wrong case + PYTHON_SITEDIR=$("${PYTHON}" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_lib())') || die + export PYTHON_SITEDIR + debug-print "${FUNCNAME}: PYTHON_SITEDIR = ${PYTHON_SITEDIR}" + ;; + PYTHON_INCLUDEDIR) + [[ -n ${PYTHON} ]] || die "PYTHON needs to be set for ${var} to be exported, or requested before it" + PYTHON_INCLUDEDIR=$("${PYTHON}" -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_inc())') || die + export PYTHON_INCLUDEDIR + debug-print "${FUNCNAME}: PYTHON_INCLUDEDIR = ${PYTHON_INCLUDEDIR}" + + # Jython gives a non-existing directory + if [[ ! -d ${PYTHON_INCLUDEDIR} ]]; then + die "${impl} does not install any header files!" + fi + ;; + PYTHON_LIBPATH) + [[ -n ${PYTHON} ]] || die "PYTHON needs to be set for ${var} to be exported, or requested before it" + PYTHON_LIBPATH=$("${PYTHON}" -c 'import os.path, sysconfig; print(os.path.join(sysconfig.get_config_var("LIBDIR"), sysconfig.get_config_var("LDLIBRARY")) if sysconfig.get_config_var("LDLIBRARY") else "")') || die + export PYTHON_LIBPATH + debug-print "${FUNCNAME}: PYTHON_LIBPATH = ${PYTHON_LIBPATH}" + + if [[ ! ${PYTHON_LIBPATH} ]]; then + die "${impl} lacks a (usable) dynamic library" + fi + ;; + PYTHON_CFLAGS) + local val + + case "${impl}" in + python*) + # python-2.7, python-3.2, etc. + val=$($(tc-getPKG_CONFIG) --cflags ${impl/n/n-}) || die + ;; + *) + die "${impl}: obtaining ${var} not supported" + ;; + esac + + export PYTHON_CFLAGS=${val} + debug-print "${FUNCNAME}: PYTHON_CFLAGS = ${PYTHON_CFLAGS}" + ;; + PYTHON_LIBS) + local val + + case "${impl}" in + python2*|python3.6|python3.7*) + # python* up to 3.7 + val=$($(tc-getPKG_CONFIG) --libs ${impl/n/n-}) || die + ;; + python*) + # python3.8+ + val=$($(tc-getPKG_CONFIG) --libs ${impl/n/n-}-embed) || die + ;; + *) + die "${impl}: obtaining ${var} not supported" + ;; + esac + + export PYTHON_LIBS=${val} + debug-print "${FUNCNAME}: PYTHON_LIBS = ${PYTHON_LIBS}" + ;; + PYTHON_CONFIG) + local flags val + + case "${impl}" in + python*) + [[ -n ${PYTHON} ]] || die "PYTHON needs to be set for ${var} to be exported, or requested before it" + flags=$("${PYTHON}" -c 'import sysconfig; print(sysconfig.get_config_var("ABIFLAGS") or "")') || die + val=${PYTHON}${flags}-config + ;; + *) + die "${impl}: obtaining ${var} not supported" + ;; + esac + + export PYTHON_CONFIG=${val} + debug-print "${FUNCNAME}: PYTHON_CONFIG = ${PYTHON_CONFIG}" + ;; + PYTHON_PKG_DEP) + local d + case ${impl} in + python2.7) + PYTHON_PKG_DEP='>=dev-lang/python-2.7.5-r2:2.7';; + python*) + PYTHON_PKG_DEP="dev-lang/python:${impl#python}";; + pypy) + PYTHON_PKG_DEP='>=dev-python/pypy-7.3.0:0=';; + pypy3) + PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.0:0=';; + *) + die "Invalid implementation: ${impl}" + esac + + # use-dep + if [[ ${PYTHON_REQ_USE} ]]; then + PYTHON_PKG_DEP+=[${PYTHON_REQ_USE}] + fi + + export PYTHON_PKG_DEP + debug-print "${FUNCNAME}: PYTHON_PKG_DEP = ${PYTHON_PKG_DEP}" + ;; + PYTHON_SCRIPTDIR) + local dir + export PYTHON_SCRIPTDIR=${EPREFIX}/usr/lib/python-exec/${impl} + debug-print "${FUNCNAME}: PYTHON_SCRIPTDIR = ${PYTHON_SCRIPTDIR}" + ;; + *) + die "_python_export: unknown variable ${var}" + esac + done +} + +# @FUNCTION: python_get_sitedir +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the 'site-packages' path for the given +# implementation. If no implementation is provided, ${EPYTHON} will +# be used. +python_get_sitedir() { + debug-print-function ${FUNCNAME} "${@}" + + _python_export "${@}" PYTHON_SITEDIR + echo "${PYTHON_SITEDIR}" +} + +# @FUNCTION: python_get_includedir +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the include path for the given implementation. If no +# implementation is provided, ${EPYTHON} will be used. +python_get_includedir() { + debug-print-function ${FUNCNAME} "${@}" + + _python_export "${@}" PYTHON_INCLUDEDIR + echo "${PYTHON_INCLUDEDIR}" +} + +# @FUNCTION: python_get_library_path +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the Python library path for the given implementation. +# If no implementation is provided, ${EPYTHON} will be used. +# +# Please note that this function can be used with CPython only. Use +# in another implementation will result in a fatal failure. +python_get_library_path() { + debug-print-function ${FUNCNAME} "${@}" + + _python_export "${@}" PYTHON_LIBPATH + echo "${PYTHON_LIBPATH}" +} + +# @FUNCTION: python_get_CFLAGS +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the compiler flags for building against Python, +# for the given implementation. If no implementation is provided, +# ${EPYTHON} will be used. +# +# Please note that this function can be used with CPython only. +# It requires Python and pkg-config installed, and therefore proper +# build-time dependencies need be added to the ebuild. +python_get_CFLAGS() { + debug-print-function ${FUNCNAME} "${@}" + + _python_export "${@}" PYTHON_CFLAGS + echo "${PYTHON_CFLAGS}" +} + +# @FUNCTION: python_get_LIBS +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the compiler flags for linking against Python, +# for the given implementation. If no implementation is provided, +# ${EPYTHON} will be used. +# +# Please note that this function can be used with CPython only. +# It requires Python and pkg-config installed, and therefore proper +# build-time dependencies need be added to the ebuild. +python_get_LIBS() { + debug-print-function ${FUNCNAME} "${@}" + + _python_export "${@}" PYTHON_LIBS + echo "${PYTHON_LIBS}" +} + +# @FUNCTION: python_get_PYTHON_CONFIG +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the PYTHON_CONFIG location for the given +# implementation. If no implementation is provided, ${EPYTHON} will be +# used. +# +# Please note that this function can be used with CPython only. +# It requires Python installed, and therefore proper build-time +# dependencies need be added to the ebuild. +python_get_PYTHON_CONFIG() { + debug-print-function ${FUNCNAME} "${@}" + + _python_export "${@}" PYTHON_CONFIG + echo "${PYTHON_CONFIG}" +} + +# @FUNCTION: python_get_scriptdir +# @USAGE: [] +# @DESCRIPTION: +# Obtain and print the script install path for the given +# implementation. If no implementation is provided, ${EPYTHON} will +# be used. +python_get_scriptdir() { + debug-print-function ${FUNCNAME} "${@}" + + _python_export "${@}" PYTHON_SCRIPTDIR + echo "${PYTHON_SCRIPTDIR}" +} + +# @FUNCTION: _python_ln_rel +# @USAGE: +# @INTERNAL +# @DESCRIPTION: +# Create a relative symlink. +_python_ln_rel() { + debug-print-function ${FUNCNAME} "${@}" + + local target=${1} + local symname=${2} + + local tgpath=${target%/*}/ + local sympath=${symname%/*}/ + local rel_target= + + while [[ ${sympath} ]]; do + local tgseg= symseg= + + while [[ ! ${tgseg} && ${tgpath} ]]; do + tgseg=${tgpath%%/*} + tgpath=${tgpath#${tgseg}/} + done + + while [[ ! ${symseg} && ${sympath} ]]; do + symseg=${sympath%%/*} + sympath=${sympath#${symseg}/} + done + + if [[ ${tgseg} != ${symseg} ]]; then + rel_target=../${rel_target}${tgseg:+${tgseg}/} + fi + done + rel_target+=${tgpath}${target##*/} + + debug-print "${FUNCNAME}: ${symname} -> ${target}" + debug-print "${FUNCNAME}: rel_target = ${rel_target}" + + ln -fs "${rel_target}" "${symname}" +} + +# @FUNCTION: python_optimize +# @USAGE: [...] +# @DESCRIPTION: +# Compile and optimize Python modules in specified directories (absolute +# paths). If no directories are provided, the default system paths +# are used (prepended with ${D}). +python_optimize() { + debug-print-function ${FUNCNAME} "${@}" + + if [[ ${EBUILD_PHASE} == pre* || ${EBUILD_PHASE} == post* ]]; then + eerror "The new Python eclasses expect the compiled Python files to" + eerror "be controlled by the Package Manager. For this reason," + eerror "the python_optimize function can be used only during src_* phases" + eerror "(src_install most commonly) and not during pkg_* phases." + echo + die "python_optimize is not to be used in pre/post* phases" + fi + + [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' + + local PYTHON=${PYTHON} + [[ ${PYTHON} ]] || _python_export PYTHON + [[ -x ${PYTHON} ]] || die "PYTHON (${PYTHON}) is not executable" + + # default to sys.path + if [[ ${#} -eq 0 ]]; then + local f + while IFS= read -r -d '' f; do + # 1) accept only absolute paths + # (i.e. skip '', '.' or anything like that) + # 2) skip paths which do not exist + # (python2.6 complains about them verbosely) + + if [[ ${f} == /* && -d ${D%/}${f} ]]; then + set -- "${D%/}${f}" "${@}" + fi + done < <("${PYTHON}" -c 'import sys; print("".join(x + "\0" for x in sys.path))' || die) + + debug-print "${FUNCNAME}: using sys.path: ${*/%/;}" + fi + + local d + for d; do + # make sure to get a nice path without // + local instpath=${d#${D%/}} + instpath=/${instpath##/} + + case "${EPYTHON}" in + python2.7|python3.[34]) + "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}" + "${PYTHON}" -OO -m compileall -q -f -d "${instpath}" "${d}" + ;; + python*|pypy3) + # both levels of optimization are separate since 3.5 + "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}" + "${PYTHON}" -O -m compileall -q -f -d "${instpath}" "${d}" + "${PYTHON}" -OO -m compileall -q -f -d "${instpath}" "${d}" + ;; + *) + "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}" + ;; + esac + done +} + +# @FUNCTION: python_scriptinto +# @USAGE: +# @DESCRIPTION: +# Set the directory to which files passed to python_doexe(), +# python_doscript(), python_newexe() and python_newscript() +# are going to be installed. The new value needs to be relative +# to the installation root (${ED}). +# +# If not set explicitly, the directory defaults to /usr/bin. +# +# Example: +# @CODE +# src_install() { +# python_scriptinto /usr/sbin +# python_foreach_impl python_doscript foo +# } +# @CODE +python_scriptinto() { + debug-print-function ${FUNCNAME} "${@}" + + python_scriptroot=${1} +} + +# @FUNCTION: python_doexe +# @USAGE: ... +# @DESCRIPTION: +# Install the given executables into the executable install directory, +# for the current Python implementation (${EPYTHON}). +# +# The executable will be wrapped properly for the Python implementation, +# though no shebang mangling will be performed. +python_doexe() { + debug-print-function ${FUNCNAME} "${@}" + + local f + for f; do + python_newexe "${f}" "${f##*/}" + done +} + +# @FUNCTION: python_newexe +# @USAGE: +# @DESCRIPTION: +# Install the given executable into the executable install directory, +# for the current Python implementation (${EPYTHON}). +# +# The executable will be wrapped properly for the Python implementation, +# though no shebang mangling will be performed. It will be renamed +# to . +python_newexe() { + debug-print-function ${FUNCNAME} "${@}" + + [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' + [[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} " + + local wrapd=${python_scriptroot:-/usr/bin} + + local f=${1} + local newfn=${2} + + local scriptdir=$(python_get_scriptdir) + local d=${scriptdir#${EPREFIX}} + + ( + dodir "${wrapd}" + exeopts -m 0755 + exeinto "${d}" + newexe "${f}" "${newfn}" || return ${?} + ) + + # install the wrapper + _python_ln_rel "${ED%/}"/usr/lib/python-exec/python-exec2 \ + "${ED%/}/${wrapd}/${newfn}" || die + + # don't use this at home, just call python_doscript() instead + if [[ ${_PYTHON_REWRITE_SHEBANG} ]]; then + python_fix_shebang -q "${ED%/}/${d}/${newfn}" + fi +} + +# @FUNCTION: python_doscript +# @USAGE: ... +# @DESCRIPTION: +# Install the given scripts into the executable install directory, +# for the current Python implementation (${EPYTHON}). +# +# All specified files must start with a 'python' shebang. The shebang +# will be converted, and the files will be wrapped properly +# for the Python implementation. +# +# Example: +# @CODE +# src_install() { +# python_foreach_impl python_doscript ${PN} +# } +# @CODE +python_doscript() { + debug-print-function ${FUNCNAME} "${@}" + + local _PYTHON_REWRITE_SHEBANG=1 + python_doexe "${@}" +} + +# @FUNCTION: python_newscript +# @USAGE: +# @DESCRIPTION: +# Install the given script into the executable install directory +# for the current Python implementation (${EPYTHON}), and name it +# . +# +# The file must start with a 'python' shebang. The shebang will be +# converted, and the file will be wrapped properly for the Python +# implementation. It will be renamed to . +# +# Example: +# @CODE +# src_install() { +# python_foreach_impl python_newscript foo.py foo +# } +# @CODE +python_newscript() { + debug-print-function ${FUNCNAME} "${@}" + + local _PYTHON_REWRITE_SHEBANG=1 + python_newexe "${@}" +} + +# @FUNCTION: python_moduleinto +# @USAGE: +# @DESCRIPTION: +# Set the Python module install directory for python_domodule(). +# The can either be an absolute target system path (in which +# case it needs to start with a slash, and ${ED} will be prepended to +# it) or relative to the implementation's site-packages directory +# (then it must not start with a slash). The relative path can be +# specified either using the Python package notation (separated by dots) +# or the directory notation (using slashes). +# +# When not set explicitly, the modules are installed to the top +# site-packages directory. +# +# In the relative case, the exact path is determined directly +# by each python_doscript/python_newscript function. Therefore, +# python_moduleinto can be safely called before establishing the Python +# interpreter and/or a single call can be used to set the path correctly +# for multiple implementations, as can be seen in the following example. +# +# Example: +# @CODE +# src_install() { +# python_moduleinto bar +# # installs ${PYTHON_SITEDIR}/bar/baz.py +# python_foreach_impl python_domodule baz.py +# } +# @CODE +python_moduleinto() { + debug-print-function ${FUNCNAME} "${@}" + + python_moduleroot=${1} +} + +# @FUNCTION: python_domodule +# @USAGE: ... +# @DESCRIPTION: +# Install the given modules (or packages) into the current Python module +# installation directory. The list can mention both modules (files) +# and packages (directories). All listed files will be installed +# for all enabled implementations, and compiled afterwards. +# +# Example: +# @CODE +# src_install() { +# # (${PN} being a directory) +# python_foreach_impl python_domodule ${PN} +# } +# @CODE +python_domodule() { + debug-print-function ${FUNCNAME} "${@}" + + [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' + + local d + if [[ ${python_moduleroot} == /* ]]; then + # absolute path + d=${python_moduleroot} + else + # relative to site-packages + local sitedir=$(python_get_sitedir) + d=${sitedir#${EPREFIX}}/${python_moduleroot//.//} + fi + + ( + insopts -m 0644 + insinto "${d}" + doins -r "${@}" || return ${?} + ) + + python_optimize "${ED%/}/${d}" +} + +# @FUNCTION: python_doheader +# @USAGE: ... +# @DESCRIPTION: +# Install the given headers into the implementation-specific include +# directory. This function is unconditionally recursive, i.e. you can +# pass directories instead of files. +# +# Example: +# @CODE +# src_install() { +# python_foreach_impl python_doheader foo.h bar.h +# } +# @CODE +python_doheader() { + debug-print-function ${FUNCNAME} "${@}" + + [[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).' + + local includedir=$(python_get_includedir) + local d=${includedir#${EPREFIX}} + + ( + insopts -m 0644 + insinto "${d}" + doins -r "${@}" || return ${?} + ) +} + +# @FUNCTION: python_wrapper_setup +# @USAGE: [ []] +# @DESCRIPTION: +# Backwards compatibility function. The relevant API is now considered +# private, please use python_setup instead. +python_wrapper_setup() { + debug-print-function ${FUNCNAME} "${@}" + + eqawarn "python_wrapper_setup() is part of private eclass API." + eqawarn "Please call python_setup() instead." + + _python_wrapper_setup "${@}" +} + +# @FUNCTION: _python_wrapper_setup +# @USAGE: [ []] +# @INTERNAL +# @DESCRIPTION: +# Create proper 'python' executable and pkg-config wrappers +# (if available) in the directory named by . Set up PATH +# and PKG_CONFIG_PATH appropriately. defaults to ${T}/${EPYTHON}. +# +# The wrappers will be created for implementation named by , +# or for one named by ${EPYTHON} if no passed. +# +# If the named directory contains a python symlink already, it will +# be assumed to contain proper wrappers already and only environment +# setup will be done. If wrapper update is requested, the directory +# shall be removed first. +_python_wrapper_setup() { + debug-print-function ${FUNCNAME} "${@}" + + local workdir=${1:-${T}/${EPYTHON}} + local impl=${2:-${EPYTHON}} + + [[ ${workdir} ]] || die "${FUNCNAME}: no workdir specified." + [[ ${impl} ]] || die "${FUNCNAME}: no impl nor EPYTHON specified." + + if [[ ! -x ${workdir}/bin/python ]]; then + _python_check_dead_variables + + mkdir -p "${workdir}"/{bin,pkgconfig} || die + + # Clean up, in case we were supposed to do a cheap update. + rm -f "${workdir}"/bin/python{,2,3}{,-config} || die + rm -f "${workdir}"/bin/2to3 || die + rm -f "${workdir}"/pkgconfig/python{2,3}{,-embed}.pc || die + + local EPYTHON PYTHON + _python_export "${impl}" EPYTHON PYTHON + + local pyver pyother + if python_is_python3; then + pyver=3 + pyother=2 + else + pyver=2 + pyother=3 + fi + + # Python interpreter + # note: we don't use symlinks because python likes to do some + # symlink reading magic that breaks stuff + # https://bugs.gentoo.org/show_bug.cgi?id=555752 + cat > "${workdir}/bin/python" <<-_EOF_ || die + #!/bin/sh + exec "${PYTHON}" "\${@}" + _EOF_ + cp "${workdir}/bin/python" "${workdir}/bin/python${pyver}" || die + chmod +x "${workdir}/bin/python" "${workdir}/bin/python${pyver}" || die + + local nonsupp=( "python${pyother}" "python${pyother}-config" ) + + # CPython-specific + if [[ ${EPYTHON} == python* ]]; then + cat > "${workdir}/bin/python-config" <<-_EOF_ || die + #!/bin/sh + exec "${PYTHON}-config" "\${@}" + _EOF_ + cp "${workdir}/bin/python-config" \ + "${workdir}/bin/python${pyver}-config" || die + chmod +x "${workdir}/bin/python-config" \ + "${workdir}/bin/python${pyver}-config" || die + + # Python 2.6+. + ln -s "${PYTHON/python/2to3-}" "${workdir}"/bin/2to3 || die + + # Python 2.7+. + ln -s "${EPREFIX}"/usr/$(get_libdir)/pkgconfig/${EPYTHON/n/n-}.pc \ + "${workdir}"/pkgconfig/python${pyver}.pc || die + + # Python 3.8+. + if [[ ${EPYTHON} != python[23].[67] ]]; then + ln -s "${EPREFIX}"/usr/$(get_libdir)/pkgconfig/${EPYTHON/n/n-}-embed.pc \ + "${workdir}"/pkgconfig/python${pyver}-embed.pc || die + fi + else + nonsupp+=( 2to3 python-config "python${pyver}-config" ) + fi + + local x + for x in "${nonsupp[@]}"; do + cat >"${workdir}"/bin/${x} <<-_EOF_ || die + #!/bin/sh + echo "${ECLASS}: ${FUNCNAME}: ${x} is not supported by ${EPYTHON} (PYTHON_COMPAT)" >&2 + exit 127 + _EOF_ + chmod +x "${workdir}"/bin/${x} || die + done + fi + + # Now, set the environment. + # But note that ${workdir} may be shared with something else, + # and thus already on top of PATH. + if [[ ${PATH##:*} != ${workdir}/bin ]]; then + PATH=${workdir}/bin${PATH:+:${PATH}} + fi + if [[ ${PKG_CONFIG_PATH##:*} != ${workdir}/pkgconfig ]]; then + PKG_CONFIG_PATH=${workdir}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}} + fi + export PATH PKG_CONFIG_PATH +} + +# @FUNCTION: python_is_python3 +# @USAGE: [] +# @DESCRIPTION: +# Check whether (or ${EPYTHON}) is a Python3k variant +# (i.e. uses syntax and stdlib of Python 3.*). +# +# Returns 0 (true) if it is, 1 (false) otherwise. +python_is_python3() { + local impl=${1:-${EPYTHON}} + [[ ${impl} ]] || die "python_is_python3: no impl nor EPYTHON" + + [[ ${impl} == python3* || ${impl} == pypy3 ]] +} + +# @FUNCTION: python_is_installed +# @USAGE: [] +# @DESCRIPTION: +# Check whether the interpreter for (or ${EPYTHON}) is installed. +# Uses has_version with a proper dependency string. +# +# Returns 0 (true) if it is, 1 (false) otherwise. +python_is_installed() { + local impl=${1:-${EPYTHON}} + [[ ${impl} ]] || die "${FUNCNAME}: no impl nor EPYTHON" + local hasv_args=() + + case ${EAPI} in + 5|6) + hasv_args+=( --host-root ) + ;; + *) + hasv_args+=( -b ) + ;; + esac + + local PYTHON_PKG_DEP + _python_export "${impl}" PYTHON_PKG_DEP + has_version "${hasv_args[@]}" "${PYTHON_PKG_DEP}" +} + +# @FUNCTION: python_fix_shebang +# @USAGE: [-f|--force] [-q|--quiet] ... +# @DESCRIPTION: +# Replace the shebang in Python scripts with the current Python +# implementation (EPYTHON). If a directory is passed, works recursively +# on all Python scripts. +# +# Only files having a 'python*' shebang will be modified. Files with +# other shebang will either be skipped when working recursively +# on a directory or treated as error when specified explicitly. +# +# Shebangs matching explicitly current Python version will be left +# unmodified. Shebangs requesting another Python version will be treated +# as fatal error, unless --force is given. +# +# --force causes the function to replace even shebangs that require +# incompatible Python version. --quiet causes the function not to list +# modified files verbosely. +python_fix_shebang() { + debug-print-function ${FUNCNAME} "${@}" + + [[ ${EPYTHON} ]] || die "${FUNCNAME}: EPYTHON unset (pkg_setup not called?)" + + local force quiet + while [[ ${@} ]]; do + case "${1}" in + -f|--force) force=1; shift;; + -q|--quiet) quiet=1; shift;; + --) shift; break;; + *) break;; + esac + done + + [[ ${1} ]] || die "${FUNCNAME}: no paths given" + + local path f + for path; do + local any_correct any_fixed is_recursive + + [[ -d ${path} ]] && is_recursive=1 + + while IFS= read -r -d '' f; do + local shebang i + local error= from= + + # note: we can't ||die here since read will fail if file + # has no newline characters + IFS= read -r shebang <"${f}" + + # First, check if it's shebang at all... + if [[ ${shebang} == '#!'* ]]; then + local split_shebang=() + read -r -a split_shebang <<<${shebang} || die + + # Match left-to-right in a loop, to avoid matching random + # repetitions like 'python2.7 python2'. + for i in "${split_shebang[@]}"; do + case "${i}" in + *"${EPYTHON}") + debug-print "${FUNCNAME}: in file ${f#${D%/}}" + debug-print "${FUNCNAME}: shebang matches EPYTHON: ${shebang}" + + # Nothing to do, move along. + any_correct=1 + from=${EPYTHON} + break + ;; + *python|*python[23]) + debug-print "${FUNCNAME}: in file ${f#${D%/}}" + debug-print "${FUNCNAME}: rewriting shebang: ${shebang}" + + if [[ ${i} == *python2 ]]; then + from=python2 + if [[ ! ${force} ]]; then + python_is_python3 "${EPYTHON}" && error=1 + fi + elif [[ ${i} == *python3 ]]; then + from=python3 + if [[ ! ${force} ]]; then + python_is_python3 "${EPYTHON}" || error=1 + fi + else + from=python + fi + break + ;; + *python[23].[0123456789]|*pypy|*pypy3|*jython[23].[0123456789]) + # Explicit mismatch. + if [[ ! ${force} ]]; then + error=1 + else + case "${i}" in + *python[23].[0123456789]) + from="python[23].[0123456789]";; + *pypy) + from="pypy";; + *pypy3) + from="pypy3";; + *jython[23].[0123456789]) + from="jython[23].[0123456789]";; + *) + die "${FUNCNAME}: internal error in 2nd pattern match";; + esac + fi + break + ;; + esac + done + fi + + if [[ ! ${error} && ! ${from} ]]; then + # Non-Python shebang. Allowed in recursive mode, + # disallowed when specifying file explicitly. + [[ ${is_recursive} ]] && continue + error=1 + fi + + if [[ ! ${quiet} ]]; then + einfo "Fixing shebang in ${f#${D%/}}." + fi + + if [[ ! ${error} ]]; then + # We either want to match ${from} followed by space + # or at end-of-string. + if [[ ${shebang} == *${from}" "* ]]; then + sed -i -e "1s:${from} :${EPYTHON} :" "${f}" || die + else + sed -i -e "1s:${from}$:${EPYTHON}:" "${f}" || die + fi + any_fixed=1 + else + eerror "The file has incompatible shebang:" + eerror " file: ${f#${D%/}}" + eerror " current shebang: ${shebang}" + eerror " requested impl: ${EPYTHON}" + die "${FUNCNAME}: conversion of incompatible shebang requested" + fi + done < <(find -H "${path}" -type f -print0 || die) + + if [[ ! ${any_fixed} ]]; then + local cmd=eerror + [[ ${EAPI} == 5 ]] && cmd=eqawarn + + "${cmd}" "QA warning: ${FUNCNAME}, ${path#${D%/}} did not match any fixable files." + if [[ ${any_correct} ]]; then + "${cmd}" "All files have ${EPYTHON} shebang already." + else + "${cmd}" "There are no Python files in specified directory." + fi + + [[ ${cmd} == eerror ]] && die "${FUNCNAME} did not match any fixable files (QA warning fatal in EAPI ${EAPI})" + fi + done +} + +# @FUNCTION: _python_check_locale_sanity +# @USAGE: +# @RETURN: 0 if sane, 1 otherwise +# @INTERNAL +# @DESCRIPTION: +# Check whether the specified locale sanely maps between lowercase +# and uppercase ASCII characters. +_python_check_locale_sanity() { + local -x LC_ALL=${1} + local IFS= + + local lc=( {a..z} ) + local uc=( {A..Z} ) + local input="${lc[*]}${uc[*]}" + + local output=$(tr '[:lower:][:upper:]' '[:upper:][:lower:]' <<<"${input}") + [[ ${output} == "${uc[*]}${lc[*]}" ]] +} + +# @FUNCTION: python_export_utf8_locale +# @RETURN: 0 on success, 1 on failure. +# @DESCRIPTION: +# Attempts to export a usable UTF-8 locale in the LC_CTYPE variable. Does +# nothing if LC_ALL is defined, or if the current locale uses a UTF-8 charmap. +# This may be used to work around the quirky open() behavior of python3. +python_export_utf8_locale() { + debug-print-function ${FUNCNAME} "${@}" + + # If the locale program isn't available, just return. + type locale >/dev/null || return 0 + + if [[ $(locale charmap) != UTF-8 ]]; then + # Try English first, then everything else. + local lang locales="C.UTF-8 en_US.UTF-8 en_GB.UTF-8 $(locale -a)" + + for lang in ${locales}; do + if [[ $(LC_ALL=${lang} locale charmap 2>/dev/null) == UTF-8 ]]; then + if _python_check_locale_sanity "${lang}"; then + export LC_CTYPE=${lang} + if [[ -n ${LC_ALL} ]]; then + export LC_NUMERIC=${LC_ALL} + export LC_TIME=${LC_ALL} + export LC_COLLATE=${LC_ALL} + export LC_MONETARY=${LC_ALL} + export LC_MESSAGES=${LC_ALL} + export LC_PAPER=${LC_ALL} + export LC_NAME=${LC_ALL} + export LC_ADDRESS=${LC_ALL} + export LC_TELEPHONE=${LC_ALL} + export LC_MEASUREMENT=${LC_ALL} + export LC_IDENTIFICATION=${LC_ALL} + export LC_ALL= + fi + return 0 + fi + fi + done + + ewarn "Could not find a UTF-8 locale. This may trigger build failures in" + ewarn "some python packages. Please ensure that a UTF-8 locale is listed in" + ewarn "/etc/locale.gen and run locale-gen." + return 1 + fi + + return 0 +} + +# @FUNCTION: build_sphinx +# @USAGE: +# @DESCRIPTION: +# Build HTML documentation using dev-python/sphinx in the specified +# . Takes care of disabling Intersphinx and appending +# to HTML_DOCS. +# +# If is relative to the current directory, care needs +# to be taken to run einstalldocs from the same directory +# (usually ${S}). +build_sphinx() { + debug-print-function ${FUNCNAME} "${@}" + [[ ${#} -eq 1 ]] || die "${FUNCNAME} takes 1 arg: " + + local dir=${1} + + sed -i -e 's:^intersphinx_mapping:disabled_&:' \ + "${dir}"/conf.py || die + # not all packages include the Makefile in pypi tarball + sphinx-build -b html -d "${dir}"/_build/doctrees "${dir}" \ + "${dir}"/_build/html || die + + HTML_DOCS+=( "${dir}/_build/html/." ) +} + +# -- python.eclass functions -- + +_python_check_dead_variables() { + local v + + for v in PYTHON_DEPEND PYTHON_USE_WITH{,_OR,_OPT} {RESTRICT,SUPPORT}_PYTHON_ABIS + do + if [[ ${!v} ]]; then + die "${v} is invalid for python2 suite, please take a look @ https://wiki.gentoo.org/wiki/Project:Python/Python.eclass_conversion#Ebuild_head" + fi + done + + for v in PYTHON_{CPPFLAGS,CFLAGS,CXXFLAGS,LDFLAGS} + do + if [[ ${!v} ]]; then + die "${v} is invalid for python2 suite, please take a look @ https://wiki.gentoo.org/wiki/Project:Python/Python.eclass_conversion#PYTHON_CFLAGS" + fi + done + + for v in PYTHON_TESTS_RESTRICTED_ABIS PYTHON_EXPORT_PHASE_FUNCTIONS \ + PYTHON_VERSIONED_{SCRIPTS,EXECUTABLES} PYTHON_NONVERSIONED_EXECUTABLES + do + if [[ ${!v} ]]; then + die "${v} is invalid for python2 suite" + fi + done + + for v in DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES DISTUTILS_SETUP_FILES \ + DISTUTILS_GLOBAL_OPTIONS DISTUTILS_SRC_TEST PYTHON_MODNAME + do + if [[ ${!v} ]]; then + die "${v} is invalid for distutils2, please take a look @ https://wiki.gentoo.org/wiki/Project:Python/Python.eclass_conversion#${v}" + fi + done + + if [[ ${DISTUTILS_DISABLE_TEST_DEPENDENCY} ]]; then + die "${v} is invalid for distutils2, please take a look @ https://wiki.gentoo.org/wiki/Project:Python/Python.eclass_conversion#DISTUTILS_SRC_TEST" + fi + + # python.eclass::progress + for v in PYTHON_BDEPEND PYTHON_MULTIPLE_ABIS PYTHON_ABI_TYPE \ + PYTHON_RESTRICTED_ABIS PYTHON_TESTS_FAILURES_TOLERANT_ABIS \ + PYTHON_CFFI_MODULES_GENERATION_COMMANDS + do + if [[ ${!v} ]]; then + die "${v} is invalid for python2 suite" + fi + done +} + +python_pkg_setup() { + die "${FUNCNAME}() is invalid for python2 suite, please take a look @ https://wiki.gentoo.org/wiki/Project:Python/Python.eclass_conversion#pkg_setup" +} + +python_convert_shebangs() { + die "${FUNCNAME}() is invalid for python2 suite, please take a look @ https://wiki.gentoo.org/wiki/Project:Python/Python.eclass_conversion#python_convert_shebangs" +} + +python_clean_py-compile_files() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_clean_installation_image() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_execute_function() { + die "${FUNCNAME}() is invalid for python2 suite, please take a look @ https://wiki.gentoo.org/wiki/Project:Python/Python.eclass_conversion#python_execute_function" +} + +python_generate_wrapper_scripts() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_merge_intermediate_installation_images() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_set_active_version() { + die "${FUNCNAME}() is invalid for python2 suite, please take a look @ https://wiki.gentoo.org/wiki/Project:Python/Python.eclass_conversion#pkg_setup" +} + +python_need_rebuild() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +PYTHON() { + die "${FUNCNAME}() is invalid for python2 suite, please take a look @ https://wiki.gentoo.org/wiki/Project:Python/Python.eclass_conversion#.24.28PYTHON.29.2C_.24.7BEPYTHON.7D" +} + +python_get_implementation() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_get_implementational_package() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_get_libdir() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_get_library() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_get_version() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_get_implementation_and_version() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_execute_nosetests() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_execute_py.test() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_execute_trial() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_enable_pyc() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_disable_pyc() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_mod_optimize() { + die "${FUNCNAME}() is invalid for python2 suite, please take a look @ https://wiki.gentoo.org/wiki/Project:Python/Python.eclass_conversion#Python_byte-code_compilation" +} + +python_mod_cleanup() { + die "${FUNCNAME}() is invalid for python2 suite, please take a look @ https://wiki.gentoo.org/wiki/Project:Python/Python.eclass_conversion#Python_byte-code_compilation" +} + +# python.eclass::progress + +python_abi_depend() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_install_executables() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_get_extension_module_suffix() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_byte-compile_modules() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_clean_byte-compiled_modules() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +python_generate_cffi_modules() { + die "${FUNCNAME}() is invalid for python2 suite" +} + +_PYTHON_UTILS_R1=1 +fi diff --git a/eclass/python2.eclass b/eclass/python2.eclass new file mode 100644 index 000000000..d378d101d --- /dev/null +++ b/eclass/python2.eclass @@ -0,0 +1,868 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# @ECLASS: python2.eclass +# @MAINTAINER: +# Python team +# @AUTHOR: +# Author: Michał Górny +# Based on work of: Krzysztof Pawlik +# @SUPPORTED_EAPIS: 5 6 7 +# @BLURB: A common, simple eclass for Python packages. +# @DESCRIPTION: +# A common eclass providing helper functions to build and install +# packages supporting being installed for multiple Python +# implementations. +# +# This eclass sets correct IUSE. Modification of REQUIRED_USE has to +# be done by the author of the ebuild (but PYTHON_REQUIRED_USE is +# provided for convenience, see below). python2 exports PYTHON_DEPS +# and PYTHON_USEDEP so you can create correct dependencies for your +# package easily. It also provides methods to easily run a command for +# each enabled Python implementation and duplicate the sources for them. +# +# Please note that python2 will always inherit python2-utils as +# well. Thus, all the functions defined there can be used +# in the packages using python2, and there is no need ever to inherit +# both. +# +# For more information, please see the Python Guide: +# https://dev.gentoo.org/~mgorny/python-guide/ + +case "${EAPI:-0}" in + 0|1|2|3|4) + die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" + ;; + 5|6|7) + # EAPI=5 is required for sane USE_EXPAND dependencies + ;; + *) + die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" + ;; +esac + +if [[ ! ${_PYTHON_R1} ]]; then + +if [[ ${_PYTHON_SINGLE_R1} ]]; then + die 'python2.eclass can not be used with python-single-r1.eclass.' +elif [[ ${_PYTHON_ANY_R1} ]]; then + die 'python2.eclass can not be used with python-any-r1.eclass.' +fi + +[[ ${EAPI} == [45] ]] && inherit eutils +inherit multibuild python2-utils + +fi + +# @ECLASS-VARIABLE: PYTHON_COMPAT +# @REQUIRED +# @DESCRIPTION: +# This variable contains a list of Python implementations the package +# supports. It must be set before the `inherit' call. It has to be +# an array. +# +# Example: +# @CODE +# PYTHON_COMPAT=( python2_7 python3_3 python3_4 ) +# @CODE +# +# Please note that you can also use bash brace expansion if you like: +# @CODE +# PYTHON_COMPAT=( python2_7 python3_{3,4} ) +# @CODE + +# @ECLASS-VARIABLE: PYTHON_COMPAT_OVERRIDE +# @USER_VARIABLE +# @DEFAULT_UNSET +# @DESCRIPTION: +# This variable can be used when working with ebuilds to override +# the in-ebuild PYTHON_COMPAT. It is a string listing all +# the implementations which package will be built for. It need be +# specified in the calling environment, and not in ebuilds. +# +# It should be noted that in order to preserve metadata immutability, +# PYTHON_COMPAT_OVERRIDE does not affect IUSE nor dependencies. +# The state of PYTHON_TARGETS is ignored, and all the implementations +# in PYTHON_COMPAT_OVERRIDE are built. Dependencies need to be satisfied +# manually. +# +# Example: +# @CODE +# PYTHON_COMPAT_OVERRIDE='pypy python3_3' emerge -1v dev-python/foo +# @CODE + +# @ECLASS-VARIABLE: PYTHON_REQ_USE +# @DEFAULT_UNSET +# @DESCRIPTION: +# The list of USEflags required to be enabled on the chosen Python +# implementations, formed as a USE-dependency string. It should be valid +# for all implementations in PYTHON_COMPAT, so it may be necessary to +# use USE defaults. +# +# This should be set before calling `inherit'. +# +# Example: +# @CODE +# PYTHON_REQ_USE="gdbm,ncurses(-)?" +# @CODE +# +# It will cause the Python dependencies to look like: +# @CODE +# python_targets_pythonX_Y? ( dev-lang/python:X.Y[gdbm,ncurses(-)?] ) +# @CODE + +# @ECLASS-VARIABLE: PYTHON_DEPS +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# This is an eclass-generated Python dependency string for all +# implementations listed in PYTHON_COMPAT. +# +# Example use: +# @CODE +# RDEPEND="${PYTHON_DEPS} +# dev-foo/mydep" +# DEPEND="${RDEPEND}" +# @CODE +# +# Example value: +# @CODE +# dev-lang/python-exec:= +# python_targets_python2_7? ( dev-lang/python:2.7[gdbm] ) +# python_targets_pypy? ( dev-python/pypy[gdbm] ) +# @CODE + +# @ECLASS-VARIABLE: PYTHON_USEDEP +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# This is an eclass-generated USE-dependency string which can be used to +# depend on another Python package being built for the same Python +# implementations. +# +# The generate USE-flag list is compatible with packages using python2 +# and python-distutils-ng eclasses. It must not be used on packages +# using python.eclass. +# +# Example use: +# @CODE +# RDEPEND="dev-python/foo[${PYTHON_USEDEP}]" +# @CODE +# +# Example value: +# @CODE +# python_targets_python2_7(-)?,python_targets_python3_4(-)? +# @CODE + +# @ECLASS-VARIABLE: PYTHON_SINGLE_USEDEP +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# An eclass-generated USE-dependency string for the currently tested +# implementation. It is set locally for python_check_deps() call. +# +# The generated USE-flag list is compatible with packages using +# python-single-r1 eclass. For python2 dependencies, +# use PYTHON_USEDEP. +# +# Example use: +# @CODE +# python_check_deps() { +# has_version "dev-python/bar[${PYTHON_SINGLE_USEDEP}]" +# } +# @CODE +# +# Example value: +# @CODE +# python_single_target_python3_7(-) +# @CODE + +# @ECLASS-VARIABLE: PYTHON_REQUIRED_USE +# @OUTPUT_VARIABLE +# @DESCRIPTION: +# This is an eclass-generated required-use expression which ensures at +# least one Python implementation has been enabled. +# +# This expression should be utilized in an ebuild by including it in +# REQUIRED_USE, optionally behind a use flag. +# +# Example use: +# @CODE +# REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" +# @CODE +# +# Example value: +# @CODE +# || ( python_targets_python2_7 python_targets_python3_4 ) +# @CODE + +_python_set_globals() { + local deps i PYTHON_PKG_DEP + + _python_set_impls + + for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do + _python_export "${i}" PYTHON_PKG_DEP + deps+="python_targets_${i}? ( ${PYTHON_PKG_DEP} ) " + done + + local flags=( "${_PYTHON_SUPPORTED_IMPLS[@]/#/python_targets_}" ) + local optflags=${flags[@]/%/(-)?} + + # A nice QA trick here. Since a python-single-r1 package has to have + # at least one PYTHON_SINGLE_TARGET enabled (REQUIRED_USE), + # the following check will always fail on those packages. Therefore, + # it should prevent developers from mistakenly depending on packages + # not supporting multiple Python implementations. + + local flags_st=( "${_PYTHON_SUPPORTED_IMPLS[@]/#/-python_single_target_}" ) + optflags+=,${flags_st[@]/%/(-)} + local requse="|| ( ${flags[*]} )" + local usedep=${optflags// /,} + + # 1) well, python-exec would suffice as an RDEP + # but no point in making this overcomplex, BDEP doesn't hurt anyone + # 2) python-exec should be built with all targets forced anyway + # but if new targets were added, we may need to force a rebuild + deps+=">=dev-lang/python-exec-2:=[${usedep}]" + + if [[ ${PYTHON_DEPS+1} ]]; then + # IUSE is magical, so we can't really check it + # (but we verify PYTHON_COMPAT already) + + if [[ ${PYTHON_DEPS} != "${deps}" ]]; then + eerror "PYTHON_DEPS have changed between inherits (PYTHON_REQ_USE?)!" + eerror "Before: ${PYTHON_DEPS}" + eerror "Now : ${deps}" + die "PYTHON_DEPS integrity check failed" + fi + + # these two are formality -- they depend on PYTHON_COMPAT only + if [[ ${PYTHON_REQUIRED_USE} != ${requse} ]]; then + eerror "PYTHON_REQUIRED_USE have changed between inherits!" + eerror "Before: ${PYTHON_REQUIRED_USE}" + eerror "Now : ${requse}" + die "PYTHON_REQUIRED_USE integrity check failed" + fi + + if [[ ${PYTHON_USEDEP} != "${usedep}" ]]; then + eerror "PYTHON_USEDEP have changed between inherits!" + eerror "Before: ${PYTHON_USEDEP}" + eerror "Now : ${usedep}" + die "PYTHON_USEDEP integrity check failed" + fi + else + IUSE=${flags[*]} + + PYTHON_DEPS=${deps} + PYTHON_REQUIRED_USE=${requse} + PYTHON_USEDEP=${usedep} + readonly PYTHON_DEPS PYTHON_REQUIRED_USE + fi +} +_python_set_globals +unset -f _python_set_globals + +if [[ ! ${_PYTHON_R1} ]]; then + +# @FUNCTION: _python_validate_useflags +# @INTERNAL +# @DESCRIPTION: +# Enforce the proper setting of PYTHON_TARGETS, if PYTHON_COMPAT_OVERRIDE +# is not in effect. If it is, just warn that the flags will be ignored. +_python_validate_useflags() { + debug-print-function ${FUNCNAME} "${@}" + + if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then + if [[ ! ${_PYTHON_COMPAT_OVERRIDE_WARNED} ]]; then + ewarn "WARNING: PYTHON_COMPAT_OVERRIDE in effect. The following Python" + ewarn "implementations will be enabled:" + ewarn + ewarn " ${PYTHON_COMPAT_OVERRIDE}" + ewarn + ewarn "Dependencies won't be satisfied, and PYTHON_TARGETS will be ignored." + _PYTHON_COMPAT_OVERRIDE_WARNED=1 + fi + # we do not use flags with PCO + return + fi + + local i + + for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do + use "python_targets_${i}" && return 0 + done + + eerror "No Python implementation selected for the build. Please add one" + eerror "of the following values to your PYTHON_TARGETS (in make.conf):" + eerror + eerror "${PYTHON_COMPAT[@]}" + echo + die "No supported Python implementation in PYTHON_TARGETS." +} + +# @FUNCTION: _python_gen_usedep +# @USAGE: [...] +# @INTERNAL +# @DESCRIPTION: +# Output a USE dependency string for Python implementations which +# are both in PYTHON_COMPAT and match any of the patterns passed +# as parameters to the function. +# +# The patterns can be either fnmatch-style patterns (matched via bash +# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate +# appropriately all enabled Python 2/3 implementations (alike +# python_is_python3). Remember to escape or quote the fnmatch patterns +# to prevent accidental shell filename expansion. +# +# This is an internal function used to implement python_gen_cond_dep +# and deprecated python_gen_usedep. +_python_gen_usedep() { + debug-print-function ${FUNCNAME} "${@}" + + local impl matches=() + + _python_verify_patterns "${@}" + for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do + if _python_impl_matches "${impl}" "${@}"; then + matches+=( + "python_targets_${impl}(-)?" + "-python_single_target_${impl}(-)" + ) + fi + done + + [[ ${matches[@]} ]] || die "No supported implementations match python_gen_usedep patterns: ${@}" + + local out=${matches[@]} + echo "${out// /,}" +} + +# @FUNCTION: python_gen_usedep +# @USAGE: [...] +# @DESCRIPTION: +# DEPRECATED. Please use python_gen_cond_dep instead. +# +# Output a USE dependency string for Python implementations which +# are both in PYTHON_COMPAT and match any of the patterns passed +# as parameters to the function. +# +# The patterns can be either fnmatch-style patterns (matched via bash +# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate +# appropriately all enabled Python 2/3 implementations (alike +# python_is_python3). Remember to escape or quote the fnmatch patterns +# to prevent accidental shell filename expansion. +# +# When all implementations are requested, please use ${PYTHON_USEDEP} +# instead. Please also remember to set an appropriate REQUIRED_USE +# to avoid ineffective USE flags. +# +# Example: +# @CODE +# PYTHON_COMPAT=( python{2_7,3_4} ) +# DEPEND="doc? ( dev-python/epydoc[$(python_gen_usedep 'python2*')] )" +# @CODE +# +# It will cause the dependency to look like: +# @CODE +# DEPEND="doc? ( dev-python/epydoc[python_targets_python2_7?] )" +# @CODE +python_gen_usedep() { + debug-print-function ${FUNCNAME} "${@}" + + # output only once, during some reasonable phase + # (avoid spamming cache regen runs) + if [[ ${EBUILD_PHASE} == setup ]]; then + eqawarn "python_gen_usedep() is deprecated. Please use python_gen_cond_dep instead." + fi + _python_gen_usedep "${@}" +} + +# @FUNCTION: python_gen_useflags +# @USAGE: [...] +# @DESCRIPTION: +# Output a list of USE flags for Python implementations which +# are both in PYTHON_COMPAT and match any of the patterns passed +# as parameters to the function. +# +# The patterns can be either fnmatch-style patterns (matched via bash +# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate +# appropriately all enabled Python 2/3 implementations (alike +# python_is_python3). Remember to escape or quote the fnmatch patterns +# to prevent accidental shell filename expansion. +# +# Example: +# @CODE +# PYTHON_COMPAT=( python{2_7,3_4} ) +# REQUIRED_USE="doc? ( || ( $(python_gen_useflags python2*) ) )" +# @CODE +# +# It will cause the variable to look like: +# @CODE +# REQUIRED_USE="doc? ( || ( python_targets_python2_7 ) )" +# @CODE +python_gen_useflags() { + debug-print-function ${FUNCNAME} "${@}" + + local impl matches=() + + _python_verify_patterns "${@}" + for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do + if _python_impl_matches "${impl}" "${@}"; then + matches+=( "python_targets_${impl}" ) + fi + done + + echo "${matches[@]}" +} + +# @FUNCTION: python_gen_cond_dep +# @USAGE: [...] +# @DESCRIPTION: +# Output a list of -ies made conditional to USE flags +# of Python implementations which are both in PYTHON_COMPAT and match +# any of the patterns passed as the remaining parameters. +# +# The patterns can be either fnmatch-style patterns (matched via bash +# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate +# appropriately all enabled Python 2/3 implementations (alike +# python_is_python3). Remember to escape or quote the fnmatch patterns +# to prevent accidental shell filename expansion. +# +# In order to enforce USE constraints on the packages, verbatim +# '${PYTHON_USEDEP}' (quoted!) may be placed in the dependency +# specification. It will get expanded within the function into a proper +# USE dependency string. +# +# Example: +# @CODE +# PYTHON_COMPAT=( python{2_7,3_{3,4}} pypy ) +# RDEPEND="$(python_gen_cond_dep \ +# 'dev-python/unittest2[${PYTHON_USEDEP}]' python2_7 pypy )" +# @CODE +# +# It will cause the variable to look like: +# @CODE +# RDEPEND="python_targets_python2_7? ( +# dev-python/unittest2[python_targets_python2_7?] ) +# python_targets_pypy? ( +# dev-python/unittest2[python_targets_pypy?] )" +# @CODE +python_gen_cond_dep() { + debug-print-function ${FUNCNAME} "${@}" + + local impl matches=() + local dep=${1} + shift + + _python_verify_patterns "${@}" + for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do + if _python_impl_matches "${impl}" "${@}"; then + # substitute ${PYTHON_USEDEP} if used + # (since python_gen_usedep() will not return ${PYTHON_USEDEP} + # the code is run at most once) + if [[ ${dep} == *'${PYTHON_USEDEP}'* ]]; then + local usedep=$(_python_gen_usedep "${@}") + dep=${dep//\$\{PYTHON_USEDEP\}/${usedep}} + fi + + matches+=( "python_targets_${impl}? ( ${dep} )" ) + fi + done + + echo "${matches[@]}" +} + +# @FUNCTION: python_gen_impl_dep +# @USAGE: [ [...]] +# @DESCRIPTION: +# Output a dependency on Python implementations with the specified USE +# dependency string appended, or no USE dependency string if called +# without the argument (or with empty argument). If any implementation +# patterns are passed, the output dependencies will be generated only +# for the implementations matching them. +# +# The patterns can be either fnmatch-style patterns (matched via bash +# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate +# appropriately all enabled Python 2/3 implementations (alike +# python_is_python3). Remember to escape or quote the fnmatch patterns +# to prevent accidental shell filename expansion. +# +# Use this function when you need to request different USE flags +# on the Python interpreter depending on package's USE flags. If you +# only need a single set of interpreter USE flags, just set +# PYTHON_REQ_USE and use ${PYTHON_DEPS} globally. +# +# Example: +# @CODE +# PYTHON_COMPAT=( python{2_7,3_{3,4}} pypy ) +# RDEPEND="foo? ( $(python_gen_impl_dep 'xml(+)') )" +# @CODE +# +# It will cause the variable to look like: +# @CODE +# RDEPEND="foo? ( +# python_targets_python2_7? ( +# dev-lang/python:2.7[xml(+)] ) +# python_targets_pypy? ( +# dev-python/pypy[xml(+)] ) )" +# @CODE +python_gen_impl_dep() { + debug-print-function ${FUNCNAME} "${@}" + + local impl matches=() + local PYTHON_REQ_USE=${1} + shift + + _python_verify_patterns "${@}" + for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do + if _python_impl_matches "${impl}" "${@}"; then + local PYTHON_PKG_DEP + _python_export "${impl}" PYTHON_PKG_DEP + matches+=( "python_targets_${impl}? ( ${PYTHON_PKG_DEP} )" ) + fi + done + + echo "${matches[@]}" +} + +# @FUNCTION: python_gen_any_dep +# @USAGE: [...] +# @DESCRIPTION: +# Generate an any-of dependency that enforces a version match between +# the Python interpreter and Python packages. needs +# to list one or more dependencies with verbatim '${PYTHON_USEDEP}' +# or '${PYTHON_SINGLE_USEDEP}' references (quoted!) that will get +# expanded inside the function. Optionally, patterns may be specified +# to restrict the dependency to a subset of Python implementations +# supported by the ebuild. +# +# The patterns can be either fnmatch-style patterns (matched via bash +# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate +# appropriately all enabled Python 2/3 implementations (alike +# python_is_python3). Remember to escape or quote the fnmatch patterns +# to prevent accidental shell filename expansion. +# +# This should be used along with an appropriate python_check_deps() +# that checks which of the any-of blocks were matched, and python_setup +# call that enables use of the matched implementation. +# +# Example use: +# @CODE +# DEPEND="$(python_gen_any_dep ' +# dev-python/foo[${PYTHON_SINGLE_USEDEP}] +# || ( dev-python/bar[${PYTHON_USEDEP}] +# dev-python/baz[${PYTHON_USEDEP}] )' -2)" +# +# python_check_deps() { +# has_version "dev-python/foo[${PYTHON_SINGLE_USEDEP}]" \ +# && { has_version "dev-python/bar[${PYTHON_USEDEP}]" \ +# || has_version "dev-python/baz[${PYTHON_USEDEP}]"; } +# } +# +# src_compile() { +# python_foreach_impl usual_code +# +# # some common post-build task that requires Python 2 +# python_setup -2 +# emake frobnicate +# } +# @CODE +# +# Example value: +# @CODE +# || ( +# ( +# dev-lang/python:3.7 +# dev-python/foo[python_single_target_python3_7(-)] +# || ( dev-python/bar[python_targets_python3_7(-),-python_single_target_python3_7(-)] +# dev-python/baz[python_targets_python3_7(-),-python_single_target_python3_7(-)] ) +# ) +# ( +# dev-lang/python:3.8 +# dev-python/foo[python_single_target_python3_8(-)] +# || ( dev-python/bar[python_targets_python3_8(-),-python_single_target_python3_8(-)] +# dev-python/baz[python_targets_python3_8(-),-python_single_target_python3_8(-)] ) +# ) +# ) +# @CODE +python_gen_any_dep() { + debug-print-function ${FUNCNAME} "${@}" + + local depstr=${1} + [[ ${depstr} ]] || die "No dependency string provided" + shift + + local i PYTHON_PKG_DEP out= + _python_verify_patterns "${@}" + for i in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do + if _python_impl_matches "${i}" "${@}"; then + local PYTHON_USEDEP="python_targets_${i}(-),-python_single_target_${i}(-)" + local PYTHON_SINGLE_USEDEP="python_single_target_${i}(-)" + _python_export "${i}" PYTHON_PKG_DEP + + local i_depstr=${depstr//\$\{PYTHON_USEDEP\}/${PYTHON_USEDEP}} + i_depstr=${i_depstr//\$\{PYTHON_SINGLE_USEDEP\}/${PYTHON_SINGLE_USEDEP}} + # note: need to strip '=' slot operator for || deps + out="( ${PYTHON_PKG_DEP/:0=/:0} ${i_depstr} ) ${out}" + fi + done + echo "|| ( ${out})" +} + +# @ECLASS-VARIABLE: BUILD_DIR +# @OUTPUT_VARIABLE +# @DEFAULT_UNSET +# @DESCRIPTION: +# The current build directory. In global scope, it is supposed to +# contain an initial build directory; if unset, it defaults to ${S}. +# +# In functions run by python_foreach_impl(), the BUILD_DIR is locally +# set to an implementation-specific build directory. That path is +# created through appending a hyphen and the implementation name +# to the final component of the initial BUILD_DIR. +# +# Example value: +# @CODE +# ${WORKDIR}/foo-1.3-python2_7 +# @CODE + +# @FUNCTION: python_copy_sources +# @DESCRIPTION: +# Create a single copy of the package sources for each enabled Python +# implementation. +# +# The sources are always copied from initial BUILD_DIR (or S if unset) +# to implementation-specific build directory matching BUILD_DIR used by +# python_foreach_abi(). +python_copy_sources() { + debug-print-function ${FUNCNAME} "${@}" + + local MULTIBUILD_VARIANTS + _python_obtain_impls + + multibuild_copy_sources +} + +# @FUNCTION: _python_obtain_impls +# @INTERNAL +# @DESCRIPTION: +# Set up the enabled implementation list. +_python_obtain_impls() { + _python_validate_useflags + + if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then + MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} ) + return + fi + + MULTIBUILD_VARIANTS=() + + local impl + for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do + has "${impl}" "${PYTHON_COMPAT[@]}" && \ + use "python_targets_${impl}" && MULTIBUILD_VARIANTS+=( "${impl}" ) + done +} + +# @FUNCTION: _python_multibuild_wrapper +# @USAGE: [...] +# @INTERNAL +# @DESCRIPTION: +# Initialize the environment for Python implementation selected +# for multibuild. +_python_multibuild_wrapper() { + debug-print-function ${FUNCNAME} "${@}" + + local -x EPYTHON PYTHON + local -x PATH=${PATH} PKG_CONFIG_PATH=${PKG_CONFIG_PATH} + _python_export "${MULTIBUILD_VARIANT}" EPYTHON PYTHON + _python_wrapper_setup + + "${@}" +} + +# @FUNCTION: python_foreach_impl +# @USAGE: [...] +# @DESCRIPTION: +# Run the given command for each of the enabled Python implementations. +# If additional parameters are passed, they will be passed through +# to the command. +# +# The function will return 0 status if all invocations succeed. +# Otherwise, the return code from first failing invocation will +# be returned. +# +# For each command being run, EPYTHON, PYTHON and BUILD_DIR are set +# locally, and the former two are exported to the command environment. +python_foreach_impl() { + debug-print-function ${FUNCNAME} "${@}" + + local MULTIBUILD_VARIANTS + _python_obtain_impls + + multibuild_foreach_variant _python_multibuild_wrapper "${@}" +} + +# @FUNCTION: python_setup +# @USAGE: [...] +# @DESCRIPTION: +# Find the best (most preferred) Python implementation that is suitable +# for running common Python code. Set the Python build environment up +# for that implementation. This function has two modes of operation: +# pure and any-of dep. +# +# The pure mode is used if python_check_deps() function is not declared. +# In this case, an implementation is considered suitable if it is +# supported (in PYTHON_COMPAT), enabled (via USE flags) and matches +# at least one of the patterns passed (or '*' if no patterns passed). +# +# Implementation restrictions in the pure mode need to be accompanied +# by appropriate REQUIRED_USE constraints. Otherwise, the eclass may +# fail at build time due to unsatisfied dependencies. +# +# The any-of dep mode is used if python_check_deps() is declared. +# In this mode, an implementation is considered suitable if it is +# supported, matches at least one of the patterns and python_check_deps() +# has successful return code. USE flags are not considered. +# +# The python_check_deps() function in the any-of mode needs to be +# accompanied by appropriate any-of dependencies. +# +# The patterns can be either fnmatch-style patterns (matched via bash +# == operator against PYTHON_COMPAT values) or '-2' / '-3' to indicate +# appropriately all enabled Python 2/3 implementations (alike +# python_is_python3). Remember to escape or quote the fnmatch patterns +# to prevent accidental shell filename expansion. +# +# This function needs to be used when Python is being called outside +# of python_foreach_impl calls (e.g. for shared processes like doc +# building). python_foreach_impl sets up the build environment itself. +# +# Pure mode example: +# @CODE +# DEPEND="doc? ( dev-python/epydoc[$(python_gen_usedep 'python2*')] )" +# REQUIRED_USE="doc? ( $(python_gen_useflags 'python2*') )" +# +# src_compile() { +# #... +# if use doc; then +# python_setup 'python2*' +# make doc +# fi +# } +# @CODE +# +# Any-of mode example: +# @CODE +# DEPEND="doc? ( +# $(python_gen_any_dep 'dev-python/epydoc[${PYTHON_USEDEP}]' 'python2*') )" +# +# python_check_deps() { +# has_version "dev-python/epydoc[${PYTHON_USEDEP}]" +# } +# +# src_compile() { +# #... +# if use doc; then +# python_setup 'python2*' +# make doc +# fi +# } +# @CODE +python_setup() { + debug-print-function ${FUNCNAME} "${@}" + + _python_validate_useflags + local pycompat=( "${PYTHON_COMPAT[@]}" ) + if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then + pycompat=( ${PYTHON_COMPAT_OVERRIDE} ) + fi + + local has_check_deps + declare -f python_check_deps >/dev/null && has_check_deps=1 + + # (reverse iteration -- newest impl first) + local found + _python_verify_patterns "${@}" + for (( i = ${#_PYTHON_SUPPORTED_IMPLS[@]} - 1; i >= 0; i-- )); do + local impl=${_PYTHON_SUPPORTED_IMPLS[i]} + + # check PYTHON_COMPAT[_OVERRIDE] + has "${impl}" "${pycompat[@]}" || continue + + # match USE flags only if override is not in effect + # and python_check_deps() is not defined + if [[ ! ${PYTHON_COMPAT_OVERRIDE} && ! ${has_check_deps} ]]; then + use "python_targets_${impl}" || continue + fi + + # check patterns + _python_impl_matches "${impl}" "${@}" || continue + + _python_export "${impl}" EPYTHON PYTHON + + # if python_check_deps() is declared, switch into any-of mode + if [[ ${has_check_deps} ]]; then + # first check if the interpreter is installed + python_is_installed "${impl}" || continue + # then run python_check_deps + local PYTHON_USEDEP="python_targets_${impl}(-),-python_single_target_${impl}(-)" + local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)" + python_check_deps || continue + fi + + found=1 + break + done + + if [[ ! ${found} ]]; then + eerror "${FUNCNAME}: none of the enabled implementation matched the patterns." + eerror " patterns: ${@-'(*)'}" + eerror "Likely a REQUIRED_USE constraint (possibly USE-conditional) is missing." + eerror " suggested: || ( \$(python_gen_useflags ${@}) )" + eerror "(remember to quote all the patterns with '')" + die "${FUNCNAME}: no enabled implementation satisfy requirements" + fi + + _python_wrapper_setup + einfo "Using ${EPYTHON} in global scope" +} + +# @FUNCTION: python_replicate_script +# @USAGE: ... +# @DESCRIPTION: +# Copy the given script to variants for all enabled Python +# implementations, then replace it with a symlink to the wrapper. +# +# All specified files must start with a 'python' shebang. A file not +# having a matching shebang will be refused. +python_replicate_script() { + debug-print-function ${FUNCNAME} "${@}" + + _python_replicate_script() { + local _PYTHON_FIX_SHEBANG_QUIET=1 + + local PYTHON_SCRIPTDIR + _python_export PYTHON_SCRIPTDIR + + ( + exeopts -m 0755 + exeinto "${PYTHON_SCRIPTDIR#${EPREFIX}}" + doexe "${files[@]}" + ) + + python_fix_shebang -q \ + "${files[@]/*\//${D%/}/${PYTHON_SCRIPTDIR}/}" + } + + local files=( "${@}" ) + python_foreach_impl _python_replicate_script + unset -f _python_replicate_script + + # install the wrappers + local f + for f; do + _python_ln_rel "${ED%/}/usr/lib/python-exec/python-exec2" "${f}" || die + done +} + +_PYTHON_R1=1 +fi diff --git a/media-gfx/displaycal/displaycal-3.8.9.3-r3.ebuild b/media-gfx/displaycal/displaycal-3.8.9.3-r4.ebuild similarity index 96% rename from media-gfx/displaycal/displaycal-3.8.9.3-r3.ebuild rename to media-gfx/displaycal/displaycal-3.8.9.3-r4.ebuild index f1237358d..1477dd7a9 100644 --- a/media-gfx/displaycal/displaycal-3.8.9.3-r3.ebuild +++ b/media-gfx/displaycal/displaycal-3.8.9.3-r4.ebuild @@ -5,7 +5,7 @@ EAPI=6 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 gnome2-utils xdg +inherit distutils2 gnome2-utils xdg MY_PN="DisplayCAL" MY_P="${MY_PN}-${PV}" @@ -53,7 +53,7 @@ src_prepare() { sed -e 's/x\-world\/x\-vrml\;//g' \ -i misc/displaycal-vrml-to-x3d-converter.desktop || die - distutils-r1_src_prepare + distutils2_src_prepare } pkg_postinst() { diff --git a/net-libs/dslib/dslib-3.0-r3.ebuild b/net-libs/dslib/dslib-3.0-r3.ebuild index 92d3e2e71..03569ade1 100644 --- a/net-libs/dslib/dslib-3.0-r3.ebuild +++ b/net-libs/dslib/dslib-3.0-r3.ebuild @@ -6,7 +6,7 @@ EAPI=5 PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 +inherit distutils2 DESCRIPTION="Library to access Czech eGov system \"Datove schranky\"" HOMEPAGE="http://labs.nic.cz/page/969/datovka/" diff --git a/sys-apps/calculate-lib/calculate-lib-2.1.12-r6.ebuild b/sys-apps/calculate-lib/calculate-lib-2.1.12-r7.ebuild similarity index 97% rename from sys-apps/calculate-lib/calculate-lib-2.1.12-r6.ebuild rename to sys-apps/calculate-lib/calculate-lib-2.1.12-r7.ebuild index 7857c796b..0665ae86d 100644 --- a/sys-apps/calculate-lib/calculate-lib-2.1.12-r6.ebuild +++ b/sys-apps/calculate-lib/calculate-lib-2.1.12-r7.ebuild @@ -6,7 +6,7 @@ EAPI="5" PYTHON_COMPAT=( python2_7 ) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 eutils +inherit distutils2 eutils SRC_URI="ftp://ftp.calculate-linux.org/calculate/source/calculate2/${PN}/${P}.tar.bz2 http://mirror.yandex.ru/calculate/source/calculate2/${PN}/${P}.tar.bz2" diff --git a/sys-apps/calculate-lib/calculate-lib-2.1.9999.ebuild b/sys-apps/calculate-lib/calculate-lib-2.1.9999.ebuild index 2a3359b09..95c492e96 100644 --- a/sys-apps/calculate-lib/calculate-lib-2.1.9999.ebuild +++ b/sys-apps/calculate-lib/calculate-lib-2.1.9999.ebuild @@ -6,7 +6,7 @@ EAPI="5" PYTHON_COMPAT=(python2_7) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 git-r3 +inherit distutils2 git-r3 EGIT_REPO_URI="git://git.calculate-linux.org/calculate-2.1/calculate-lib.git" diff --git a/sys-apps/calculate-server/calculate-server-2.1.19-r15.ebuild b/sys-apps/calculate-server/calculate-server-2.1.19-r15.ebuild deleted file mode 100644 index e7cac30f2..000000000 --- a/sys-apps/calculate-server/calculate-server-2.1.19-r15.ebuild +++ /dev/null @@ -1,196 +0,0 @@ -# Copyright 1999-2012 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI="5" -PYTHON_COMPAT=(python{2_6,2_7}) - -DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 eutils - -SRC_URI="ftp://ftp.calculate-linux.org/calculate/source/calculate2/${PN}/${P}.tar.bz2 - http://mirror.yandex.ru/calculate/source/calculate2/${PN}/${P}.tar.bz2" - -DESCRIPTION="Configuration utility for Linux services" -HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2" -LICENSE="Apache-2.0" -SLOT="0" -KEYWORDS="amd64 x86" - -IUSE="calculate_nomail -calculate_nodhcp -calculate_noftp -calculate_nojabber -calculate_nonamed -calculate_nosamba -calculate_noproxy" - -DEPEND="=sys-apps/calculate-lib-2.1.12-r6 - dev-python/setuptools-python2[${PYTHON_USEDEP}] - >=net-nds/openldap-2.3[-minimal] - >=sys-auth/pam_ldap-180[ssl] - >=sys-auth/nss_ldap-239 - !=net-fs/samba-4[acl,client,cups,ldap,pam] - ) - ) - !calculate_nomail? ( - || ( =net-mail/dovecot-1.2.0[ldap,pam,ssl(+)] - ) - >=mail-filter/procmail-3.22 - dev-python/pymilter-python2 - >=mail-mta/postfix-2.2[ldap,pam,ssl,sasl,dovecot-sasl] - ) - !calculate_noftp? ( - || ( =net-ftp/proftpd-1.3.3[-acl,ident,ldap,ncurses,nls,pam,ssl,tcpd] - ) - ) - !calculate_nojabber? ( - || ( >=net-im/ejabberd-2.1.8[mod_pubsub,ldap] - >=net-im/ejabberd-16.04-r1[ldap] ) - || ( media-gfx/imagemagick - media-gfx/graphicsmagick ) - ) - !calculate_nonamed? ( >=net-dns/bind-9.6.1_p1[sdb-ldap] ) - !calculate_noproxy? ( >=net-proxy/squid-3.0.14[ldap,pam,ssl] ) - !calculate_nodhcp? ( >=net-misc/dhcp-3.1.2_p1 )" - -RDEPEND="${DEPEND}" - -PATCHES=( - "${FILESDIR}"/calculate-server-2.1.19-fix_sortmilter.patch - "${FILESDIR}"/calculate-server-2.1.19-fix_mailservice.patch - "${FILESDIR}"/calculate-server-2.1.19-fix_certgen.patch - "${FILESDIR}"/calculate-server-2.1.19-fix_jabber.patch - "${FILESDIR}"/calculate-server-2.1.19-fix_gendh.patch - "${FILESDIR}"/calculate-server-2.1.19-fix_samba4.11.patch -) - -pkg_postinst() { - if [ -d /var/calculate/server-data/mail/imap ] || \ - [ -d /var/calculate/server-data/samba/win/profiles ] || \ - [ -d /var/calculate/server-data/samba/unix/profiles ] || \ - [ -d /var/calculate/server-data/samba/win/netlogon ]; - then - ewarn "Data found in directories of previous version calculate-server" - fi - - if [ -d /var/calculate/server-data/mail/imap ]; - then - if ! [ -d /var/calculate/server-data/mail~ ]; - then - if mv /var/calculate/server-data/mail/imap \ - /var/calculate/server-data/mail~ && \ - rmdir /var/calculate/server-data/mail && \ - mv /var/calculate/server-data/mail~ \ - /var/calculate/server-data/mail; - then - ewarn - ewarn "Data from /var/calculate/server-data/mail/imap" - ewarn "was moved to /var/calculate/server-data/mail" - MAILUPDATE="TRUE" - fi - fi - if ! [ "${MAILUPDATE}" == "TRUE" ]; - then - eerror "Cannot move /var/calculate/server-data/mail/imap" - eerror "Please manualy move /var/calculate/server-data/mail/imap" - eerror "to /var/calculate/server-data/mail" - fi - fi - - if [ -d /var/calculate/server-data/samba/win/profiles ]; - then - SAMBAUPDATE="" - if ! [ -d /var/calculate/server-data/samba/profiles/win ]; - then - if mkdir -p /var/calculate/server-data/samba/profiles && \ - mv /var/calculate/server-data/samba/win/profiles \ - /var/calculate/server-data/samba/profiles/win; - then - ewarn - ewarn "Data from /var/calculate/server-data/samba/win/profiles" - ewarn "was moved to /var/calculate/server-data/samba/profiles/win" - SAMBAUPDATE="TRUE" - fi - fi - if ! [ "${SAMBAUPDATE}" == "TRUE" ]; - then - eerror "Cannot move /var/calculate/server-data/samba/win/profiles" - eerror "Please manualy move " - eerror "/var/calculate/server-data/samba/win/profiles" - eerror "to /var/calculate/server-data/samba/profiles/win" - fi - fi - - if [ -d /var/calculate/server-data/samba/unix/profiles ]; \ - then - SAMBAUPDATE="" - if ! [ -d /var/calculate/server-data/samba/profiles/unix ]; - then - if mkdir -p /var/calculate/server-data/samba/profiles && \ - mv -f /var/calculate/server-data/samba/unix/profiles \ - /var/calculate/server-data/samba/profiles/unix; - then - rmdir /var/calculate/server-data/samba/unix - ewarn - ewarn "Data from /var/calculate/server-data/samba/unix/profiles" - ewarn "was moved to /var/calculate/server-data/samba/profiles/unix" - SAMBAUPDATE="TRUE" - fi - fi - if ! [ "${SAMBAUPDATE}" == "TRUE" ]; - then - eerror "Cannot move /var/calculate/server-data/samba/unix/profiles" - eerror "Please manualy move " - eerror "/var/calculate/server-data/samba/unix/profiles" - eerror "to /var/calculate/server-data/samba/profiles/unix" - fi - fi - - if [ -d /var/calculate/server-data/samba/win/netlogon ]; - then - SAMBAUPDATE="" - if ! [ -d /var/calculate/server-data/samba/netlogon ]; - then - if mv -f /var/calculate/server-data/samba/win/netlogon \ - /var/calculate/server-data/samba/netlogon; - then - rmdir /var/calculate/server-data/samba/win - ewarn - ewarn "Data form /var/calculate/server-data/samba/win/netlogon" - ewarn "was moved to /var/calculate/server-data/samba/netlogon" - SAMBAUPDATE="TRUE" - fi - fi - if ! [ "${SAMBAUPDATE}" == "TRUE" ]; - then - eerror "Cannot move /var/calculate/server-data/samba/win/netlogon" - eerror "Please manualy move " - eerror "/var/calculate/server-data/samba/win/netlogon" - eerror "/var/calculate/server-data/samba/netlogon" - fi - fi - - if [ "${MAILUPDATE}" == "TRUE" ]; - then - ewarn - ewarn "Please update mail service by the command:" - ewarn "\tcl-update mail" - fi - if [ "${SAMBAUPDATE}" == "TRUE" ]; - then - ewarn - ewarn "Please update samba service by the command:" - ewarn "\tcl-update samba" - fi - - ewarn - ewarn "WARNING!!! If you have the samba service, then update it by the command:" - ewarn "\tcl-update samba" -} diff --git a/sys-apps/calculate-server/calculate-server-2.1.19-r20.ebuild b/sys-apps/calculate-server/calculate-server-2.1.19-r21.ebuild similarity index 98% rename from sys-apps/calculate-server/calculate-server-2.1.19-r20.ebuild rename to sys-apps/calculate-server/calculate-server-2.1.19-r21.ebuild index 4c85a0ed5..dd33b8ed7 100644 --- a/sys-apps/calculate-server/calculate-server-2.1.19-r20.ebuild +++ b/sys-apps/calculate-server/calculate-server-2.1.19-r21.ebuild @@ -3,10 +3,10 @@ # $Header: $ EAPI="5" -PYTHON_COMPAT=(python{2_6,2_7}) +PYTHON_COMPAT=(python2_7) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 eutils +inherit distutils2 eutils SRC_URI="ftp://ftp.calculate-linux.org/calculate/source/calculate2/${PN}/${P}.tar.bz2 http://mirror.yandex.ru/calculate/source/calculate2/${PN}/${P}.tar.bz2" @@ -25,7 +25,7 @@ calculate_nonamed calculate_nosamba calculate_noproxy" -DEPEND="=sys-apps/calculate-lib-2.1.12-r6 +DEPEND="=sys-apps/calculate-lib-2.1.12-r7 dev-python/setuptools-python2 >=net-nds/openldap-2.3[-minimal] >=sys-auth/pam_ldap-180[ssl] diff --git a/sys-apps/calculate-server/calculate-server-2.1.9999.ebuild b/sys-apps/calculate-server/calculate-server-2.1.9999.ebuild index fdd5ec16c..c874e2f5f 100644 --- a/sys-apps/calculate-server/calculate-server-2.1.9999.ebuild +++ b/sys-apps/calculate-server/calculate-server-2.1.9999.ebuild @@ -6,7 +6,7 @@ EAPI="5" PYTHON_COMPAT=(python2_7) DISTUTILS_USE_SETUPTOOLS=manual -inherit distutils-r1 git-r3 +inherit distutils2 git-r3 EGIT_REPO_URI="git://git.calculate-linux.org/calculate-2.1/calculate-server.git" diff --git a/sys-apps/calculate-utils/calculate-utils-3.6.8.10.ebuild b/sys-apps/calculate-utils/calculate-utils-3.6.8.10-r1.ebuild similarity index 94% rename from sys-apps/calculate-utils/calculate-utils-3.6.8.10.ebuild rename to sys-apps/calculate-utils/calculate-utils-3.6.8.10-r1.ebuild index 15317e187..edcc77a90 100644 --- a/sys-apps/calculate-utils/calculate-utils-3.6.8.10.ebuild +++ b/sys-apps/calculate-utils/calculate-utils-3.6.8.10-r1.ebuild @@ -14,7 +14,7 @@ declare -A CALCULATE_MODULES=( ["desktop"]="3.6.8.6" ) -inherit calculate-utils-r10 +inherit calculate-utils-r12 DESCRIPTION="A set of Calculate utilities for system installation, build and upgrade" HOMEPAGE="http://www.calculate-linux.org/main/en/calculate_utilities" diff --git a/sys-apps/calculate-utils/calculate-utils-3.6.8.11.ebuild b/sys-apps/calculate-utils/calculate-utils-3.6.8.11-r1.ebuild similarity index 94% rename from sys-apps/calculate-utils/calculate-utils-3.6.8.11.ebuild rename to sys-apps/calculate-utils/calculate-utils-3.6.8.11-r1.ebuild index 48eec9277..a4b5804a0 100644 --- a/sys-apps/calculate-utils/calculate-utils-3.6.8.11.ebuild +++ b/sys-apps/calculate-utils/calculate-utils-3.6.8.11-r1.ebuild @@ -14,7 +14,7 @@ declare -A CALCULATE_MODULES=( ["desktop"]="3.6.8.6" ) -inherit calculate-utils-r10 +inherit calculate-utils-r12 DESCRIPTION="A set of Calculate utilities for system installation, build and upgrade" HOMEPAGE="http://www.calculate-linux.org/main/en/calculate_utilities" diff --git a/sys-apps/calculate-utils/calculate-utils-3.6.8.14.ebuild b/sys-apps/calculate-utils/calculate-utils-3.6.8.14-r1.ebuild similarity index 95% rename from sys-apps/calculate-utils/calculate-utils-3.6.8.14.ebuild rename to sys-apps/calculate-utils/calculate-utils-3.6.8.14-r1.ebuild index 4a97ecd18..2ef7c3ed6 100644 --- a/sys-apps/calculate-utils/calculate-utils-3.6.8.14.ebuild +++ b/sys-apps/calculate-utils/calculate-utils-3.6.8.14-r1.ebuild @@ -15,7 +15,7 @@ declare -A CALCULATE_MODULES=( ["console-gui"]="3.6.8.2" ) -inherit calculate-utils-r11 +inherit calculate-utils-r12 DESCRIPTION="A set of Calculate utilities for system installation, build and upgrade" HOMEPAGE="http://www.calculate-linux.org/main/en/calculate_utilities" diff --git a/sys-apps/calculate-utils/calculate-utils-3.6.8.15-r3.ebuild b/sys-apps/calculate-utils/calculate-utils-3.6.8.15-r4.ebuild similarity index 95% rename from sys-apps/calculate-utils/calculate-utils-3.6.8.15-r3.ebuild rename to sys-apps/calculate-utils/calculate-utils-3.6.8.15-r4.ebuild index 9222a37a9..9f3c4af77 100644 --- a/sys-apps/calculate-utils/calculate-utils-3.6.8.15-r3.ebuild +++ b/sys-apps/calculate-utils/calculate-utils-3.6.8.15-r4.ebuild @@ -15,7 +15,7 @@ declare -A CALCULATE_MODULES=( ["console-gui"]="3.6.8.2" ) -inherit calculate-utils-r11 +inherit calculate-utils-r12 DESCRIPTION="A set of Calculate utilities for system installation, build and upgrade" HOMEPAGE="http://www.calculate-linux.org/main/en/calculate_utilities" diff --git a/sys-apps/calculate-utils/calculate-utils-3.6.8.16.ebuild b/sys-apps/calculate-utils/calculate-utils-3.6.8.16-r1.ebuild similarity index 95% rename from sys-apps/calculate-utils/calculate-utils-3.6.8.16.ebuild rename to sys-apps/calculate-utils/calculate-utils-3.6.8.16-r1.ebuild index f3c4604b6..38aa87f81 100644 --- a/sys-apps/calculate-utils/calculate-utils-3.6.8.16.ebuild +++ b/sys-apps/calculate-utils/calculate-utils-3.6.8.16-r1.ebuild @@ -15,7 +15,7 @@ declare -A CALCULATE_MODULES=( ["console-gui"]="3.6.8.2" ) -inherit calculate-utils-r11 +inherit calculate-utils-r12 DESCRIPTION="A set of Calculate utilities for system installation, build and upgrade" HOMEPAGE="http://www.calculate-linux.org/main/en/calculate_utilities" diff --git a/sys-apps/calculate-utils/calculate-utils-3.6.8.17.ebuild b/sys-apps/calculate-utils/calculate-utils-3.6.8.17-r1.ebuild similarity index 95% rename from sys-apps/calculate-utils/calculate-utils-3.6.8.17.ebuild rename to sys-apps/calculate-utils/calculate-utils-3.6.8.17-r1.ebuild index 3e7a2475f..2f0a355a3 100644 --- a/sys-apps/calculate-utils/calculate-utils-3.6.8.17.ebuild +++ b/sys-apps/calculate-utils/calculate-utils-3.6.8.17-r1.ebuild @@ -15,7 +15,7 @@ declare -A CALCULATE_MODULES=( ["console-gui"]="3.6.8.2" ) -inherit calculate-utils-r11 +inherit calculate-utils-r12 DESCRIPTION="A set of Calculate utilities for system installation, build and upgrade" HOMEPAGE="http://www.calculate-linux.org/main/en/calculate_utilities" diff --git a/sys-apps/calculate-utils/calculate-utils-3.6.8.18.ebuild b/sys-apps/calculate-utils/calculate-utils-3.6.8.18-r1.ebuild similarity index 95% rename from sys-apps/calculate-utils/calculate-utils-3.6.8.18.ebuild rename to sys-apps/calculate-utils/calculate-utils-3.6.8.18-r1.ebuild index 9ee20d83a..722742303 100644 --- a/sys-apps/calculate-utils/calculate-utils-3.6.8.18.ebuild +++ b/sys-apps/calculate-utils/calculate-utils-3.6.8.18-r1.ebuild @@ -15,7 +15,7 @@ declare -A CALCULATE_MODULES=( ["console-gui"]="3.6.8.2" ) -inherit calculate-utils-r11 +inherit calculate-utils-r12 DESCRIPTION="A set of Calculate utilities for system installation, build and upgrade" HOMEPAGE="http://www.calculate-linux.org/main/en/calculate_utilities" diff --git a/sys-apps/calculate-utils/calculate-utils-3.6.9999.ebuild b/sys-apps/calculate-utils/calculate-utils-3.6.9999.ebuild index ba4f67deb..1ea8e586e 100644 --- a/sys-apps/calculate-utils/calculate-utils-3.6.9999.ebuild +++ b/sys-apps/calculate-utils/calculate-utils-3.6.9999.ebuild @@ -5,7 +5,7 @@ EAPI="7" PYTHON_COMPAT=(python2_7) -inherit calculate-utils-r11 git-r3 +inherit calculate-utils-r12 git-r3 DESCRIPTION="A set of Calculate utilities for system installation, build and upgrade" HOMEPAGE="http://www.calculate-linux.org/main/en/calculate_utilities"