1 |
commit: 3c4656a189e254231b94cef558530c42ea8db690 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed May 25 23:10:33 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed May 25 23:11:28 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c4656a1 |
7 |
|
8 |
dev-qt/qtcore: add FORTIFY_SOURCE=3 workaround (force back to =2) |
9 |
|
10 |
As discussed with asturm until we know what's happening with |
11 |
the upstream bug. We can consider the opensuse patch once |
12 |
that's resolved, if the upstream fix isn't made public, almost |
13 |
certainly via KDE Qt5PatchCollection. But we'll see. |
14 |
|
15 |
Closes: https://bugs.gentoo.org/847145 |
16 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
17 |
|
18 |
dev-qt/qtcore/qtcore-5.15.4-r1.ebuild | 121 ++++++++++++++++++++++++++++++++++ |
19 |
1 file changed, 121 insertions(+) |
20 |
|
21 |
diff --git a/dev-qt/qtcore/qtcore-5.15.4-r1.ebuild b/dev-qt/qtcore/qtcore-5.15.4-r1.ebuild |
22 |
new file mode 100644 |
23 |
index 000000000000..034469ed1e79 |
24 |
--- /dev/null |
25 |
+++ b/dev-qt/qtcore/qtcore-5.15.4-r1.ebuild |
26 |
@@ -0,0 +1,121 @@ |
27 |
+# Copyright 1999-2022 Gentoo Authors |
28 |
+# Distributed under the terms of the GNU General Public License v2 |
29 |
+ |
30 |
+EAPI=8 |
31 |
+ |
32 |
+QT5_KDEPATCHSET_REV=1 |
33 |
+QT5_MODULE="qtbase" |
34 |
+inherit linux-info flag-o-matic qt5-build |
35 |
+ |
36 |
+DESCRIPTION="Cross-platform application development framework" |
37 |
+SLOT=5/${QT5_PV} |
38 |
+ |
39 |
+if [[ ${QT5_BUILD_TYPE} == release ]]; then |
40 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86" |
41 |
+fi |
42 |
+ |
43 |
+IUSE="icu old-kernel systemd" |
44 |
+ |
45 |
+DEPEND=" |
46 |
+ dev-libs/double-conversion:= |
47 |
+ dev-libs/glib:2 |
48 |
+ dev-libs/libpcre2[pcre16,unicode] |
49 |
+ sys-libs/zlib:= |
50 |
+ icu? ( dev-libs/icu:= ) |
51 |
+ !icu? ( virtual/libiconv ) |
52 |
+ systemd? ( sys-apps/systemd:= ) |
53 |
+" |
54 |
+RDEPEND="${DEPEND}" |
55 |
+ |
56 |
+QT5_TARGET_SUBDIRS=( |
57 |
+ src/tools/bootstrap |
58 |
+ src/tools/moc |
59 |
+ src/tools/rcc |
60 |
+ src/corelib |
61 |
+ src/tools/qlalr |
62 |
+ doc |
63 |
+) |
64 |
+ |
65 |
+QT5_GENTOO_PRIVATE_CONFIG=( |
66 |
+ !:network |
67 |
+ !:sql |
68 |
+ !:testlib |
69 |
+ !:xml |
70 |
+) |
71 |
+ |
72 |
+PATCHES=( |
73 |
+ "${FILESDIR}"/${PN}-5.15.3-pthread.patch # bug 803470 |
74 |
+) |
75 |
+ |
76 |
+pkg_pretend() { |
77 |
+ use kernel_linux || return |
78 |
+ get_running_version |
79 |
+ if kernel_is -lt 4 11 && ! use old-kernel; then |
80 |
+ ewarn "The running kernel is older than 4.11. USE=old-kernel is needed for" |
81 |
+ ewarn "dev-qt/qtcore to function on this kernel properly. Bugs #669994, #672856" |
82 |
+ fi |
83 |
+} |
84 |
+ |
85 |
+src_prepare() { |
86 |
+ # don't add -O3 to CXXFLAGS, bug 549140 |
87 |
+ sed -i -e '/CONFIG\s*+=/s/optimize_full//' src/corelib/corelib.pro || die |
88 |
+ |
89 |
+ # fix missing qt_version_tag symbol w/ LTO, bug 674382 |
90 |
+ sed -i -e 's/^gcc:ltcg/gcc/' src/corelib/global/global.pri || die |
91 |
+ |
92 |
+ # Broken with FORTIFY_SOURCE=3 |
93 |
+ # Our toolchain sets F_S=2 by default w/ >= -O2, so we need |
94 |
+ # to unset F_S first, then explicitly set 2, to negate any default |
95 |
+ # and anything set by the user if they're choosing 3 (or if they've |
96 |
+ # modified GCC to set 3). |
97 |
+ # |
98 |
+ # Refs: |
99 |
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105078 |
100 |
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105709 |
101 |
+ # https://bugreports.qt.io/browse/QTBUG-103782 |
102 |
+ # bug #847145 |
103 |
+ if is-flagq '-O[23]' || is-flagq '-Ofast' ; then |
104 |
+ # We can't unconditionally do this b/c we fortify needs |
105 |
+ # some level of optimisation. |
106 |
+ filter-flags -D_FORTIFY_SOURCE=3 |
107 |
+ # (Qt doesn't seem to respect CPPFLAGS?) |
108 |
+ append-flags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 |
109 |
+ fi |
110 |
+ |
111 |
+ qt5-build_src_prepare |
112 |
+} |
113 |
+ |
114 |
+src_configure() { |
115 |
+ local myconf=( |
116 |
+ $(qt_use icu) |
117 |
+ $(qt_use !icu iconv) |
118 |
+ $(qt_use systemd journald) |
119 |
+ ) |
120 |
+ use old-kernel && myconf+=( |
121 |
+ -no-feature-renameat2 # needs Linux 3.16, bug 669994 |
122 |
+ -no-feature-getentropy # needs Linux 3.17, bug 669994 |
123 |
+ -no-feature-statx # needs Linux 4.11, bug 672856 |
124 |
+ ) |
125 |
+ qt5-build_src_configure |
126 |
+} |
127 |
+ |
128 |
+src_install() { |
129 |
+ qt5-build_src_install |
130 |
+ qt5_symlink_binary_to_path qmake 5 |
131 |
+ |
132 |
+ local flags=( |
133 |
+ DBUS FREETYPE IMAGEFORMAT_JPEG IMAGEFORMAT_PNG |
134 |
+ OPENGL OPENSSL SSL WIDGETS |
135 |
+ ) |
136 |
+ |
137 |
+ for flag in ${flags[@]}; do |
138 |
+ cat >> "${D}"/${QT5_HEADERDIR}/QtCore/qconfig.h <<- _EOF_ || die |
139 |
+ |
140 |
+ #if defined(QT_NO_${flag}) && defined(QT_${flag}) |
141 |
+ # undef QT_NO_${flag} |
142 |
+ #elif !defined(QT_NO_${flag}) && !defined(QT_${flag}) |
143 |
+ # define QT_NO_${flag} |
144 |
+ #endif |
145 |
+ _EOF_ |
146 |
+ done |
147 |
+} |