1 |
commit: fcf6a8fcf6fe41d636c0adf04dfe9110d7fe9123 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 26 11:12:36 2020 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 26 11:12:36 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/qt.git/commit/?id=fcf6a8fc |
7 |
|
8 |
qmake-utils.eclass: Drop obsolete EAPI-6 support, ban qt4* functions |
9 |
|
10 |
Last consumer in Gentoo ebuild repository was dropped. |
11 |
|
12 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
13 |
|
14 |
eclass/qmake-utils.eclass | 191 ++++++++-------------------------------------- |
15 |
1 file changed, 33 insertions(+), 158 deletions(-) |
16 |
|
17 |
diff --git a/eclass/qmake-utils.eclass b/eclass/qmake-utils.eclass |
18 |
index 394c8422..79dbc8c0 100644 |
19 |
--- a/eclass/qmake-utils.eclass |
20 |
+++ b/eclass/qmake-utils.eclass |
21 |
@@ -1,4 +1,4 @@ |
22 |
-# Copyright 1999-2019 Gentoo Authors |
23 |
+# Copyright 1999-2020 Gentoo Authors |
24 |
# Distributed under the terms of the GNU General Public License v2 |
25 |
|
26 |
# @ECLASS: qmake-utils.eclass |
27 |
@@ -6,10 +6,10 @@ |
28 |
# qt@g.o |
29 |
# @AUTHOR: |
30 |
# Davide Pesavento <pesa@g.o> |
31 |
-# @SUPPORTED_EAPIS: 6 7 |
32 |
+# @SUPPORTED_EAPIS: 7 |
33 |
# @BLURB: Common functions for qmake-based packages. |
34 |
# @DESCRIPTION: |
35 |
-# Utility eclass providing wrapper functions for Qt4 and Qt5 qmake. |
36 |
+# Utility eclass providing wrapper functions for Qt5 qmake. |
37 |
# |
38 |
# This eclass does not set any metadata variables nor export any phase |
39 |
# functions. It can be inherited safely. |
40 |
@@ -17,55 +17,59 @@ |
41 |
if [[ -z ${_QMAKE_UTILS_ECLASS} ]]; then |
42 |
_QMAKE_UTILS_ECLASS=1 |
43 |
|
44 |
-[[ ${EAPI:-0} == [012345] ]] && die "qmake-utils.eclass: unsupported EAPI=${EAPI:-0}" |
45 |
+case ${EAPI} in |
46 |
+ 7) ;; |
47 |
+ *) die "EAPI=${EAPI:-0} is not supported" ;; |
48 |
+esac |
49 |
|
50 |
inherit estack toolchain-funcs |
51 |
|
52 |
+# @FUNCTION: _qmake-utils_banned_func |
53 |
+# @INTERNAL |
54 |
+# @DESCRIPTION: |
55 |
+# Banned functions are banned. |
56 |
+_qmake-utils_banned_func() { |
57 |
+ die "${FUNCNAME[1]} is banned in EAPI 7 and later" |
58 |
+} |
59 |
+ |
60 |
# @FUNCTION: qt4_get_bindir |
61 |
+# @INTERNAL |
62 |
# @DESCRIPTION: |
63 |
-# Echoes the directory where Qt4 binaries are installed. |
64 |
-# EPREFIX is already prepended to the returned path. |
65 |
+# Banned. |
66 |
qt4_get_bindir() { |
67 |
- [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later" |
68 |
- |
69 |
- local qtbindir=${EPREFIX}$(qt4_get_libdir)/bin |
70 |
- if [[ -d ${qtbindir} ]]; then |
71 |
- echo ${qtbindir} |
72 |
- else |
73 |
- echo ${EPREFIX}/usr/bin |
74 |
- fi |
75 |
+ _qmake-utils_banned_func |
76 |
} |
77 |
|
78 |
# @FUNCTION: qt4_get_headerdir |
79 |
+# @INTERNAL |
80 |
# @DESCRIPTION: |
81 |
-# Echoes the directory where Qt4 headers are installed. |
82 |
+# Banned. |
83 |
qt4_get_headerdir() { |
84 |
- [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later" |
85 |
- echo /usr/include/qt4 |
86 |
+ _qmake-utils_banned_func |
87 |
} |
88 |
|
89 |
# @FUNCTION: qt4_get_libdir |
90 |
+# @INTERNAL |
91 |
# @DESCRIPTION: |
92 |
-# Echoes the directory where Qt4 libraries are installed. |
93 |
+# Banned. |
94 |
qt4_get_libdir() { |
95 |
- [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later" |
96 |
- echo /usr/$(get_libdir)/qt4 |
97 |
+ _qmake-utils_banned_func |
98 |
} |
99 |
|
100 |
# @FUNCTION: qt4_get_mkspecsdir |
101 |
+# @INTERNAL |
102 |
# @DESCRIPTION: |
103 |
-# Echoes the directory where Qt4 mkspecs are installed. |
104 |
+# Banned. |
105 |
qt4_get_mkspecsdir() { |
106 |
- [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later" |
107 |
- echo /usr/share/qt4/mkspecs |
108 |
+ _qmake-utils_banned_func |
109 |
} |
110 |
|
111 |
# @FUNCTION: qt4_get_plugindir |
112 |
+# @INTERNAL |
113 |
# @DESCRIPTION: |
114 |
-# Echoes the directory where Qt4 plugins are installed. |
115 |
+# Banned. |
116 |
qt4_get_plugindir() { |
117 |
- [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later" |
118 |
- echo $(qt4_get_libdir)/plugins |
119 |
+ _qmake-utils_banned_func |
120 |
} |
121 |
|
122 |
# @FUNCTION: qt5_get_bindir |
123 |
@@ -139,141 +143,12 @@ qmake-utils_find_pro_file() { |
124 |
esac |
125 |
} |
126 |
|
127 |
-# @VARIABLE: EQMAKE4_EXCLUDE |
128 |
-# @DEFAULT_UNSET |
129 |
-# @DESCRIPTION: |
130 |
-# List of files to be excluded from eqmake4 CONFIG processing. |
131 |
-# Paths are relative to the current working directory (usually ${S}). |
132 |
-# |
133 |
-# Example: EQMAKE4_EXCLUDE="ignore/me.pro foo/*" |
134 |
- |
135 |
# @FUNCTION: eqmake4 |
136 |
-# @USAGE: [project_file] [parameters to qmake] |
137 |
+# @INTERNAL |
138 |
# @DESCRIPTION: |
139 |
-# Wrapper for Qt4's qmake. If project_file is not specified, eqmake4 looks |
140 |
-# for one in the current directory (non-recursively). If multiple project |
141 |
-# files are found, then ${PN}.pro is used, if it exists, otherwise eqmake4 |
142 |
-# will not be able to continue. |
143 |
-# |
144 |
-# All other arguments are appended unmodified to qmake command line. |
145 |
-# |
146 |
-# For recursive build systems, i.e. those based on the subdirs template, |
147 |
-# you should run eqmake4 on the top-level project file only, unless you |
148 |
-# have a valid reason to do otherwise. During the building, qmake will |
149 |
-# be automatically re-invoked with the right arguments on every directory |
150 |
-# specified inside the top-level project file. |
151 |
+# Banned. |
152 |
eqmake4() { |
153 |
- debug-print-function ${FUNCNAME} "$@" |
154 |
- [[ ${EAPI:-0} == [0123456] ]] || die "${FUNCNAME[1]} is banned in EAPI 7 and later" |
155 |
- |
156 |
- ebegin "Running qmake" |
157 |
- |
158 |
- local qmake_args=("$@") |
159 |
- |
160 |
- # Check if the project file name was passed as first argument. If not, look for candidates. |
161 |
- local regexp='.*\.pro' |
162 |
- if ! [[ ${1} =~ ${regexp} ]]; then |
163 |
- local project_file=$(qmake-utils_find_pro_file) |
164 |
- if [[ -z ${project_file} ]]; then |
165 |
- echo |
166 |
- eerror "No project files found in '${PWD}'" |
167 |
- eerror "This shouldn't happen - please send a bug report to https://bugs.gentoo.org/" |
168 |
- echo |
169 |
- die "eqmake4 failed" |
170 |
- fi |
171 |
- qmake_args+=("${project_file}") |
172 |
- fi |
173 |
- |
174 |
- # Make sure the CONFIG variable is correctly set for both release and debug builds. |
175 |
- local config_add=release |
176 |
- local config_remove=debug |
177 |
- if in_iuse debug && use debug; then |
178 |
- config_add=debug |
179 |
- config_remove=release |
180 |
- fi |
181 |
- |
182 |
- local awkscript='BEGIN { |
183 |
- printf "### eqmake4 was here ###\n" > file; |
184 |
- printf "CONFIG -= debug_and_release %s\n", remove >> file; |
185 |
- printf "CONFIG += %s\n\n", add >> file; |
186 |
- fixed=0; |
187 |
- } |
188 |
- /^[[:blank:]]*CONFIG[[:blank:]]*[\+\*]?=/ { |
189 |
- if (gsub("\\<((" remove ")|(debug_and_release))\\>", "") > 0) { |
190 |
- fixed=1; |
191 |
- } |
192 |
- } |
193 |
- /^[[:blank:]]*CONFIG[[:blank:]]*-=/ { |
194 |
- if (gsub("\\<" add "\\>", "") > 0) { |
195 |
- fixed=1; |
196 |
- } |
197 |
- } |
198 |
- { |
199 |
- print >> file; |
200 |
- } |
201 |
- END { |
202 |
- print fixed; |
203 |
- }' |
204 |
- |
205 |
- [[ -n ${EQMAKE4_EXCLUDE} ]] && eshopts_push -o noglob |
206 |
- |
207 |
- local file |
208 |
- while read file; do |
209 |
- local excl |
210 |
- for excl in ${EQMAKE4_EXCLUDE}; do |
211 |
- [[ ${file} == ${excl} ]] && continue 2 |
212 |
- done |
213 |
- grep -q '^### eqmake4 was here ###$' "${file}" && continue |
214 |
- |
215 |
- local retval=$({ |
216 |
- rm -f "${file}" || echo FAIL |
217 |
- awk -v file="${file}" \ |
218 |
- -v add=${config_add} \ |
219 |
- -v remove=${config_remove} \ |
220 |
- -- "${awkscript}" || echo FAIL |
221 |
- } < "${file}") |
222 |
- |
223 |
- if [[ ${retval} == 1 ]]; then |
224 |
- einfo " - fixed CONFIG in ${file}" |
225 |
- elif [[ ${retval} != 0 ]]; then |
226 |
- eerror " - error while processing ${file}" |
227 |
- die "eqmake4 failed to process ${file}" |
228 |
- fi |
229 |
- done < <(find . -type f -name '*.pr[io]' -printf '%P\n' 2>/dev/null) |
230 |
- |
231 |
- [[ -n ${EQMAKE4_EXCLUDE} ]] && eshopts_pop |
232 |
- |
233 |
- "$(qt4_get_bindir)"/qmake \ |
234 |
- -makefile \ |
235 |
- QMAKE_AR="$(tc-getAR) cqs" \ |
236 |
- QMAKE_CC="$(tc-getCC)" \ |
237 |
- QMAKE_CXX="$(tc-getCXX)" \ |
238 |
- QMAKE_LINK="$(tc-getCXX)" \ |
239 |
- QMAKE_LINK_C="$(tc-getCC)" \ |
240 |
- QMAKE_OBJCOPY="$(tc-getOBJCOPY)" \ |
241 |
- QMAKE_RANLIB= \ |
242 |
- QMAKE_STRIP= \ |
243 |
- QMAKE_CFLAGS="${CFLAGS}" \ |
244 |
- QMAKE_CFLAGS_RELEASE= \ |
245 |
- QMAKE_CFLAGS_DEBUG= \ |
246 |
- QMAKE_CXXFLAGS="${CXXFLAGS}" \ |
247 |
- QMAKE_CXXFLAGS_RELEASE= \ |
248 |
- QMAKE_CXXFLAGS_DEBUG= \ |
249 |
- QMAKE_LFLAGS="${LDFLAGS}" \ |
250 |
- QMAKE_LFLAGS_RELEASE= \ |
251 |
- QMAKE_LFLAGS_DEBUG= \ |
252 |
- QMAKE_LIBDIR_QT="${EPREFIX}$(qt4_get_libdir)" \ |
253 |
- QMAKE_LIBDIR_X11="${EPREFIX}/usr/$(get_libdir)" \ |
254 |
- QMAKE_LIBDIR_OPENGL="${EPREFIX}/usr/$(get_libdir)" \ |
255 |
- "${qmake_args[@]}" |
256 |
- |
257 |
- if ! eend $? ; then |
258 |
- echo |
259 |
- eerror "Running qmake has failed! (see above for details)" |
260 |
- eerror "This shouldn't happen - please send a bug report to https://bugs.gentoo.org/" |
261 |
- echo |
262 |
- die "eqmake4 failed" |
263 |
- fi |
264 |
+ _qmake-utils_banned_func |
265 |
} |
266 |
|
267 |
# @FUNCTION: eqmake5 |