Gentoo Archives: gentoo-commits

From: "Davide Pesavento (pesa)" <pesa@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog qt4-build.eclass
Date: Mon, 26 Dec 2011 00:11:20
Message-Id: 20111226001107.A876D2004B@flycatcher.gentoo.org
1 pesa 11/12/26 00:11:07
2
3 Modified: ChangeLog qt4-build.eclass
4 Log:
5 Misc cleanups, add a few missing "|| die", fix description of some functions.
6
7 Revision Changes Path
8 1.55 eclass/ChangeLog
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.55&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.55&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.54&r2=1.55
13
14 Index: ChangeLog
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
17 retrieving revision 1.54
18 retrieving revision 1.55
19 diff -u -r1.54 -r1.55
20 --- ChangeLog 25 Dec 2011 18:49:52 -0000 1.54
21 +++ ChangeLog 26 Dec 2011 00:11:07 -0000 1.55
22 @@ -1,6 +1,9 @@
23 # ChangeLog for eclass directory
24 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.54 2011/12/25 18:49:52 pesa Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.55 2011/12/26 00:11:07 pesa Exp $
27 +
28 + 26 Dec 2011; Davide Pesavento <pesa@g.o> qt4-build.eclass:
29 + Misc cleanups, add a few missing "|| die", fix description of some functions.
30
31 25 Dec 2011; Davide Pesavento <pesa@g.o> qt4-build.eclass:
32 Delete obsolete sed on fvisibility.test, it's no longer needed in all
33
34
35
36 1.109 eclass/qt4-build.eclass
37
38 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/qt4-build.eclass?rev=1.109&view=markup
39 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/qt4-build.eclass?rev=1.109&content-type=text/plain
40 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/qt4-build.eclass?r1=1.108&r2=1.109
41
42 Index: qt4-build.eclass
43 ===================================================================
44 RCS file: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v
45 retrieving revision 1.108
46 retrieving revision 1.109
47 diff -u -r1.108 -r1.109
48 --- qt4-build.eclass 25 Dec 2011 18:49:52 -0000 1.108
49 +++ qt4-build.eclass 26 Dec 2011 00:11:07 -0000 1.109
50 @@ -1,6 +1,6 @@
51 # Copyright 1999-2011 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 -# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.108 2011/12/25 18:49:52 pesa Exp $
54 +# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.109 2011/12/26 00:11:07 pesa Exp $
55
56 # @ECLASS: qt4-build.eclass
57 # @MAINTAINER:
58 @@ -68,7 +68,7 @@
59
60 # @FUNCTION: qt4-build_pkg_setup
61 # @DESCRIPTION:
62 -# Sets up S, MY_P, PATH, and LD_LIBRARY_PATH
63 +# Sets up PATH and LD_LIBRARY_PATH.
64 qt4-build_pkg_setup() {
65 [[ ${EAPI} == 2 ]] && use !prefix && EPREFIX=
66
67 @@ -125,47 +125,35 @@
68
69 # @ECLASS-VARIABLE: QT4_TARGET_DIRECTORIES
70 # @DESCRIPTION:
71 -# Arguments for build_target_directories. Takes the directories, in which the
72 -# code should be compiled. This is a space-separated list
73 +# Arguments for build_target_directories. Takes the directories in which the
74 +# code should be compiled. This is a space-separated list.
75
76 # @ECLASS-VARIABLE: QT4_EXTRACT_DIRECTORIES
77 # @DESCRIPTION:
78 -# Space separated list including the directories that will be extracted from Qt
79 -# tarball
80 +# Space-separated list including the directories that will be extracted from
81 +# Qt tarball.
82
83 # @FUNCTION: qt4-build_src_unpack
84 # @DESCRIPTION:
85 -# Unpacks the sources
86 +# Unpacks the sources.
87 qt4-build_src_unpack() {
88 setqtenv
89 - local unpack_p="${MY_P}"
90 - case "${PV}" in
91 - 4.8.0_*)
92 - unpack_p="qt-everywhere-opensource-src-${PV/_*}"
93 - ;;
94 - esac
95 local target targets=
96 for target in configure LICENSE.GPL3 LICENSE.LGPL projects.pro \
97 src/{qbase,qt_targets,qt_install}.pri bin config.tests mkspecs qmake \
98 ${QT4_EXTRACT_DIRECTORIES}; do
99 - targets+=" ${unpack_p}/${target}"
100 + targets+=" ${MY_P}/${target}"
101 done
102
103 echo tar xzf "${DISTDIR}"/${MY_P}.tar.gz ${targets}
104 tar xzf "${DISTDIR}"/${MY_P}.tar.gz ${targets} || die
105 - case "${PV}" in
106 - 4.8.0_*)
107 - mv ${WORKDIR}/qt-everywhere-opensource-src-${PV/_*} \
108 - ${WORKDIR}/qt-everywhere-opensource-src-${MY_PV}
109 - ;;
110 - esac
111 }
112
113 # @ECLASS-VARIABLE: PATCHES
114 # @DESCRIPTION:
115 # In case you have patches to apply, specify them in PATCHES variable. Make sure
116 # to specify the full path. This variable is necessary for src_prepare phase.
117 -# example:
118 +# Example:
119 # PATCHES="${FILESDIR}"/mypatch.patch
120 # ${FILESDIR}"/mypatch2.patch"
121 #
122 @@ -173,7 +161,7 @@
123 # @FUNCTION: qt4-build_src_prepare
124 # @DESCRIPTION:
125 # Prepare the sources before the configure phase. Strip CFLAGS if necessary, and fix
126 -# source files in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified on /etc/make.conf.
127 +# the build system in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified in /etc/make.conf.
128 qt4-build_src_prepare() {
129 setqtenv
130 cd "${S}"
131 @@ -192,7 +180,7 @@
132
133 sed -e '/^CONFIG/s:app_bundle::' \
134 -e '/^CONFIG/s:plugin_no_soname:plugin_with_soname absolute_library_soname:' \
135 - -i mkspecs/$(qt_mkspecs_dir)/qmake.conf || die "sed failed"
136 + -i mkspecs/$(qt_mkspecs_dir)/qmake.conf || die
137 fi
138
139 if [[ ${PN} != qt-core ]]; then
140 @@ -227,7 +215,7 @@
141 append-cxxflags -fno-stack-protector
142 # Bug 253127
143 sed -e "/^QMAKE_CFLAGS\t/ s:$: -fno-stack-protector-all:" \
144 - -i "${S}"/mkspecs/common/g++.conf || die "sed ${S}/mkspecs/common/g++.conf failed"
145 + -i mkspecs/common/g++.conf || die
146 fi
147
148 # Bug 261632
149 @@ -236,21 +224,22 @@
150 append-flags -mminimal-toc
151 fi
152
153 - # Bug 282984 && Bug 295530
154 - sed -e "s:\(^SYSTEM_VARIABLES\):CC=\"$(tc-getCC)\"\nCXX=\"$(tc-getCXX)\"\nCFLAGS=\"${CFLAGS}\"\nCXXFLAGS=\"${CXXFLAGS}\"\nLDFLAGS=\"${LDFLAGS}\"\n\1:" \
155 - -i configure || die "sed qmake compilers failed"
156 + # Respect CC, CXX, {C,CXX,LD}FLAGS in .qmake.cache
157 + sed -e "/^SYSTEM_VARIABLES=/i \
158 + CC='$(tc-getCC)'\n\
159 + CXX='$(tc-getCXX)'\n\
160 + CFLAGS='${CFLAGS}'\n\
161 + CXXFLAGS='${CXXFLAGS}'\n\
162 + LDFLAGS='${LDFLAGS}'\n" \
163 + -i configure || die "sed SYSTEM_VARIABLES failed"
164
165 # Bug 321335
166 - if version_is_at_least 4.6; then
167 - find ./config.tests/unix -name "*.test" -type f -exec grep -lZ \$MAKE '{}' \; | \
168 - xargs -0 \
169 - sed -e "s:\(\$MAKE\):\1 CC=\"$(tc-getCC)\" CXX=\"$(tc-getCXX)\" LD=\"$(tc-getCXX)\" LINK=\"$(tc-getCXX)\":g" \
170 - -i || die "sed test compilers failed"
171 - fi
172 + find config.tests/unix -name '*.test' -type f -exec grep -lZ \$MAKE '{}' \; | xargs -0 \
173 + sed -e "s:\(\$MAKE\):\1 CC='$(tc-getCC)' CXX='$(tc-getCXX)' LINK='$(tc-getCXX)':g" \
174 + -i || die "sed test compilers failed"
175
176 # Bug 172219
177 - sed -e "s:X11R6/::" \
178 - -i "${S}"/mkspecs/$(qt_mkspecs_dir)/qmake.conf || die "sed ${S}/mkspecs/$(qt_mkspecs_dir)/qmake.conf failed"
179 + sed -e "s:X11R6/::" -i mkspecs/$(qt_mkspecs_dir)/qmake.conf || die
180
181 if [[ ${CHOST} == *-darwin* ]]; then
182 # Set FLAGS *and* remove -arch, since our gcc-apple is multilib
183 @@ -274,13 +263,13 @@
184 -e "s:CFG_MAC_XARCH=yes:CFG_MAC_XARCH=no:g" \
185 -e "s:-Xarch_x86_64::g" \
186 -e "s:-Xarch_ppc64::g" \
187 - -i configure mkspecs/common/mac-g++.conf || die "sed configure failed"
188 + -i configure mkspecs/common/mac-g++.conf || die "sed -arch/-Xarch failed"
189
190 # On Snow Leopard don't fall back to 10.5 deployment target.
191 if [[ ${CHOST} == *-apple-darwin10 ]] ; then
192 sed -e "s:QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET.*:QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.6:g" \
193 -e "s:-mmacosx-version-min=10.[0-9]:-mmacosx-version-min=10.6:g" \
194 - -i configure mkspecs/common/mac-g++.conf || die "sed configure failed"
195 + -i configure mkspecs/common/mac-g++.conf || die "sed deployment target failed"
196 fi
197 fi
198
199 @@ -387,7 +376,7 @@
200
201 # @FUNCTION: fix_includes
202 # @DESCRIPTION:
203 -# For MacOSX we need to add some symlinks when frameworks are
204 +# For MacOS X we need to add some symlinks when frameworks are
205 # being used, to avoid complications with some more or less stupid packages.
206 fix_includes() {
207 if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]] ; then
208 @@ -430,22 +419,22 @@
209 # @FUNCTION: setqtenv
210 setqtenv() {
211 # Set up installation directories
212 - QTBASEDIR=${EPREFIX}/usr/$(get_libdir)/qt4
213 QTPREFIXDIR=${EPREFIX}/usr
214 QTBINDIR=${EPREFIX}/usr/bin
215 QTLIBDIR=${EPREFIX}/usr/$(get_libdir)/qt4
216 - QMAKE_LIBDIR_QT=${QTLIBDIR}
217 QTPCDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig
218 - QTDATADIR=${EPREFIX}/usr/share/qt4
219 QTDOCDIR=${EPREFIX}/usr/share/doc/qt-${PV}
220 QTHEADERDIR=${EPREFIX}/usr/include/qt4
221 QTPLUGINDIR=${QTLIBDIR}/plugins
222 QTIMPORTDIR=${QTLIBDIR}/imports
223 - QTSYSCONFDIR=${EPREFIX}/etc/qt4
224 + QTDATADIR=${EPREFIX}/usr/share/qt4
225 QTTRANSDIR=${QTDATADIR}/translations
226 + QTSYSCONFDIR=${EPREFIX}/etc/qt4
227 QTEXAMPLESDIR=${QTDATADIR}/examples
228 QTDEMOSDIR=${QTDATADIR}/demos
229 + QMAKE_LIBDIR_QT=${QTLIBDIR}
230 QT_INSTALL_PREFIX=${EPREFIX}/usr/$(get_libdir)/qt4
231 +
232 PLATFORM=$(qt_mkspecs_dir)
233
234 unset QMAKESPEC
235 @@ -513,10 +502,10 @@
236 # @FUNCTION: prepare_directories
237 # @USAGE: < directories >
238 # @DESCRIPTION:
239 -# Generates makefiles for the directories set in $QT4_TARGET_DIRECTORIES
240 +# Generates Makefiles for the given list of directories.
241 prepare_directories() {
242 for x in "$@"; do
243 - pushd "${S}"/${x} >/dev/null
244 + pushd "${S}"/${x} >/dev/null || die
245 einfo "Running qmake in: ${x}"
246 # avoid running over the maximum argument number, bug #299810
247 {
248 @@ -527,7 +516,7 @@
249 -e "s:\$\$\[QT_INSTALL_PLUGINS\]:${QTPLUGINDIR}:g" \
250 || die
251 "${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" || die "qmake failed"
252 - popd >/dev/null
253 + popd >/dev/null || die
254 done
255 }
256
257 @@ -535,26 +524,26 @@
258 # @FUNCTION: build_directories
259 # @USAGE: < directories >
260 # @DESCRIPTION:
261 -# Compiles the code in $QT4_TARGET_DIRECTORIES
262 +# Compiles the code in the given list of directories.
263 build_directories() {
264 for x in "$@"; do
265 - pushd "${S}"/${x} >/dev/null
266 + pushd "${S}"/${x} >/dev/null || die
267 emake CC="$(tc-getCC)" \
268 CXX="$(tc-getCXX)" \
269 LINK="$(tc-getCXX)" || die "emake failed"
270 - popd >/dev/null
271 + popd >/dev/null || die
272 done
273 }
274
275 # @FUNCTION: install_directories
276 # @USAGE: < directories >
277 # @DESCRIPTION:
278 -# run emake install in the given directories, which are separated by spaces
279 +# Runs emake install in the given directories, which are separated by spaces.
280 install_directories() {
281 for x in "$@"; do
282 - pushd "${S}"/${x} >/dev/null || die "Can't pushd ${S}/${x}"
283 + pushd "${S}"/${x} >/dev/null || die
284 emake INSTALL_ROOT="${D}" install || die "emake install failed"
285 - popd >/dev/null || die "Can't popd from ${S}/${x}"
286 + popd >/dev/null || die
287 done
288 }
289
290 @@ -575,7 +564,7 @@
291
292 # @FUNCTION: install_qconfigs
293 # @DESCRIPTION:
294 -# Install gentoo-specific mkspecs configurations
295 +# Install gentoo-specific mkspecs configurations.
296 install_qconfigs() {
297 local x
298 if [[ -n ${QCONFIG_ADD} || -n ${QCONFIG_REMOVE} ]]; then
299 @@ -597,7 +586,7 @@
300
301 # @FUNCTION: generate_qconfigs
302 # @DESCRIPTION:
303 -# Generates gentoo-specific configurations
304 +# Generates gentoo-specific qconfig.{h,pri}.
305 generate_qconfigs() {
306 if [[ -n ${QCONFIG_ADD} || -n ${QCONFIG_REMOVE} || -n ${QCONFIG_DEFINE} || ${CATEGORY}/${PN} == x11-libs/qt-core ]]; then
307 local x qconfig_add qconfig_remove qconfig_new
308 @@ -656,14 +645,14 @@
309
310 # @FUNCTION: qt4-build_pkg_postrm
311 # @DESCRIPTION:
312 -# Generate configurations when the package is completely removed
313 +# Regenerate configuration when the package is completely removed.
314 qt4-build_pkg_postrm() {
315 generate_qconfigs
316 }
317
318 # @FUNCTION: qt4-build_pkg_postinst
319 # @DESCRIPTION:
320 -# Generate configuration, plus throws a message about possible
321 +# Regenerate configuration, plus throw a message about possible
322 # breakages and proposed solutions.
323 qt4-build_pkg_postinst() {
324 generate_qconfigs
325 @@ -671,25 +660,21 @@
326
327 # @FUNCTION: skip_qmake_build
328 # @DESCRIPTION:
329 -# Don't need to build qmake, as it's already installed from qt-core
330 +# Patches configure to skip qmake compilation, as it's already installed by qt-core.
331 skip_qmake_build() {
332 - # Don't need to build qmake, as it's already installed from qt-core
333 - sed -i -e "s:if true:if false:g" "${S}"/configure || die "sed failed"
334 + sed -i -e "s:if true:if false:g" "${S}"/configure || die
335 }
336
337 # @FUNCTION: skip_project_generation
338 # @DESCRIPTION:
339 -# Exit the script early by throwing in an exit before all of the .pro files are scanned
340 +# Exit the script early by throwing in an exit before all of the .pro files are scanned.
341 skip_project_generation() {
342 - # Exit the script early by throwing in an exit before all of the .pro files are scanned
343 - sed -e "s:echo \"Finding:exit 0\n\necho \"Finding:g" \
344 - -i "${S}"/configure || die "sed failed"
345 + sed -i -e "s:echo \"Finding:exit 0\n\necho \"Finding:g" "${S}"/configure || die
346 }
347
348 # @FUNCTION: symlink_binaries_to_buildtree
349 # @DESCRIPTION:
350 -# Symlink generated binaries to buildtree so they can be used during compilation
351 -# time
352 +# Symlinks generated binaries to buildtree, so they can be used during compilation time.
353 symlink_binaries_to_buildtree() {
354 for bin in qmake moc uic rcc; do
355 ln -s "${QTBINDIR}"/${bin} "${S}"/bin/ || die "symlinking ${bin} to ${S}/bin failed"
356 @@ -698,24 +683,24 @@
357
358 # @FUNCTION: fix_library_files
359 # @DESCRIPTION:
360 -# Fixes the pathes in *.la, *.prl, *.pc, as they are wrong due to sandbox and
361 -# moves the *.pc-files into the pkgconfig directory
362 +# Fixes the paths in *.la, *.prl, *.pc, as they are wrong due to sandbox and
363 +# moves the *.pc files into the pkgconfig directory.
364 fix_library_files() {
365 + local libfile
366 for libfile in "${D}"/${QTLIBDIR}/{*.la,*.prl,pkgconfig/*.pc}; do
367 if [[ -e ${libfile} ]]; then
368 sed -i -e "s:${S}/lib:${QTLIBDIR}:g" ${libfile} || die "sed on ${libfile} failed"
369 fi
370 done
371
372 - # pkgconfig files refer to WORKDIR/bin as the moc and uic locations. Fix:
373 + # pkgconfig files refer to WORKDIR/bin as the moc and uic locations
374 for libfile in "${D}"/${QTLIBDIR}/pkgconfig/*.pc; do
375 if [[ -e ${libfile} ]]; then
376 - sed -i -e "s:${S}/bin:${QTBINDIR}:g" ${libfile} || die "sed failed"
377 + sed -i -e "s:${S}/bin:${QTBINDIR}:g" ${libfile} || die "sed on ${libfile} failed"
378
379 # Move .pc files into the pkgconfig directory
380 dodir ${QTPCDIR#${EPREFIX}}
381 - mv ${libfile} "${D}"/${QTPCDIR}/ \
382 - || die "moving ${libfile} to ${D}/${QTPCDIR}/ failed"
383 + mv ${libfile} "${D}"/${QTPCDIR}/ || die "moving ${libfile} to ${D}/${QTPCDIR}/ failed"
384 fi
385 done
386
387 @@ -729,7 +714,7 @@
388 # This will echo "${enableval}-${feature}" if <flag> is enabled, or
389 # "-no-${feature} if the flag is disabled. If [feature] is not specified <flag>
390 # will be used for that. If [enableval] is not specified, it omits the
391 -# assignment-part
392 +# assignment part.
393 qt_use() {
394 local flag=$1
395 local feature=$1
396 @@ -750,9 +735,7 @@
397 # @DESCRIPTION:
398 # Allows us to define which mkspecs dir we want to use.
399 qt_mkspecs_dir() {
400 - # Allows us to define which mkspecs dir we want to use.
401 - local spec
402 -
403 + local spec=
404 case ${CHOST} in
405 *-freebsd*|*-dragonfly*)
406 spec=freebsd ;;
407 @@ -803,7 +786,6 @@
408 }
409
410 # @FUNCTION: qt_assistant_cleanup
411 -# @RETURN: nothing
412 # @DESCRIPTION:
413 # Tries to clean up tools.pro for qt-assistant ebuilds.
414 # Meant to be called in src_prepare().
415 @@ -833,11 +815,9 @@
416 }
417
418 # @FUNCTION: qt_nolibx11
419 -# @RETURN: nothing
420 # @DESCRIPTION:
421 -# Ignore X11 tests for packages that don't need X libraries installed
422 +# Ignore X11 tests for packages that don't need X libraries installed.
423 qt_nolibx11() {
424 - einfo "Removing X11 check to allow X-less compilation"
425 sed -i "/unixtests\/compile.test.*config.tests\/x11\/xlib/,/fi$/d" "${S}"/configure ||
426 die "x11 check sed failed"
427 }