Gentoo Archives: gentoo-dev

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-dev <gentoo-dev@l.g.o>
Subject: [gentoo-dev] [PATCH] virtualx.eclass: Drop EAPI-4 and EAPI-5 support and cleanup
Date: Wed, 31 Mar 2021 06:33:21
Message-Id: 24881922.1r3eYUQgxm@tuxbook
1 Almost all revdeps are >=EAPI-6 now.
2
3 - Drop EAPI-4 and EAPI-5 support, cleanup legacy code
4 - Drop deprecated functions virtualmake, Xmake, Xemake, Xeconf
5
6 There are still >0 ebuild results grep'ing for Xemake and virtualmake but all
7 are hidden behind RESTRICT=test (would already fail otherwise).
8
9 See also:
10 https://qa-reports.gentoo.org/output/eapi-per-eclass/virtualx.eclass/5.txt
11 https://github.com/gentoo/gentoo/pull/20201
12
13
14 ---
15 eclass/virtualx.eclass | 102 +++--------------------------------------
16 1 file changed, 7 insertions(+), 95 deletions(-)
17
18 diff --git a/eclass/virtualx.eclass b/eclass/virtualx.eclass
19 index a95f8a7e1c1..b1e51bdcaee 100644
20 --- a/eclass/virtualx.eclass
21 +++ b/eclass/virtualx.eclass
22 @@ -6,24 +6,23 @@
23 # x11@g.o
24 # @AUTHOR:
25 # Original author: Martin Schlemmer <azarah@g.o>
26 -# @SUPPORTED_EAPIS: 4 5 6 7
27 +# @SUPPORTED_EAPIS: 6 7
28 # @BLURB: This eclass can be used for packages that needs a working X environment to build.
29
30 if [[ ! ${_VIRTUAL_X} ]]; then
31 +_VIRTUAL_X=1
32
33 case "${EAPI:-0}" in
34 - 0|1|2|3)
35 + 0|1|2|3|4|5)
36 die "virtualx.eclass: EAPI ${EAPI} is too old."
37 ;;
38 - 4|5|6|7)
39 + 6|7)
40 ;;
41 *)
42 die "virtualx.eclass: EAPI ${EAPI} is not supported yet."
43 ;;
44 esac
45
46 -[[ ${EAPI} == [45] ]] && inherit eutils
47 -
48 # @ECLASS-VARIABLE: VIRTUALX_REQUIRED
49 # @PRE_INHERIT
50 # @DESCRIPTION:
51 @@ -55,39 +54,11 @@ case ${VIRTUALX_REQUIRED} in
52 manual)
53 ;;
54 always)
55 - if [[ ${EAPI:-0} != [0123456] ]]; then
56 - BDEPEND="${VIRTUALX_DEPEND}"
57 - else
58 - DEPEND="${VIRTUALX_DEPEND}"
59 - fi
60 + BDEPEND="${VIRTUALX_DEPEND}"
61 RDEPEND=""
62 ;;
63 - optional|tests)
64 - [[ ${EAPI} == [45] ]] \
65 - || die 'Values "optional" and "tests" for VIRTUALX_REQUIRED are banned in EAPI > 5'
66 - # deprecated section YAY.
67 - eqawarn "VIRTUALX_REQUIRED=optional and VIRTUALX_REQUIRED=tests are deprecated."
68 - eqawarn "You can drop the variable definition completely from ebuild,"
69 - eqawarn "because it is default behaviour."
70 -
71 - if [[ -n ${VIRTUALX_USE} ]]; then
72 - # so they like to specify the useflag
73 - eqawarn "VIRTUALX_USE variable is deprecated."
74 - eqawarn "Please read eclass manpage to find out how to use VIRTUALX_REQUIRED"
75 - eqawarn "to achieve the same behaviour."
76 - fi
77 -
78 - [[ -z ${VIRTUALX_USE} ]] && VIRTUALX_USE="test"
79 - DEPEND="${VIRTUALX_USE}? ( ${VIRTUALX_DEPEND} )"
80 - RDEPEND=""
81 - IUSE="${VIRTUALX_USE}"
82 - ;;
83 *)
84 - if [[ ${EAPI:-0} != [0123456] ]]; then
85 - BDEPEND="${VIRTUALX_REQUIRED}? ( ${VIRTUALX_DEPEND} )"
86 - else
87 - DEPEND="${VIRTUALX_REQUIRED}? ( ${VIRTUALX_DEPEND} )"
88 - fi
89 + BDEPEND="${VIRTUALX_REQUIRED}? ( ${VIRTUALX_DEPEND} )"
90 RDEPEND=""
91 IUSE="${VIRTUALX_REQUIRED}"
92 [[ ${VIRTUALX_REQUIRED} == test ]] &&
93 @@ -95,26 +66,7 @@ case ${VIRTUALX_REQUIRED} in
94 ;;
95 esac
96
97 -# @FUNCTION: virtualmake
98 -# @DESCRIPTION:
99 -# Function which start new Xvfb session
100 -# where the VIRTUALX_COMMAND variable content gets executed.
101 -virtualmake() {
102 - debug-print-function ${FUNCNAME} "$@"
103 -
104 - [[ ${EAPI} == [45] ]] \
105 - || die "${FUNCNAME} is unsupported in EAPI > 5, please use virtx"
106 -
107 - # backcompat for maketype
108 - if [[ -n ${maketype} ]]; then
109 - [[ ${EAPI} == [45] ]] || die "maketype is banned in EAPI > 5"
110 - eqawarn "ebuild is exporting \$maketype=${maketype}"
111 - eqawarn "Ebuild should be migrated to use 'virtx command' instead."
112 - VIRTUALX_COMMAND=${maketype}
113 - fi
114 -
115 - virtx "${VIRTUALX_COMMAND}" "${@}"
116 -}
117 +[[ ${EAPI} == 6 ]] && DEPEND="${BDEPEND}"
118
119
120 # @FUNCTION: virtx
121 @@ -232,44 +184,4 @@ virtx() {
122 return 0 # always return 0, it can be altered by failed kill for Xvfb
123 }
124
125 -# @FUNCTION: Xmake
126 -# @DESCRIPTION:
127 -# Same as "make", but set up the Xvfb hack if needed.
128 -# Deprecated call.
129 -Xmake() {
130 - debug-print-function ${FUNCNAME} "$@"
131 -
132 - [[ ${EAPI} == [45] ]] \
133 - || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake -j1 ....'"
134 -
135 - eqawarn "you should not execute make directly"
136 - eqawarn "rather execute Xemake -j1 if you have issues with parallel make"
137 - VIRTUALX_COMMAND="emake -j1" virtualmake "$@"
138 -}
139 -
140 -# @FUNCTION: Xemake
141 -# @DESCRIPTION:
142 -# Same as "emake", but set up the Xvfb hack if needed.
143 -Xemake() {
144 - debug-print-function ${FUNCNAME} "$@"
145 -
146 - [[ ${EAPI} == [45] ]] \
147 - || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx emake ....'"
148 -
149 - VIRTUALX_COMMAND="emake" virtualmake "$@"
150 -}
151 -
152 -# @FUNCTION: Xeconf
153 -# @DESCRIPTION:
154 -# Same as "econf", but set up the Xvfb hack if needed.
155 -Xeconf() {
156 - debug-print-function ${FUNCNAME} "$@"
157 -
158 - [[ ${EAPI} == [45] ]] \
159 - || die "${FUNCNAME} is unsupported in EAPI > 5, please use 'virtx econf ....'"
160 -
161 - VIRTUALX_COMMAND="econf" virtualmake "$@"
162 -}
163 -
164 -_VIRTUAL_X=1
165 fi
166 --
167 2.31.0

Attachments

File name MIME type
signature.asc application/pgp-signature