Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sat, 08 Dec 2018 20:07:18
Message-Id: 1544299621.624918befdffa2eb70f2d47e014f4d9f3574a390.asturm@gentoo
1 commit: 624918befdffa2eb70f2d47e014f4d9f3574a390
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Mon Dec 3 19:09:31 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 8 20:07:01 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=624918be
7
8 qt5-build.eclass: Cleanup obsolete -gt/-ge conditionals
9
10 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
11
12 eclass/qt5-build.eclass | 172 +++++++++++++++++++++++-------------------------
13 1 file changed, 81 insertions(+), 91 deletions(-)
14
15 diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
16 index 3189f0c086f..ef104429f00 100644
17 --- a/eclass/qt5-build.eclass
18 +++ b/eclass/qt5-build.eclass
19 @@ -200,9 +200,7 @@ qt5-build_src_prepare() {
20 src/{corelib/corelib,gui/gui}.pro || die "sed failed (optimize_full)"
21
22 # Respect build variables in configure tests (bug #639494)
23 - if [[ ${QT5_MINOR_VERSION} -ge 9 ]]; then
24 - sed -i -e "s|\"\$outpath/bin/qmake\" \"\$relpathMangled\" -- \"\$@\"|& $(qt5_qmake_args) |" configure || die
25 - fi
26 + sed -i -e "s|\"\$outpath/bin/qmake\" \"\$relpathMangled\" -- \"\$@\"|& $(qt5_qmake_args) |" configure || die
27 fi
28
29 default
30 @@ -508,9 +506,7 @@ qt5_base_configure() {
31 export LD="$(tc-getCXX)"
32
33 # bug 633838
34 - if [[ ${QT5_MINOR_VERSION} -ge 9 ]]; then
35 - unset QMAKESPEC XQMAKESPEC QMAKEPATH QMAKEFEATURES
36 - fi
37 + unset QMAKESPEC XQMAKESPEC QMAKEPATH QMAKEFEATURES
38
39 # configure arguments
40 local conf=(
41 @@ -670,7 +666,7 @@ qt5_base_configure() {
42 -no-warnings-are-errors
43
44 # enable in respective modules to avoid poisoning QT.global_private.enabled_features
45 - $([[ ${QT5_MINOR_VERSION} -ge 9 ]] && echo -no-gui -no-widgets)
46 + -no-gui -no-widgets
47
48 # module-specific options
49 "${myconf[@]}"
50 @@ -681,11 +677,9 @@ qt5_base_configure() {
51 einfo "Configuring with: ${conf[@]}"
52 "${S}"/configure "${conf[@]}" || die "configure failed"
53
54 - if [[ ${QT5_MINOR_VERSION} -ge 8 ]]; then
55 - # a forwarding header is no longer created since 5.8, causing the system
56 - # config to always be used. bug 599636
57 - cp src/corelib/global/qconfig.h include/QtCore/ || die
58 - fi
59 + # a forwarding header is no longer created since 5.8, causing the system
60 + # config to always be used. bug 599636
61 + cp src/corelib/global/qconfig.h include/QtCore/ || die
62
63 popd >/dev/null || die
64
65 @@ -769,7 +763,7 @@ qt5_install_module_config() {
66
67 > "${T}"/${PN}-qconfig.h
68 > "${T}"/${PN}-qconfig.pri
69 - [[ ${QT5_MINOR_VERSION} -ge 9 ]] && > "${T}"/${PN}-qmodule.pri
70 + > "${T}"/${PN}-qmodule.pri
71
72 # generate qconfig_{add,remove} and ${PN}-qconfig.h
73 for x in "${QT5_GENTOO_CONFIG[@]}"; do
74 @@ -803,32 +797,30 @@ qt5_install_module_config() {
75 doins "${T}"/${PN}-qconfig.pri
76 )
77
78 - if [[ ${QT5_MINOR_VERSION} -ge 9 ]]; then
79 - # generate qprivateconfig
80 - for x in "${QT5_GENTOO_PRIVATE_CONFIG[@]}"; do
81 - local flag=${x%%:*}
82 - x=${x#${flag}:}
83 - local feature=${x%%:*}
84 - x=${x#${feature}:}
85 -
86 - if [[ -z ${flag} ]] || { [[ ${flag} != '!' ]] && use ${flag}; }; then
87 - [[ -n ${feature} ]] && qprivateconfig_add+=" ${feature}"
88 - else
89 - [[ -n ${feature} ]] && qprivateconfig_remove+=" ${feature}"
90 - fi
91 - done
92 + # generate qprivateconfig
93 + for x in "${QT5_GENTOO_PRIVATE_CONFIG[@]}"; do
94 + local flag=${x%%:*}
95 + x=${x#${flag}:}
96 + local feature=${x%%:*}
97 + x=${x#${feature}:}
98
99 - # generate and install ${PN}-qmodule.pri
100 - [[ -n ${qprivateconfig_add} ]] && echo "QT.global_private.enabled_features = ${qprivateconfig_add}" >> "${T}"/${PN}-qmodule.pri
101 - [[ -n ${qprivateconfig_remove} ]] && echo "QT.global_private.disabled_features = ${qprivateconfig_remove}" >> "${T}"/${PN}-qmodule.pri
102 - [[ -s ${T}/${PN}-qmodule.pri ]] && (
103 - insinto "${QT5_ARCHDATADIR#${EPREFIX}}"/mkspecs/gentoo
104 - doins "${T}"/${PN}-qmodule.pri
105 - )
106 - fi
107 + if [[ -z ${flag} ]] || { [[ ${flag} != '!' ]] && use ${flag}; }; then
108 + [[ -n ${feature} ]] && qprivateconfig_add+=" ${feature}"
109 + else
110 + [[ -n ${feature} ]] && qprivateconfig_remove+=" ${feature}"
111 + fi
112 + done
113 +
114 + # generate and install ${PN}-qmodule.pri
115 + [[ -n ${qprivateconfig_add} ]] && echo "QT.global_private.enabled_features = ${qprivateconfig_add}" >> "${T}"/${PN}-qmodule.pri
116 + [[ -n ${qprivateconfig_remove} ]] && echo "QT.global_private.disabled_features = ${qprivateconfig_remove}" >> "${T}"/${PN}-qmodule.pri
117 + [[ -s ${T}/${PN}-qmodule.pri ]] && (
118 + insinto "${QT5_ARCHDATADIR#${EPREFIX}}"/mkspecs/gentoo
119 + doins "${T}"/${PN}-qmodule.pri
120 + )
121
122 # install the original {qconfig,qmodule}.pri from qtcore
123 - [[ ${PN} == qtcore && ${QT5_MINOR_VERSION} -ge 9 ]] && (
124 + [[ ${PN} == qtcore ]] && (
125 insinto "${QT5_ARCHDATADIR#${EPREFIX}}"/mkspecs/gentoo
126 newins "${D}${QT5_ARCHDATADIR}"/mkspecs/qconfig.pri qconfig-qtcore.pri
127 newins "${D}${QT5_ARCHDATADIR}"/mkspecs/qmodule.pri qmodule-qtcore.pri
128 @@ -886,60 +878,58 @@ qt5_regenerate_global_configs() {
129 ewarn "${qconfig_pri} does not exist or is not a regular file"
130 fi
131
132 - if [[ ${QT5_MINOR_VERSION} -ge 9 ]]; then
133 - einfo "Updating QT.global_private in qmodule.pri"
134 -
135 - local qmodule_pri=${ROOT%/}${QT5_ARCHDATADIR}/mkspecs/qmodule.pri
136 - local qmodule_pri_orig=${ROOT%/}${QT5_ARCHDATADIR}/mkspecs/gentoo/qmodule-qtcore.pri
137 - if [[ -f ${qmodule_pri} && -f ${qmodule_pri_orig} ]]; then
138 - local x
139 - local qprivateconfig_enabled= qprivateconfig_disabled=
140 - local qprivateconfig_orig_enabled= qprivateconfig_orig_disabled=
141 - local new_qprivateconfig_enabled= new_qprivateconfig_disabled=
142 -
143 - # generate lists of QT.global_private.{dis,en}abled_features
144 - qprivateconfig_orig_enabled="$(sed -n 's/^QT.global_private.enabled_features\s=\s*//p' "${qmodule_pri_orig}")"
145 - qprivateconfig_orig_disabled="$(sed -n 's/^QT.global_private.disabled_features\s=\s*//p' "${qmodule_pri_orig}")"
146 - eshopts_push -s nullglob
147 - for x in "${ROOT%/}${QT5_ARCHDATADIR}"/mkspecs/gentoo/*-qmodule.pri; do
148 - qprivateconfig_enabled+=" $(sed -n 's/^QT.global_private.enabled_features\s=\s*//p' "${x}")"
149 - qprivateconfig_disabled+=" $(sed -n 's/^QT.global_private.disabled_features\s=\s*//p' "${x}")"
150 - done
151 - eshopts_pop
152 -
153 - # anything enabled is enabled, but anything disabled is
154 - # only disabled if it isn't enabled somewhere else.
155 - # this is because we need to forcibly disable some stuff
156 - # in qtcore to support split qtbase.
157 - new_qprivateconfig_enabled=${qprivateconfig_enabled}
158 - for x in ${qprivateconfig_disabled}; do
159 - if ! has "${x}" ${qprivateconfig_enabled}; then
160 - new_qprivateconfig_disabled+=" ${x}"
161 - fi
162 - done
163 -
164 - # check all items from the original qtcore qmodule.pri,
165 - # and add them to the appropriate list if not overridden
166 - # elsewhere
167 - for x in ${qprivateconfig_orig_enabled}; do
168 - if ! has "${x}" ${new_qprivateconfig_enabled} ${new_qprivateconfig_disabled}; then
169 - new_qprivateconfig_enabled+=" ${x}"
170 - fi
171 - done
172 - for x in ${qprivateconfig_orig_disabled}; do
173 - if ! has "${x}" ${new_qprivateconfig_enabled} ${new_qprivateconfig_disabled}; then
174 - new_qprivateconfig_disabled+=" ${x}"
175 - fi
176 - done
177 -
178 - # now replace the existing QT.global_private.{dis,en}abled_features
179 - # with the generated list
180 - sed \
181 - -e "s/^QT.global_private.enabled_features\s*=.*/QT.global_private.enabled_features =${new_qprivateconfig_enabled}/" \
182 - -e "s/^QT.global_private.disabled_features\s*=.*/QT.global_private.disabled_features =${new_qprivateconfig_disabled}/" \
183 - -i "${qmodule_pri}" || eerror "Failed to sed QT.global_private.enabled_features in ${qmodule_pri}"
184 - else
185 - ewarn "${qmodule_pri} or ${qmodule_pri_orig} does not exist or is not a regular file"
186 - fi
187 + einfo "Updating QT.global_private in qmodule.pri"
188 +
189 + local qmodule_pri=${ROOT%/}${QT5_ARCHDATADIR}/mkspecs/qmodule.pri
190 + local qmodule_pri_orig=${ROOT%/}${QT5_ARCHDATADIR}/mkspecs/gentoo/qmodule-qtcore.pri
191 + if [[ -f ${qmodule_pri} && -f ${qmodule_pri_orig} ]]; then
192 + local x
193 + local qprivateconfig_enabled= qprivateconfig_disabled=
194 + local qprivateconfig_orig_enabled= qprivateconfig_orig_disabled=
195 + local new_qprivateconfig_enabled= new_qprivateconfig_disabled=
196 +
197 + # generate lists of QT.global_private.{dis,en}abled_features
198 + qprivateconfig_orig_enabled="$(sed -n 's/^QT.global_private.enabled_features\s=\s*//p' "${qmodule_pri_orig}")"
199 + qprivateconfig_orig_disabled="$(sed -n 's/^QT.global_private.disabled_features\s=\s*//p' "${qmodule_pri_orig}")"
200 + eshopts_push -s nullglob
201 + for x in "${ROOT%/}${QT5_ARCHDATADIR}"/mkspecs/gentoo/*-qmodule.pri; do
202 + qprivateconfig_enabled+=" $(sed -n 's/^QT.global_private.enabled_features\s=\s*//p' "${x}")"
203 + qprivateconfig_disabled+=" $(sed -n 's/^QT.global_private.disabled_features\s=\s*//p' "${x}")"
204 + done
205 + eshopts_pop
206 +
207 + # anything enabled is enabled, but anything disabled is
208 + # only disabled if it isn't enabled somewhere else.
209 + # this is because we need to forcibly disable some stuff
210 + # in qtcore to support split qtbase.
211 + new_qprivateconfig_enabled=${qprivateconfig_enabled}
212 + for x in ${qprivateconfig_disabled}; do
213 + if ! has "${x}" ${qprivateconfig_enabled}; then
214 + new_qprivateconfig_disabled+=" ${x}"
215 + fi
216 + done
217 +
218 + # check all items from the original qtcore qmodule.pri,
219 + # and add them to the appropriate list if not overridden
220 + # elsewhere
221 + for x in ${qprivateconfig_orig_enabled}; do
222 + if ! has "${x}" ${new_qprivateconfig_enabled} ${new_qprivateconfig_disabled}; then
223 + new_qprivateconfig_enabled+=" ${x}"
224 + fi
225 + done
226 + for x in ${qprivateconfig_orig_disabled}; do
227 + if ! has "${x}" ${new_qprivateconfig_enabled} ${new_qprivateconfig_disabled}; then
228 + new_qprivateconfig_disabled+=" ${x}"
229 + fi
230 + done
231 +
232 + # now replace the existing QT.global_private.{dis,en}abled_features
233 + # with the generated list
234 + sed \
235 + -e "s/^QT.global_private.enabled_features\s*=.*/QT.global_private.enabled_features =${new_qprivateconfig_enabled}/" \
236 + -e "s/^QT.global_private.disabled_features\s*=.*/QT.global_private.disabled_features =${new_qprivateconfig_disabled}/" \
237 + -i "${qmodule_pri}" || eerror "Failed to sed QT.global_private.enabled_features in ${qmodule_pri}"
238 + else
239 + ewarn "${qmodule_pri} or ${qmodule_pri_orig} does not exist or is not a regular file"
240 fi
241 }