1 |
commit: 2b134e09a3ab94f3c33419cf0b8114d004cec477 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jan 4 21:07:49 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 4 21:07:58 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b134e09 |
7 |
|
8 |
dev-qt/qtwebengine: add check-reqs for disk space and memory usage |
9 |
|
10 |
For now, assumes: |
11 |
- RAM/memory: 2GB per job for GCC, 1.5GB per job for Clang |
12 |
- Disk (build): 7GB |
13 |
- Disk (installed): 150MB |
14 |
|
15 |
(Also moves pkg_preinst to the end of the ebuild to reflect |
16 |
phase execution order, as per devmanual.) |
17 |
|
18 |
Closes: https://bugs.gentoo.org/570534 |
19 |
Thanks-to: Ionen Wolkens <ionen <AT> gentoo.org> |
20 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
21 |
|
22 |
.../qtwebengine-5.15.2_p20211216.ebuild | 61 ++++++++++++++++------ |
23 |
1 file changed, 45 insertions(+), 16 deletions(-) |
24 |
|
25 |
diff --git a/dev-qt/qtwebengine/qtwebengine-5.15.2_p20211216.ebuild b/dev-qt/qtwebengine/qtwebengine-5.15.2_p20211216.ebuild |
26 |
index 7923a290ab0e..3baacbff39c9 100644 |
27 |
--- a/dev-qt/qtwebengine/qtwebengine-5.15.2_p20211216.ebuild |
28 |
+++ b/dev-qt/qtwebengine/qtwebengine-5.15.2_p20211216.ebuild |
29 |
@@ -5,7 +5,7 @@ EAPI=8 |
30 |
|
31 |
PYTHON_COMPAT=( python2_7 ) |
32 |
PYTHON_REQ_USE="xml(+)" |
33 |
-inherit estack flag-o-matic multiprocessing python-any-r1 qt5-build |
34 |
+inherit check-reqs estack flag-o-matic multiprocessing python-any-r1 qt5-build toolchain-funcs |
35 |
|
36 |
DESCRIPTION="Library for rendering dynamic web content in Qt5 C++ and QML applications" |
37 |
HOMEPAGE="https://www.qt.io/" |
38 |
@@ -110,29 +110,47 @@ PATCHES=( |
39 |
"${WORKDIR}/${PN}-5.15.2_p20211019-jumbo-build.patch" # bug 813957 |
40 |
) |
41 |
|
42 |
-pkg_preinst() { |
43 |
- elog "This version of Qt WebEngine is based on Chromium version 87.0.4280, with" |
44 |
- elog "additional security fixes from newer versions. Extensive as it is, the" |
45 |
- elog "list of backports is impossible to evaluate, but always bound to be behind" |
46 |
- elog "Chromium's release schedule." |
47 |
- elog "In addition, various online services may deny service based on an outdated" |
48 |
- elog "user agent version (and/or other checks). Google is already known to do so." |
49 |
- elog |
50 |
- elog "tldr: Your web browsing experience will be compromised." |
51 |
-} |
52 |
- |
53 |
-src_unpack() { |
54 |
- # bug 307861 |
55 |
+qtwebengine_check-reqs() { |
56 |
+ # bug #307861 |
57 |
eshopts_push -s extglob |
58 |
if is-flagq '-g?(gdb)?([1-9])'; then |
59 |
- ewarn |
60 |
ewarn "You have enabled debug info (probably have -g or -ggdb in your CFLAGS/CXXFLAGS)." |
61 |
ewarn "You may experience really long compilation times and/or increased memory usage." |
62 |
ewarn "If compilation fails, please try removing -g/-ggdb before reporting a bug." |
63 |
- ewarn |
64 |
fi |
65 |
eshopts_pop |
66 |
|
67 |
+ [[ ${MERGE_TYPE} == binary ]] && return |
68 |
+ |
69 |
+ # (check-reqs added for bug #570534) |
70 |
+ # |
71 |
+ # Estimate the amount of RAM required |
72 |
+ # Multiplier is *10 because Bash doesn't do floating point maths. |
73 |
+ # Let's crudely assume ~2GB per compiler job for GCC. |
74 |
+ local multiplier=20 |
75 |
+ |
76 |
+ # And call it ~1.5GB for Clang. |
77 |
+ if tc-is-clang ; then |
78 |
+ multiplier=15 |
79 |
+ fi |
80 |
+ |
81 |
+ local CHECKREQS_DISK_BUILD="7G" |
82 |
+ local CHECKREQS_DISK_USR="150M" |
83 |
+ local CHECKREQS_MEMORY=$(($(makeopts_jobs)*multiplier/10))G |
84 |
+ |
85 |
+ check-reqs_${EBUILD_PHASE_FUNC} |
86 |
+} |
87 |
+ |
88 |
+pkg_pretend() { |
89 |
+ qtwebengine_check-reqs |
90 |
+} |
91 |
+ |
92 |
+pkg_setup() { |
93 |
+ qtwebengine_check-reqs |
94 |
+ python-any-r1_pkg_setup |
95 |
+} |
96 |
+ |
97 |
+src_unpack() { |
98 |
case ${QT5_BUILD_TYPE} in |
99 |
live) git-r3_src_unpack ;& |
100 |
release) default ;; |
101 |
@@ -231,3 +249,14 @@ src_install() { |
102 |
die "${CATEGORY}/${PF} failed to build anything. Please report to https://bugs.gentoo.org/" |
103 |
fi |
104 |
} |
105 |
+ |
106 |
+pkg_preinst() { |
107 |
+ elog "This version of Qt WebEngine is based on Chromium version 87.0.4280, with" |
108 |
+ elog "additional security fixes from newer versions. Extensive as it is, the" |
109 |
+ elog "list of backports is impossible to evaluate, but always bound to be behind" |
110 |
+ elog "Chromium's release schedule." |
111 |
+ elog "In addition, various online services may deny service based on an outdated" |
112 |
+ elog "user agent version (and/or other checks). Google is already known to do so." |
113 |
+ elog |
114 |
+ elog "tldr: Your web browsing experience will be compromised." |
115 |
+} |