Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 2/5] distutils-r1.eclass: Remove EAPI 6 support
Date: Thu, 08 Dec 2022 18:54:36
Message-Id: 20221208185348.3599822-3-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/5] distutils-r1 & python-utils-r1: cleanup old stuff by "Michał Górny"
1 Signed-off-by: Michał Górny <mgorny@g.o>
2 ---
3 eclass/distutils-r1.eclass | 42 ++++++++++----------------------------
4 1 file changed, 11 insertions(+), 31 deletions(-)
5
6 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
7 index 65004ba856f9..3064ba6a446c 100644
8 --- a/eclass/distutils-r1.eclass
9 +++ b/eclass/distutils-r1.eclass
10 @@ -7,7 +7,7 @@
11 # @AUTHOR:
12 # Author: Michał Górny <mgorny@g.o>
13 # Based on the work of: Krzysztof Pawlik <nelchael@g.o>
14 -# @SUPPORTED_EAPIS: 6 7 8
15 +# @SUPPORTED_EAPIS: 7 8
16 # @PROVIDES: python-r1 python-single-r1
17 # @BLURB: A simple eclass to build Python packages using distutils.
18 # @DESCRIPTION:
19 @@ -44,15 +44,9 @@
20 # For more information, please see the Python Guide:
21 # https://projects.gentoo.org/python/guide/
22
23 -case "${EAPI:-0}" in
24 - [0-5])
25 - die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
26 - ;;
27 - [6-8])
28 - ;;
29 - *)
30 - die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
31 - ;;
32 +case ${EAPI:-0} in
33 + 7|8) ;;
34 + *) die "EAPI=${EAPI:-0} not supported";;
35 esac
36
37 # @ECLASS_VARIABLE: DISTUTILS_OPTIONAL
38 @@ -177,7 +171,6 @@ esac
39
40 if [[ ! ${_DISTUTILS_R1} ]]; then
41
42 -[[ ${EAPI} == 6 ]] && inherit eutils xdg-utils
43 inherit multibuild multiprocessing ninja-utils toolchain-funcs
44
45 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
46 @@ -322,11 +315,7 @@ _distutils_set_globals() {
47
48 if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
49 RDEPEND="${PYTHON_DEPS} ${rdep}"
50 - if [[ ${EAPI} != 6 ]]; then
51 - BDEPEND="${PYTHON_DEPS} ${bdep}"
52 - else
53 - DEPEND="${PYTHON_DEPS} ${bdep}"
54 - fi
55 + BDEPEND="${PYTHON_DEPS} ${bdep}"
56 REQUIRED_USE=${PYTHON_REQUIRED_USE}
57 fi
58 }
59 @@ -539,11 +528,7 @@ distutils_enable_sphinx() {
60 python_compile_all() { sphinx_compile_all; }
61
62 IUSE+=" doc"
63 - if [[ ${EAPI} == 6 ]]; then
64 - DEPEND+=" doc? ( ${deps} )"
65 - else
66 - BDEPEND+=" doc? ( ${deps} )"
67 - fi
68 + BDEPEND+=" doc? ( ${deps} )"
69
70 # we need to ensure successful return in case we're called last,
71 # otherwise Portage may wrongly assume sourcing failed
72 @@ -624,11 +609,7 @@ distutils_enable_tests() {
73 if [[ -n ${test_deps} ]]; then
74 IUSE+=" test"
75 RESTRICT+=" !test? ( test )"
76 - if [[ ${EAPI} == 6 ]]; then
77 - DEPEND+=" test? ( ${test_deps} )"
78 - else
79 - BDEPEND+=" test? ( ${test_deps} )"
80 - fi
81 + BDEPEND+=" test? ( ${test_deps} )"
82 fi
83
84 # we need to ensure successful return in case we're called last,
85 @@ -672,7 +653,7 @@ esetup.py() {
86 setup_py=( -c "from setuptools import setup; setup()" )
87 fi
88
89 - if [[ ${EAPI} != [67] && ${mydistutilsargs[@]} ]]; then
90 + if [[ ${EAPI} != 7 && ${mydistutilsargs[@]} ]]; then
91 die "mydistutilsargs is banned in EAPI ${EAPI} (use DISTUTILS_ARGS)"
92 fi
93
94 @@ -744,7 +725,7 @@ distutils_install_for_testing() {
95 local install_method=root
96 case ${1} in
97 --via-home)
98 - [[ ${EAPI} == [67] ]] || die "${*} is banned in EAPI ${EAPI}"
99 + [[ ${EAPI} == 7 ]] || die "${*} is banned in EAPI ${EAPI}"
100 install_method=home
101 shift
102 ;;
103 @@ -895,7 +876,7 @@ _distutils-r1_check_all_phase_mismatch() {
104 eqawarn "QA Notice: distutils-r1_python_${EBUILD_PHASE}_all called"
105 eqawarn "from python_${EBUILD_PHASE}. Did you mean to use"
106 eqawarn "python_${EBUILD_PHASE}_all()?"
107 - [[ ${EAPI} != [67] ]] &&
108 + [[ ${EAPI} != 7 ]] &&
109 die "distutils-r1_python_${EBUILD_PHASE}_all called from python_${EBUILD_PHASE}."
110 fi
111 }
112 @@ -1050,7 +1031,6 @@ distutils-r1_python_prepare_all() {
113 fi
114
115 python_export_utf8_locale
116 - [[ ${EAPI} == 6 ]] && xdg_environment_reset # Bug 577704
117 _distutils-r1_print_package_versions
118
119 _DISTUTILS_DEFAULT_CALLED=1
120 @@ -1516,7 +1496,7 @@ _distutils-r1_wrap_scripts() {
121
122 debug-print "${FUNCNAME}: installing wrapper at ${bindir}/${basename}"
123 local dosym=dosym
124 - [[ ${EAPI} == [67] ]] && dosym=dosym8
125 + [[ ${EAPI} == 7 ]] && dosym=dosym8
126 "${dosym}" -r /usr/lib/python-exec/python-exec2 \
127 "${bindir#${EPREFIX}}/${basename}"
128 done
129 --
130 2.38.1