1 |
commit: 3bf7b7fcb0882ade14980e23f95150971de3c446 |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jan 5 00:43:46 2019 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jan 5 00:43:46 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=3bf7b7fc |
7 |
|
8 |
eclass/qt5-build.eclass: remove |
9 |
|
10 |
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org> |
11 |
|
12 |
eclass/qt5-build.eclass | 808 ------------------------------------------------ |
13 |
1 file changed, 808 deletions(-) |
14 |
|
15 |
diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass |
16 |
deleted file mode 100644 |
17 |
index 82a2aaf..0000000 |
18 |
--- a/eclass/qt5-build.eclass |
19 |
+++ /dev/null |
20 |
@@ -1,808 +0,0 @@ |
21 |
-# Copyright 1999-2017 Gentoo Foundation |
22 |
-# Distributed under the terms of the GNU General Public License v2 |
23 |
- |
24 |
-# @ECLASS: qt5-build.eclass |
25 |
-# @MAINTAINER: |
26 |
-# qt@g.o |
27 |
-# @AUTHOR: |
28 |
-# Davide Pesavento <pesa@g.o> |
29 |
-# @SUPPORTED_EAPIS: 6 |
30 |
-# @BLURB: Eclass for Qt5 split ebuilds. |
31 |
-# @DESCRIPTION: |
32 |
-# This eclass contains various functions that are used when building Qt5. |
33 |
-# Requires EAPI 6. |
34 |
- |
35 |
-if [[ ${CATEGORY} != dev-qt ]]; then |
36 |
- die "qt5-build.eclass is only to be used for building Qt 5." |
37 |
-fi |
38 |
- |
39 |
-case ${EAPI} in |
40 |
- 6) : ;; |
41 |
- *) die "qt5-build.eclass: unsupported EAPI=${EAPI:-0}" ;; |
42 |
-esac |
43 |
- |
44 |
-# @ECLASS-VARIABLE: QT5_MODULE |
45 |
-# @PRE_INHERIT |
46 |
-# @DESCRIPTION: |
47 |
-# The upstream name of the module this package belongs to. Used for |
48 |
-# SRC_URI and EGIT_REPO_URI. Must be set before inheriting the eclass. |
49 |
-: ${QT5_MODULE:=${PN}} |
50 |
- |
51 |
-# @ECLASS-VARIABLE: QT5_TARGET_SUBDIRS |
52 |
-# @DEFAULT_UNSET |
53 |
-# @DESCRIPTION: |
54 |
-# Array variable containing the source directories that should be built. |
55 |
-# All paths must be relative to ${S}. |
56 |
- |
57 |
-# @ECLASS-VARIABLE: QT5_GENTOO_CONFIG |
58 |
-# @DEFAULT_UNSET |
59 |
-# @DESCRIPTION: |
60 |
-# Array of <useflag:feature:macro> triplets that are evaluated in src_install |
61 |
-# to generate the per-package list of enabled QT_CONFIG features and macro |
62 |
-# definitions, which are then merged together with all other Qt5 packages |
63 |
-# installed on the system to obtain the global qconfig.{h,pri} files. |
64 |
- |
65 |
-# @ECLASS-VARIABLE: VIRTUALX_REQUIRED |
66 |
-# @DESCRIPTION: |
67 |
-# For proper description see virtualx.eclass man page. |
68 |
-# Here we redefine default value to be manual, if your package needs virtualx |
69 |
-# for tests you should proceed with setting VIRTUALX_REQUIRED=test. |
70 |
-: ${VIRTUALX_REQUIRED:=manual} |
71 |
- |
72 |
-inherit estack flag-o-matic ltprune toolchain-funcs versionator virtualx |
73 |
- |
74 |
-HOMEPAGE="https://www.qt.io/" |
75 |
-LICENSE="|| ( GPL-2 GPL-3 LGPL-3 ) FDL-1.3" |
76 |
-SLOT=5/$(get_version_component_range 1-2) |
77 |
- |
78 |
-QT5_MINOR_VERSION=$(get_version_component_range 2) |
79 |
-QT5_PATCH_VERSION=$(get_version_component_range 3) |
80 |
-readonly QT5_MINOR_VERSION QT5_PATCH_VERSION |
81 |
- |
82 |
-case ${PV} in |
83 |
- 5.9999) |
84 |
- # git dev branch |
85 |
- QT5_BUILD_TYPE="live" |
86 |
- EGIT_BRANCH="dev" |
87 |
- ;; |
88 |
- 5.?.9999|5.??.9999|5.???.9999) |
89 |
- # git stable branch |
90 |
- QT5_BUILD_TYPE="live" |
91 |
- EGIT_BRANCH=${PV%.9999} |
92 |
- ;; |
93 |
- *_alpha*|*_beta*|*_rc*) |
94 |
- # development release |
95 |
- QT5_BUILD_TYPE="release" |
96 |
- MY_P=${QT5_MODULE}-opensource-src-${PV/_/-} |
97 |
- SRC_URI="https://download.qt.io/development_releases/qt/${PV%.*}/${PV/_/-}/submodules/${MY_P}.tar.xz" |
98 |
- S=${WORKDIR}/${MY_P} |
99 |
- ;; |
100 |
- *) |
101 |
- # official stable release |
102 |
- QT5_BUILD_TYPE="release" |
103 |
- MY_P=${QT5_MODULE}-opensource-src-${PV} |
104 |
- SRC_URI="https://download.qt.io/official_releases/qt/${PV%.*}/${PV}/submodules/${MY_P}.tar.xz" |
105 |
- S=${WORKDIR}/${MY_P} |
106 |
- ;; |
107 |
-esac |
108 |
-readonly QT5_BUILD_TYPE |
109 |
- |
110 |
-EGIT_REPO_URI=( |
111 |
- "https://code.qt.io/qt/${QT5_MODULE}.git" |
112 |
- "https://github.com/qt/${QT5_MODULE}.git" |
113 |
-) |
114 |
-[[ ${QT5_BUILD_TYPE} == live ]] && inherit git-r3 |
115 |
- |
116 |
-# @ECLASS-VARIABLE: QT5_BUILD_DIR |
117 |
-# @OUTPUT_VARIABLE |
118 |
-# @DESCRIPTION: |
119 |
-# Build directory for out-of-source builds. |
120 |
-case ${QT5_BUILD_TYPE} in |
121 |
- live) : ${QT5_BUILD_DIR:=${S}_build} ;; |
122 |
- release) : ${QT5_BUILD_DIR:=${S}} ;; # workaround for bug 497312 |
123 |
-esac |
124 |
- |
125 |
-IUSE="debug test" |
126 |
- |
127 |
-[[ ${PN} == qtwebkit ]] && RESTRICT+=" mirror" # bug 524584 |
128 |
-[[ ${QT5_BUILD_TYPE} == release ]] && RESTRICT+=" test" # bug 457182 |
129 |
- |
130 |
-DEPEND=" |
131 |
- dev-lang/perl |
132 |
- virtual/pkgconfig |
133 |
-" |
134 |
-if [[ (${PN} != qttest && ${PN} != qtwebkit) || (${PN} == qtwebkit && ${QT5_MINOR_VERSION} -lt 9) ]]; then |
135 |
- DEPEND+=" test? ( ~dev-qt/qttest-${PV} )" |
136 |
-fi |
137 |
-RDEPEND=" |
138 |
- dev-qt/qtchooser |
139 |
-" |
140 |
- |
141 |
- |
142 |
-###### Phase functions ###### |
143 |
- |
144 |
-EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install src_test pkg_postinst pkg_postrm |
145 |
- |
146 |
-# @FUNCTION: qt5-build_src_unpack |
147 |
-# @DESCRIPTION: |
148 |
-# Unpacks the sources. |
149 |
-qt5-build_src_unpack() { |
150 |
- if tc-is-gcc; then |
151 |
- local min_gcc4_minor_version=7 |
152 |
- if [[ $(gcc-major-version) -lt 4 ]] || \ |
153 |
- [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt ${min_gcc4_minor_version} ]]; then |
154 |
- eerror "GCC version 4.${min_gcc4_minor_version} or later is required to build this package" |
155 |
- die "GCC 4.${min_gcc4_minor_version} or later required" |
156 |
- fi |
157 |
- fi |
158 |
- |
159 |
- # bug 307861 |
160 |
- if [[ ${PN} == qtwebengine || ${PN} == qtwebkit ]]; then |
161 |
- eshopts_push -s extglob |
162 |
- if is-flagq '-g?(gdb)?([1-9])'; then |
163 |
- ewarn |
164 |
- ewarn "You have enabled debug info (probably have -g or -ggdb in your CFLAGS/CXXFLAGS)." |
165 |
- ewarn "You may experience really long compilation times and/or increased memory usage." |
166 |
- ewarn "If compilation fails, please try removing -g/-ggdb before reporting a bug." |
167 |
- ewarn |
168 |
- fi |
169 |
- eshopts_pop |
170 |
- fi |
171 |
- |
172 |
- case ${QT5_BUILD_TYPE} in |
173 |
- live) git-r3_src_unpack ;; |
174 |
- release) default ;; |
175 |
- esac |
176 |
-} |
177 |
- |
178 |
-# @FUNCTION: qt5-build_src_prepare |
179 |
-# @DESCRIPTION: |
180 |
-# Prepares the environment and patches the sources if necessary. |
181 |
-qt5-build_src_prepare() { |
182 |
- qt5_prepare_env |
183 |
- |
184 |
- if [[ ${QT5_MODULE} == qtbase ]]; then |
185 |
- qt5_symlink_tools_to_build_dir |
186 |
- |
187 |
- # Avoid unnecessary qmake recompilations |
188 |
- if [[ ${QT5_MINOR_VERSION} -ge 8 ]]; then |
189 |
- sed -i -e "/Creating qmake/i if [ '!' -e \"\$outpath/bin/qmake\" ]; then" \ |
190 |
- -e '/echo "Done."/a fi' \ |
191 |
- configure || die "sed failed (skip qmake bootstrap)" |
192 |
- else |
193 |
- sed -i -re "s|^if true;.*(\[ '\!').*(\"\\\$outpath/bin/qmake\".*)|if \1 -e \2 then|" \ |
194 |
- configure || die "sed failed (skip qmake bootstrap)" |
195 |
- fi |
196 |
- |
197 |
- # Respect CC, CXX, *FLAGS, MAKEOPTS and EXTRA_EMAKE when bootstrapping qmake |
198 |
- sed -i -e "/outpath\/qmake\".*\"\$MAKE\")/ s:): \ |
199 |
- ${MAKEOPTS} ${EXTRA_EMAKE} 'CC=$(tc-getCC)' 'CXX=$(tc-getCXX)' \ |
200 |
- 'QMAKE_CFLAGS=${CFLAGS}' 'QMAKE_CXXFLAGS=${CXXFLAGS}' 'QMAKE_LFLAGS=${LDFLAGS}'&:" \ |
201 |
- -e 's/\(setBootstrapVariable\s\+\|EXTRA_C\(XX\)\?FLAGS=.*\)QMAKE_C\(XX\)\?FLAGS_\(DEBUG\|RELEASE\).*/:/' \ |
202 |
- configure || die "sed failed (respect env for qmake build)" |
203 |
- sed -i -e '/^CPPFLAGS\s*=/ s/-g //' \ |
204 |
- qmake/Makefile.unix || die "sed failed (CPPFLAGS for qmake build)" |
205 |
- |
206 |
- # Respect CXX in bsymbolic_functions, fvisibility, precomp, and a few other tests |
207 |
- sed -i -e "/^QMAKE_CONF_COMPILER=/ s:=.*:=\"$(tc-getCXX)\":" \ |
208 |
- configure || die "sed failed (QMAKE_CONF_COMPILER)" |
209 |
- |
210 |
- if [[ ${QT5_MINOR_VERSION} -le 7 ]]; then |
211 |
- # Respect toolchain and flags in config.tests |
212 |
- find config.tests/unix -name '*.test' -type f -execdir \ |
213 |
- sed -i -e 's/-nocache //' '{}' + || die |
214 |
- fi |
215 |
- |
216 |
- # Don't inject -msse/-mavx/... into CXXFLAGS when detecting |
217 |
- # compiler support for extended instruction sets (bug 552942) |
218 |
- find config.tests/common -name '*.pro' -type f -execdir \ |
219 |
- sed -i -e '/QMAKE_CXXFLAGS\s*+=/ d' '{}' + || die |
220 |
- |
221 |
- # Don't add -O3 to CXXFLAGS (bug 549140) |
222 |
- sed -i -e '/CONFIG\s*+=/ s/optimize_full//' \ |
223 |
- src/{corelib/corelib,gui/gui}.pro || die "sed failed (optimize_full)" |
224 |
- fi |
225 |
- |
226 |
- default |
227 |
-} |
228 |
- |
229 |
-# @FUNCTION: qt5-build_src_configure |
230 |
-# @DESCRIPTION: |
231 |
-# Runs qmake in the target directories. For packages |
232 |
-# in qtbase, ./configure is also run before qmake. |
233 |
-qt5-build_src_configure() { |
234 |
- if [[ ${QT5_MODULE} == qtbase ]]; then |
235 |
- qt5_base_configure |
236 |
- fi |
237 |
- |
238 |
- qt5_foreach_target_subdir qt5_qmake |
239 |
-} |
240 |
- |
241 |
-# @FUNCTION: qt5-build_src_compile |
242 |
-# @DESCRIPTION: |
243 |
-# Runs emake in the target directories. |
244 |
-qt5-build_src_compile() { |
245 |
- qt5_foreach_target_subdir emake |
246 |
-} |
247 |
- |
248 |
-# @FUNCTION: qt5-build_src_test |
249 |
-# @DESCRIPTION: |
250 |
-# Runs tests in the target directories. |
251 |
-qt5-build_src_test() { |
252 |
- # disable broken cmake tests (bug 474004) |
253 |
- local myqmakeargs=("${myqmakeargs[@]}" -after SUBDIRS-=cmake SUBDIRS-=installed_cmake) |
254 |
- |
255 |
- qt5_foreach_target_subdir qt5_qmake |
256 |
- qt5_foreach_target_subdir emake |
257 |
- |
258 |
- # create a custom testrunner script that correctly sets |
259 |
- # LD_LIBRARY_PATH before executing the given test |
260 |
- local testrunner=${QT5_BUILD_DIR}/gentoo-testrunner |
261 |
- cat > "${testrunner}" <<-_EOF_ || die |
262 |
- #!/bin/sh |
263 |
- export LD_LIBRARY_PATH="${QT5_BUILD_DIR}/lib:${QT5_LIBDIR}" |
264 |
- "\$@" |
265 |
- _EOF_ |
266 |
- chmod +x "${testrunner}" |
267 |
- |
268 |
- set -- qt5_foreach_target_subdir emake TESTRUNNER="'${testrunner}'" check |
269 |
- if [[ ${VIRTUALX_REQUIRED} == test ]]; then |
270 |
- virtx "$@" |
271 |
- else |
272 |
- "$@" |
273 |
- fi |
274 |
-} |
275 |
- |
276 |
-# @FUNCTION: qt5-build_src_install |
277 |
-# @DESCRIPTION: |
278 |
-# Runs emake install in the target directories. |
279 |
-qt5-build_src_install() { |
280 |
- qt5_foreach_target_subdir emake INSTALL_ROOT="${D}" install |
281 |
- |
282 |
- if [[ ${PN} == qtcore ]]; then |
283 |
- pushd "${QT5_BUILD_DIR}" >/dev/null || die |
284 |
- |
285 |
- set -- emake INSTALL_ROOT="${D}" \ |
286 |
- sub-qmake-qmake-aux-pro-install_subtargets \ |
287 |
- install_{syncqt,mkspecs} |
288 |
- |
289 |
- einfo "Running $*" |
290 |
- "$@" |
291 |
- |
292 |
- popd >/dev/null || die |
293 |
- |
294 |
- docompress -x "${QT5_DOCDIR#${EPREFIX}}"/global |
295 |
- |
296 |
- # install an empty Gentoo/gentoo-qconfig.h in ${D} |
297 |
- # so that it's placed under package manager control |
298 |
- > "${T}"/gentoo-qconfig.h |
299 |
- ( |
300 |
- insinto "${QT5_HEADERDIR#${EPREFIX}}"/Gentoo |
301 |
- doins "${T}"/gentoo-qconfig.h |
302 |
- ) |
303 |
- |
304 |
- # include gentoo-qconfig.h at the beginning of QtCore/qconfig.h |
305 |
- sed -i -e '1i #include <Gentoo/gentoo-qconfig.h>\n' \ |
306 |
- "${D}${QT5_HEADERDIR}"/QtCore/qconfig.h \ |
307 |
- || die "sed failed (qconfig.h)" |
308 |
- |
309 |
- # install qtchooser configuration file |
310 |
- cat > "${T}/qt5-${CHOST}.conf" <<-_EOF_ || die |
311 |
- ${QT5_BINDIR} |
312 |
- ${QT5_LIBDIR} |
313 |
- _EOF_ |
314 |
- |
315 |
- ( |
316 |
- insinto /etc/xdg/qtchooser |
317 |
- doins "${T}/qt5-${CHOST}.conf" |
318 |
- ) |
319 |
- |
320 |
- # convenience symlinks |
321 |
- dosym qt5-"${CHOST}".conf /etc/xdg/qtchooser/5.conf |
322 |
- dosym qt5-"${CHOST}".conf /etc/xdg/qtchooser/qt5.conf |
323 |
- fi |
324 |
- |
325 |
- qt5_install_module_qconfigs |
326 |
- prune_libtool_files |
327 |
-} |
328 |
- |
329 |
-# @FUNCTION: qt5-build_pkg_postinst |
330 |
-# @DESCRIPTION: |
331 |
-# Regenerate configuration after installation or upgrade/downgrade. |
332 |
-qt5-build_pkg_postinst() { |
333 |
- qt5_regenerate_global_qconfigs |
334 |
-} |
335 |
- |
336 |
-# @FUNCTION: qt5-build_pkg_postrm |
337 |
-# @DESCRIPTION: |
338 |
-# Regenerate configuration when a module is completely removed. |
339 |
-qt5-build_pkg_postrm() { |
340 |
- if [[ -z ${REPLACED_BY_VERSION} && ${PN} != qtcore ]]; then |
341 |
- qt5_regenerate_global_qconfigs |
342 |
- fi |
343 |
-} |
344 |
- |
345 |
- |
346 |
-###### Public helpers ###### |
347 |
- |
348 |
-# @FUNCTION: qt_use |
349 |
-# @USAGE: <flag> [feature] [enableval] |
350 |
-# @DESCRIPTION: |
351 |
-# <flag> is the name of a flag in IUSE. |
352 |
-# |
353 |
-# Outputs "-${enableval}-${feature}" if <flag> is enabled, "-no-${feature}" |
354 |
-# otherwise. If [feature] is not specified, <flag> is used in its place. |
355 |
-# If [enableval] is not specified, the "-${enableval}" prefix is omitted. |
356 |
-qt_use() { |
357 |
- [[ $# -ge 1 ]] || die "${FUNCNAME}() requires at least one argument" |
358 |
- |
359 |
- usex "$1" "${3:+-$3}-${2:-$1}" "-no-${2:-$1}" |
360 |
-} |
361 |
- |
362 |
-# @FUNCTION: qt_use_compile_test |
363 |
-# @USAGE: <flag> [config] |
364 |
-# @DESCRIPTION: |
365 |
-# <flag> is the name of a flag in IUSE. |
366 |
-# [config] is the argument of qtCompileTest, defaults to <flag>. |
367 |
-# |
368 |
-# This function is useful to disable optional dependencies that are checked |
369 |
-# at qmake-time using the qtCompileTest() function. If <flag> is disabled, |
370 |
-# the compile test is skipped and the dependency is assumed to be unavailable, |
371 |
-# i.e. the corresponding feature will be disabled. Note that all invocations |
372 |
-# of this function must happen before calling qt5-build_src_configure. |
373 |
-qt_use_compile_test() { |
374 |
- [[ $# -ge 1 ]] || die "${FUNCNAME}() requires at least one argument" |
375 |
- |
376 |
- if ! use "$1"; then |
377 |
- mkdir -p "${QT5_BUILD_DIR}" || die |
378 |
- echo "CONFIG += done_config_${2:-$1}" >> "${QT5_BUILD_DIR}"/.qmake.cache || die |
379 |
- fi |
380 |
-} |
381 |
- |
382 |
-# @FUNCTION: qt_use_disable_config |
383 |
-# @USAGE: <flag> <config> <files...> |
384 |
-# @DESCRIPTION: |
385 |
-# <flag> is the name of a flag in IUSE. |
386 |
-# <config> is the (lowercase) name of a Qt5 config entry. |
387 |
-# <files...> is a list of one or more qmake project files. |
388 |
-# |
389 |
-# This function patches <files> to treat <config> as disabled |
390 |
-# when <flag> is disabled, otherwise it does nothing. |
391 |
-# This can be useful to avoid an automagic dependency when the config entry |
392 |
-# is enabled on the system but the corresponding USE flag is disabled. |
393 |
-qt_use_disable_config() { |
394 |
- [[ $# -ge 3 ]] || die "${FUNCNAME}() requires at least three arguments" |
395 |
- |
396 |
- local flag=$1 |
397 |
- local config=$2 |
398 |
- shift 2 |
399 |
- |
400 |
- if ! use "${flag}"; then |
401 |
- echo "$@" | xargs sed -i -e "s/qtConfig(${config})/false/g" || die |
402 |
- fi |
403 |
-} |
404 |
- |
405 |
-# @FUNCTION: qt_use_disable_mod |
406 |
-# @USAGE: <flag> <module> <files...> |
407 |
-# @DESCRIPTION: |
408 |
-# <flag> is the name of a flag in IUSE. |
409 |
-# <module> is the (lowercase) name of a Qt5 module. |
410 |
-# <files...> is a list of one or more qmake project files. |
411 |
-# |
412 |
-# This function patches <files> to treat <module> as not installed |
413 |
-# when <flag> is disabled, otherwise it does nothing. |
414 |
-# This can be useful to avoid an automagic dependency when the module |
415 |
-# is present on the system but the corresponding USE flag is disabled. |
416 |
-qt_use_disable_mod() { |
417 |
- [[ $# -ge 3 ]] || die "${FUNCNAME}() requires at least three arguments" |
418 |
- |
419 |
- local flag=$1 |
420 |
- local module=$2 |
421 |
- shift 2 |
422 |
- |
423 |
- if ! use "${flag}"; then |
424 |
- echo "$@" | xargs sed -i -e "s/qtHaveModule(${module})/false/g" || die |
425 |
- fi |
426 |
-} |
427 |
- |
428 |
- |
429 |
-###### Internal functions ###### |
430 |
- |
431 |
-# @FUNCTION: qt5_prepare_env |
432 |
-# @INTERNAL |
433 |
-# @DESCRIPTION: |
434 |
-# Prepares the environment for building Qt. |
435 |
-qt5_prepare_env() { |
436 |
- # setup installation directories |
437 |
- # note: keep paths in sync with qmake-utils.eclass |
438 |
- QT5_PREFIX=${EPREFIX}/usr |
439 |
- QT5_HEADERDIR=${QT5_PREFIX}/include/qt5 |
440 |
- QT5_LIBDIR=${QT5_PREFIX}/$(get_libdir) |
441 |
- QT5_ARCHDATADIR=${QT5_PREFIX}/$(get_libdir)/qt5 |
442 |
- QT5_BINDIR=${QT5_ARCHDATADIR}/bin |
443 |
- QT5_PLUGINDIR=${QT5_ARCHDATADIR}/plugins |
444 |
- QT5_LIBEXECDIR=${QT5_ARCHDATADIR}/libexec |
445 |
- QT5_IMPORTDIR=${QT5_ARCHDATADIR}/imports |
446 |
- QT5_QMLDIR=${QT5_ARCHDATADIR}/qml |
447 |
- QT5_DATADIR=${QT5_PREFIX}/share/qt5 |
448 |
- QT5_DOCDIR=${QT5_PREFIX}/share/doc/qt-${PV} |
449 |
- QT5_TRANSLATIONDIR=${QT5_DATADIR}/translations |
450 |
- QT5_EXAMPLESDIR=${QT5_DATADIR}/examples |
451 |
- QT5_TESTSDIR=${QT5_DATADIR}/tests |
452 |
- QT5_SYSCONFDIR=${EPREFIX}/etc/xdg |
453 |
- readonly QT5_PREFIX QT5_HEADERDIR QT5_LIBDIR QT5_ARCHDATADIR \ |
454 |
- QT5_BINDIR QT5_PLUGINDIR QT5_LIBEXECDIR QT5_IMPORTDIR \ |
455 |
- QT5_QMLDIR QT5_DATADIR QT5_DOCDIR QT5_TRANSLATIONDIR \ |
456 |
- QT5_EXAMPLESDIR QT5_TESTSDIR QT5_SYSCONFDIR |
457 |
- |
458 |
- if [[ ${QT5_MODULE} == qtbase ]]; then |
459 |
- # see mkspecs/features/qt_config.prf |
460 |
- export QMAKEMODULES="${QT5_BUILD_DIR}/mkspecs/modules:${S}/mkspecs/modules:${QT5_ARCHDATADIR}/mkspecs/modules" |
461 |
- fi |
462 |
-} |
463 |
- |
464 |
-# @FUNCTION: qt5_foreach_target_subdir |
465 |
-# @INTERNAL |
466 |
-# @DESCRIPTION: |
467 |
-# Executes the command given as argument from inside each directory |
468 |
-# listed in QT5_TARGET_SUBDIRS. Handles autotests subdirs automatically. |
469 |
-qt5_foreach_target_subdir() { |
470 |
- [[ -z ${QT5_TARGET_SUBDIRS[@]} ]] && QT5_TARGET_SUBDIRS=("") |
471 |
- |
472 |
- local subdir= |
473 |
- for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do |
474 |
- if [[ ${EBUILD_PHASE} == test ]]; then |
475 |
- subdir=tests/auto${subdir#src} |
476 |
- [[ -d ${S}/${subdir} ]] || continue |
477 |
- fi |
478 |
- |
479 |
- local msg="Running $* ${subdir:+in ${subdir}}" |
480 |
- einfo "${msg}" |
481 |
- |
482 |
- mkdir -p "${QT5_BUILD_DIR}/${subdir}" || die -n || return $? |
483 |
- pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die -n || return $? |
484 |
- |
485 |
- "$@" || die -n "${msg} failed" || return $? |
486 |
- |
487 |
- popd >/dev/null || die -n || return $? |
488 |
- done |
489 |
-} |
490 |
- |
491 |
-# @FUNCTION: qt5_symlink_tools_to_build_dir |
492 |
-# @INTERNAL |
493 |
-# @DESCRIPTION: |
494 |
-# Symlinks qmake and a few other tools to QT5_BUILD_DIR, |
495 |
-# so that they can be used when building other modules. |
496 |
-qt5_symlink_tools_to_build_dir() { |
497 |
- local tool= tools=() |
498 |
- if [[ ${PN} != qtcore ]]; then |
499 |
- tools+=(qmake moc rcc qlalr) |
500 |
- [[ ${PN} != qtdbus ]] && tools+=(qdbuscpp2xml qdbusxml2cpp) |
501 |
- [[ ${PN} != qtwidgets ]] && tools+=(uic) |
502 |
- fi |
503 |
- |
504 |
- mkdir -p "${QT5_BUILD_DIR}"/bin || die |
505 |
- pushd "${QT5_BUILD_DIR}"/bin >/dev/null || die |
506 |
- |
507 |
- for tool in "${tools[@]}"; do |
508 |
- [[ -e ${QT5_BINDIR}/${tool} ]] || continue |
509 |
- ln -s "${QT5_BINDIR}/${tool}" . || die "failed to symlink ${tool}" |
510 |
- done |
511 |
- |
512 |
- popd >/dev/null || die |
513 |
-} |
514 |
- |
515 |
-# @FUNCTION: qt5_base_configure |
516 |
-# @INTERNAL |
517 |
-# @DESCRIPTION: |
518 |
-# Runs ./configure for modules belonging to qtbase. |
519 |
-qt5_base_configure() { |
520 |
- # setup toolchain variables used by configure |
521 |
- tc-export AR CC CXX OBJDUMP RANLIB STRIP |
522 |
- export LD="$(tc-getCXX)" |
523 |
- |
524 |
- # bug 633838 |
525 |
- if [[ ${QT5_MINOR_VERSION} -ge 9 ]]; then |
526 |
- unset QMAKESPEC XQMAKESPEC QMAKEPATH QMAKEFEATURES |
527 |
- fi |
528 |
- |
529 |
- # configure arguments |
530 |
- local conf=( |
531 |
- # installation paths |
532 |
- -prefix "${QT5_PREFIX}" |
533 |
- -bindir "${QT5_BINDIR}" |
534 |
- -headerdir "${QT5_HEADERDIR}" |
535 |
- -libdir "${QT5_LIBDIR}" |
536 |
- -archdatadir "${QT5_ARCHDATADIR}" |
537 |
- -plugindir "${QT5_PLUGINDIR}" |
538 |
- -libexecdir "${QT5_LIBEXECDIR}" |
539 |
- -importdir "${QT5_IMPORTDIR}" |
540 |
- -qmldir "${QT5_QMLDIR}" |
541 |
- -datadir "${QT5_DATADIR}" |
542 |
- -docdir "${QT5_DOCDIR}" |
543 |
- -translationdir "${QT5_TRANSLATIONDIR}" |
544 |
- -sysconfdir "${QT5_SYSCONFDIR}" |
545 |
- -examplesdir "${QT5_EXAMPLESDIR}" |
546 |
- -testsdir "${QT5_TESTSDIR}" |
547 |
- |
548 |
- # configure in release mode by default, |
549 |
- # override via the CONFIG qmake variable |
550 |
- -release |
551 |
- -no-separate-debug-info |
552 |
- |
553 |
- # no need to forcefully build host tools in optimized mode, |
554 |
- # just follow the overall debug/release build type |
555 |
- -no-optimized-tools |
556 |
- |
557 |
- # licensing stuff |
558 |
- -opensource -confirm-license |
559 |
- |
560 |
- # autodetect the highest supported version of the C++ standard |
561 |
- #-c++std <c++11|c++14|c++1z> |
562 |
- |
563 |
- # build shared libraries |
564 |
- -shared |
565 |
- |
566 |
- # always enable large file support |
567 |
- $([[ ${QT5_MINOR_VERSION} -lt 8 ]] && echo -largefile) |
568 |
- |
569 |
- # disabling accessibility is not recommended by upstream, as |
570 |
- # it will break QStyle and may break other internal parts of Qt |
571 |
- -accessibility |
572 |
- |
573 |
- # disable all SQL drivers by default, override in qtsql |
574 |
- -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc |
575 |
- -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-sql-tds |
576 |
- |
577 |
- # ensure the QML debugging support (qmltooling) is built in qtdeclarative |
578 |
- -qml-debug |
579 |
- |
580 |
- # MIPS DSP instruction set extensions |
581 |
- $(is-flagq -mno-dsp && echo -no-mips_dsp) |
582 |
- $(is-flagq -mno-dspr2 && echo -no-mips_dspr2) |
583 |
- |
584 |
- # use pkg-config to detect include and library paths |
585 |
- -pkg-config |
586 |
- |
587 |
- # prefer system libraries (only common hard deps here) |
588 |
- -system-zlib |
589 |
- -system-pcre |
590 |
- -system-doubleconversion |
591 |
- |
592 |
- # disable everything to prevent automagic deps (part 1) |
593 |
- -no-mtdev |
594 |
- -no-journald -no-syslog |
595 |
- -no-libpng -no-libjpeg |
596 |
- -no-freetype -no-harfbuzz |
597 |
- -no-openssl -no-libproxy |
598 |
- -no-xkbcommon-x11 -no-xkbcommon-evdev |
599 |
- -no-xinput2 -no-xcb-xlib |
600 |
- |
601 |
- # cannot use -no-gif because there is no way to override it later |
602 |
- #-no-gif |
603 |
- |
604 |
- # always enable glib event loop support |
605 |
- -glib |
606 |
- |
607 |
- # disable everything to prevent automagic deps (part 2) |
608 |
- -no-gtk |
609 |
- $([[ ${QT5_MINOR_VERSION} -lt 8 ]] && echo -no-pulseaudio -no-alsa) |
610 |
- |
611 |
- # exclude examples and tests from default build |
612 |
- -nomake examples |
613 |
- -nomake tests |
614 |
- -no-compile-examples |
615 |
- |
616 |
- # disable rpath on non-prefix (bugs 380415 and 417169) |
617 |
- $(usex prefix '' -no-rpath) |
618 |
- |
619 |
- # print verbose information about each configure test |
620 |
- -verbose |
621 |
- |
622 |
- # always enable iconv support |
623 |
- # since 5.8 this is handled in qtcore |
624 |
- $([[ ${QT5_MINOR_VERSION} -lt 8 ]] && echo -iconv) |
625 |
- |
626 |
- # disable everything to prevent automagic deps (part 3) |
627 |
- -no-cups -no-evdev -no-tslib -no-icu -no-fontconfig -no-dbus |
628 |
- |
629 |
- # let portage handle stripping |
630 |
- -no-strip |
631 |
- |
632 |
- # precompiled headers can cause problems on hardened, so turn them off |
633 |
- -no-pch |
634 |
- |
635 |
- # link-time code generation is not something we want to enable by default |
636 |
- -no-ltcg |
637 |
- |
638 |
- # reduced relocations cause major breakage on at least arm and ppc, so |
639 |
- # don't specify anything and let the configure figure out if they are |
640 |
- # supported; see also https://bugreports.qt.io/browse/QTBUG-36129 |
641 |
- #-reduce-relocations |
642 |
- |
643 |
- # let configure automatically detect if GNU gold is available |
644 |
- -no-use-gold-linker |
645 |
- |
646 |
- # disable all platform plugins by default, override in qtgui |
647 |
- -no-xcb -no-eglfs -no-kms -no-gbm -no-directfb -no-linuxfb -no-mirclient |
648 |
- |
649 |
- # disable undocumented X11-related flags, override in qtgui |
650 |
- # (not shown in ./configure -help output) |
651 |
- -no-xkb |
652 |
- $([[ ${QT5_MINOR_VERSION} -lt 8 ]] && echo -no-xrender) |
653 |
- |
654 |
- # disable obsolete/unused X11-related flags |
655 |
- $([[ ${QT5_MINOR_VERSION} -lt 8 ]] && echo -no-mitshm -no-xcursor -no-xfixes -no-xrandr -no-xshape -no-xsync) |
656 |
- |
657 |
- # always enable session management support: it doesn't need extra deps |
658 |
- # at configure time and turning it off is dangerous, see bug 518262 |
659 |
- -sm |
660 |
- |
661 |
- # typedef qreal to double (warning: changing this flag breaks the ABI) |
662 |
- -qreal double |
663 |
- |
664 |
- # disable OpenGL and EGL support by default, override in qtgui, |
665 |
- # qtopengl, qtprintsupport and qtwidgets |
666 |
- -no-opengl -no-egl |
667 |
- |
668 |
- # disable libinput-based generic plugin by default, override in qtgui |
669 |
- -no-libinput |
670 |
- |
671 |
- # disable gstreamer by default, override in qtmultimedia |
672 |
- $([[ ${QT5_MINOR_VERSION} -lt 8 ]] && echo -no-gstreamer) |
673 |
- |
674 |
- # respect system proxies by default: it's the most natural |
675 |
- # setting, and it'll become the new upstream default in 5.8 |
676 |
- -system-proxies |
677 |
- |
678 |
- # do not build with -Werror |
679 |
- -no-warnings-are-errors |
680 |
- |
681 |
- # module-specific options |
682 |
- "${myconf[@]}" |
683 |
- ) |
684 |
- |
685 |
- pushd "${QT5_BUILD_DIR}" >/dev/null || die |
686 |
- |
687 |
- einfo "Configuring with: ${conf[@]}" |
688 |
- "${S}"/configure "${conf[@]}" || die "configure failed" |
689 |
- |
690 |
- if [[ ${QT5_MINOR_VERSION} -ge 8 ]]; then |
691 |
- # a forwarding header is no longer created since 5.8, causing the system |
692 |
- # config to always be used. bug 599636 |
693 |
- cp src/corelib/global/qconfig.h include/QtCore/ || die |
694 |
- fi |
695 |
- |
696 |
- popd >/dev/null || die |
697 |
- |
698 |
-} |
699 |
- |
700 |
-# @FUNCTION: qt5_qmake |
701 |
-# @INTERNAL |
702 |
-# @DESCRIPTION: |
703 |
-# Helper function that runs qmake in the current target subdir. |
704 |
-# Intended to be called by qt5_foreach_target_subdir(). |
705 |
-qt5_qmake() { |
706 |
- local projectdir=${PWD/#${QT5_BUILD_DIR}/${S}} |
707 |
- local qmakepath= |
708 |
- if [[ ${QT5_MODULE} == qtbase ]]; then |
709 |
- qmakepath=${QT5_BUILD_DIR}/bin |
710 |
- else |
711 |
- qmakepath=${QT5_BINDIR} |
712 |
- fi |
713 |
- |
714 |
- "${qmakepath}"/qmake \ |
715 |
- "${projectdir}" \ |
716 |
- CONFIG+=$(usex debug debug release) \ |
717 |
- CONFIG-=$(usex debug release debug) \ |
718 |
- QMAKE_AR="$(tc-getAR) cqs" \ |
719 |
- QMAKE_CC="$(tc-getCC)" \ |
720 |
- QMAKE_LINK_C="$(tc-getCC)" \ |
721 |
- QMAKE_LINK_C_SHLIB="$(tc-getCC)" \ |
722 |
- QMAKE_CXX="$(tc-getCXX)" \ |
723 |
- QMAKE_LINK="$(tc-getCXX)" \ |
724 |
- QMAKE_LINK_SHLIB="$(tc-getCXX)" \ |
725 |
- QMAKE_OBJCOPY="$(tc-getOBJCOPY)" \ |
726 |
- QMAKE_RANLIB= \ |
727 |
- QMAKE_STRIP="$(tc-getSTRIP)" \ |
728 |
- QMAKE_CFLAGS="${CFLAGS}" \ |
729 |
- QMAKE_CFLAGS_RELEASE= \ |
730 |
- QMAKE_CFLAGS_DEBUG= \ |
731 |
- QMAKE_CXXFLAGS="${CXXFLAGS}" \ |
732 |
- QMAKE_CXXFLAGS_RELEASE= \ |
733 |
- QMAKE_CXXFLAGS_DEBUG= \ |
734 |
- QMAKE_LFLAGS="${LDFLAGS}" \ |
735 |
- QMAKE_LFLAGS_RELEASE= \ |
736 |
- QMAKE_LFLAGS_DEBUG= \ |
737 |
- "${myqmakeargs[@]}" \ |
738 |
- || die "qmake failed (${projectdir#${S}/})" |
739 |
-} |
740 |
- |
741 |
-# @FUNCTION: qt5_install_module_qconfigs |
742 |
-# @INTERNAL |
743 |
-# @DESCRIPTION: |
744 |
-# Creates and installs gentoo-specific ${PN}-qconfig.{h,pri} files. |
745 |
-qt5_install_module_qconfigs() { |
746 |
- local x qconfig_add= qconfig_remove= |
747 |
- |
748 |
- > "${T}"/${PN}-qconfig.h |
749 |
- > "${T}"/${PN}-qconfig.pri |
750 |
- |
751 |
- # generate qconfig_{add,remove} and ${PN}-qconfig.h |
752 |
- for x in "${QT5_GENTOO_CONFIG[@]}"; do |
753 |
- local flag=${x%%:*} |
754 |
- x=${x#${flag}:} |
755 |
- local feature=${x%%:*} |
756 |
- x=${x#${feature}:} |
757 |
- local macro=${x} |
758 |
- macro=$(tr 'a-z-' 'A-Z_' <<< "${macro}") |
759 |
- |
760 |
- if [[ -z ${flag} ]] || { [[ ${flag} != '!' ]] && use ${flag}; }; then |
761 |
- [[ -n ${feature} ]] && qconfig_add+=" ${feature}" |
762 |
- [[ -n ${macro} ]] && echo "#define QT_${macro}" >> "${T}"/${PN}-qconfig.h |
763 |
- else |
764 |
- [[ -n ${feature} ]] && qconfig_remove+=" ${feature}" |
765 |
- [[ -n ${macro} ]] && echo "#define QT_NO_${macro}" >> "${T}"/${PN}-qconfig.h |
766 |
- fi |
767 |
- done |
768 |
- |
769 |
- # install ${PN}-qconfig.h |
770 |
- [[ -s ${T}/${PN}-qconfig.h ]] && ( |
771 |
- insinto "${QT5_HEADERDIR#${EPREFIX}}"/Gentoo |
772 |
- doins "${T}"/${PN}-qconfig.h |
773 |
- ) |
774 |
- |
775 |
- # generate and install ${PN}-qconfig.pri |
776 |
- [[ -n ${qconfig_add} ]] && echo "QCONFIG_ADD=${qconfig_add}" >> "${T}"/${PN}-qconfig.pri |
777 |
- [[ -n ${qconfig_remove} ]] && echo "QCONFIG_REMOVE=${qconfig_remove}" >> "${T}"/${PN}-qconfig.pri |
778 |
- [[ -s ${T}/${PN}-qconfig.pri ]] && ( |
779 |
- insinto "${QT5_ARCHDATADIR#${EPREFIX}}"/mkspecs/gentoo |
780 |
- doins "${T}"/${PN}-qconfig.pri |
781 |
- ) |
782 |
-} |
783 |
- |
784 |
-# @FUNCTION: qt5_regenerate_global_qconfigs |
785 |
-# @INTERNAL |
786 |
-# @DESCRIPTION: |
787 |
-# Generates Gentoo-specific qconfig.{h,pri} according to the build configuration. |
788 |
-# Don't call die here because dying in pkg_post{inst,rm} only makes things worse. |
789 |
-qt5_regenerate_global_qconfigs() { |
790 |
- einfo "Regenerating gentoo-qconfig.h" |
791 |
- |
792 |
- find "${ROOT%/}${QT5_HEADERDIR}"/Gentoo \ |
793 |
- -name '*-qconfig.h' -a \! -name 'gentoo-qconfig.h' -type f \ |
794 |
- -execdir cat '{}' + | sort -u > "${T}"/gentoo-qconfig.h |
795 |
- |
796 |
- [[ -s ${T}/gentoo-qconfig.h ]] || ewarn "Generated gentoo-qconfig.h is empty" |
797 |
- mv -f "${T}"/gentoo-qconfig.h "${ROOT%/}${QT5_HEADERDIR}"/Gentoo/gentoo-qconfig.h \ |
798 |
- || eerror "Failed to install new gentoo-qconfig.h" |
799 |
- |
800 |
- einfo "Updating QT_CONFIG in qconfig.pri" |
801 |
- |
802 |
- local qconfig_pri=${ROOT%/}${QT5_ARCHDATADIR}/mkspecs/qconfig.pri |
803 |
- if [[ -f ${qconfig_pri} ]]; then |
804 |
- local x qconfig_add= qconfig_remove= |
805 |
- local qt_config=$(sed -n 's/^QT_CONFIG\s*+=\s*//p' "${qconfig_pri}") |
806 |
- local new_qt_config= |
807 |
- |
808 |
- # generate list of QT_CONFIG entries from the existing list, |
809 |
- # appending QCONFIG_ADD and excluding QCONFIG_REMOVE |
810 |
- eshopts_push -s nullglob |
811 |
- for x in "${ROOT%/}${QT5_ARCHDATADIR}"/mkspecs/gentoo/*-qconfig.pri; do |
812 |
- qconfig_add+=" $(sed -n 's/^QCONFIG_ADD=\s*//p' "${x}")" |
813 |
- qconfig_remove+=" $(sed -n 's/^QCONFIG_REMOVE=\s*//p' "${x}")" |
814 |
- done |
815 |
- eshopts_pop |
816 |
- for x in ${qt_config} ${qconfig_add}; do |
817 |
- if ! has "${x}" ${new_qt_config} ${qconfig_remove}; then |
818 |
- new_qt_config+=" ${x}" |
819 |
- fi |
820 |
- done |
821 |
- |
822 |
- # now replace the existing QT_CONFIG with the generated list |
823 |
- sed -i -e "s/^QT_CONFIG\s*+=.*/QT_CONFIG +=${new_qt_config}/" \ |
824 |
- "${qconfig_pri}" || eerror "Failed to sed QT_CONFIG in ${qconfig_pri}" |
825 |
- else |
826 |
- ewarn "${qconfig_pri} does not exist or is not a regular file" |
827 |
- fi |
828 |
-} |