/[gentoo-x86]/eclass/qt4-build.eclass
Gentoo

Diff of /eclass/qt4-build.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.117 Revision 1.120
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.117 2012/02/09 22:07:34 hwoarang Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.120 2012/02/28 18:53:45 pesa Exp $
4 4
5# @ECLASS: qt4-build.eclass 5# @ECLASS: qt4-build.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Qt herd <qt@gentoo.org> 7# Qt herd <qt@gentoo.org>
8# @BLURB: Eclass for Qt4 split ebuilds. 8# @BLURB: Eclass for Qt4 split ebuilds.
44 !>x11-libs/qt-gui-${PV}-r9999 44 !>x11-libs/qt-gui-${PV}-r9999
45 !<x11-libs/qt-multimedia-${PV} 45 !<x11-libs/qt-multimedia-${PV}
46 !>x11-libs/qt-multimedia-${PV}-r9999 46 !>x11-libs/qt-multimedia-${PV}-r9999
47 !<x11-libs/qt-opengl-${PV} 47 !<x11-libs/qt-opengl-${PV}
48 !>x11-libs/qt-opengl-${PV}-r9999 48 !>x11-libs/qt-opengl-${PV}-r9999
49 !<x11-libs/qt-openvg-${PV}
50 !>x11-libs/qt-openvg-${PV}-r9999
49 !<x11-libs/qt-phonon-${PV} 51 !<x11-libs/qt-phonon-${PV}
50 !>x11-libs/qt-phonon-${PV}-r9999 52 !>x11-libs/qt-phonon-${PV}-r9999
51 !<x11-libs/qt-qt3support-${PV} 53 !<x11-libs/qt-qt3support-${PV}
52 !>x11-libs/qt-qt3support-${PV}-r9999 54 !>x11-libs/qt-qt3support-${PV}-r9999
53 !<x11-libs/qt-script-${PV} 55 !<x11-libs/qt-script-${PV}
194 skip_qmake_build 196 skip_qmake_build
195 skip_project_generation 197 skip_project_generation
196 symlink_binaries_to_buildtree 198 symlink_binaries_to_buildtree
197 fi 199 fi
198 200
199 if [[ ${CHOST} == *86*-apple-darwin* ]] ; then 201 if [[ ${CHOST} == *86*-apple-darwin* ]]; then
200 # qmake bus errors with -O2 but -O3 works 202 # qmake bus errors with -O2 but -O3 works
201 replace-flags -O2 -O3 203 replace-flags -O2 -O3
202 fi 204 fi
203 205
204 # Bug 178652 206 # Bug 178652
215 ewarn "disabled." 217 ewarn "disabled."
216 append-flags -std=c++0x 218 append-flags -std=c++0x
217 fi 219 fi
218 220
219 # Unsupported old gcc versions - hardened needs this :( 221 # Unsupported old gcc versions - hardened needs this :(
220 if [[ $(gcc-major-version) -lt 4 ]] ; then 222 if [[ $(gcc-major-version) -lt 4 ]]; then
221 ewarn "Appending -fno-stack-protector to CXXFLAGS" 223 ewarn "Appending -fno-stack-protector to CXXFLAGS"
222 append-cxxflags -fno-stack-protector 224 append-cxxflags -fno-stack-protector
223 # Bug 253127 225 # Bug 253127
224 sed -e "/^QMAKE_CFLAGS\t/ s:$: -fno-stack-protector-all:" \ 226 sed -e "/^QMAKE_CFLAGS\t/ s:$: -fno-stack-protector-all:" \
225 -i mkspecs/common/g++.conf || die 227 -i mkspecs/common/g++.conf || die
280 -e "s:-Xarch_ppc64::g" \ 282 -e "s:-Xarch_ppc64::g" \
281 -i configure mkspecs/common/mac-g++.conf \ 283 -i configure mkspecs/common/mac-g++.conf \
282 || die "sed -arch/-Xarch failed" 284 || die "sed -arch/-Xarch failed"
283 285
284 # On Snow Leopard don't fall back to 10.5 deployment target. 286 # On Snow Leopard don't fall back to 10.5 deployment target.
285 if [[ ${CHOST} == *-apple-darwin10 ]] ; then 287 if [[ ${CHOST} == *-apple-darwin10 ]]; then
286 sed -e "s:QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET.*:QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.6:g" \ 288 sed -e "s:QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET.*:QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.6:g" \
287 -e "s:-mmacosx-version-min=10.[0-9]:-mmacosx-version-min=10.6:g" \ 289 -e "s:-mmacosx-version-min=10.[0-9]:-mmacosx-version-min=10.6:g" \
288 -i configure mkspecs/common/mac-g++.conf \ 290 -i configure mkspecs/common/mac-g++.conf \
289 || die "sed deployment target failed" 291 || die "sed deployment target failed"
290 fi 292 fi
291 fi 293 fi
292 294
293 # this one is needed for all systems with a separate -liconv, apart from 295 # this one is needed for all systems with a separate -liconv, apart from
294 # Darwin, for which the sources already cater for -liconv 296 # Darwin, for which the sources already cater for -liconv
295 if use !elibc_glibc && [[ ${CHOST} != *-darwin* ]] ; then 297 if use !elibc_glibc && [[ ${CHOST} != *-darwin* ]]; then
296 sed -e 's|mac:\(LIBS += -liconv\)|\1|g' \ 298 sed -e 's|mac:\(LIBS += -liconv\)|\1|g' \
297 -i config.tests/unix/iconv/iconv.pro \ 299 -i config.tests/unix/iconv/iconv.pro \
298 || die "sed iconv.pro failed" 300 || die "sed iconv.pro failed"
299 fi 301 fi
300 302
317 setqtenv 319 setqtenv
318 myconf="$(standard_configure_options) ${myconf}" 320 myconf="$(standard_configure_options) ${myconf}"
319 321
320 # this one is needed for all systems with a separate -liconv, apart from 322 # this one is needed for all systems with a separate -liconv, apart from
321 # Darwin, for which the sources already cater for -liconv 323 # Darwin, for which the sources already cater for -liconv
322 use !elibc_glibc && [[ ${CHOST} != *-darwin* ]] && \ 324 if use !elibc_glibc && [[ ${CHOST} != *-darwin* ]]; then
323 myconf+=" -liconv" 325 myconf+=" -liconv"
326 fi
324 327
325 if use_if_iuse glib; then 328 if use_if_iuse glib; then
326 # use -I, -L and -l from configure
327 local glibflags="$(pkg-config --cflags --libs glib-2.0 gthread-2.0)" 329 local glibflags="$(pkg-config --cflags --libs glib-2.0 gthread-2.0)"
328 # avoid the -pthread argument 330 # avoid the -pthread argument
329 myconf+=" ${glibflags//-pthread}" 331 myconf+=" ${glibflags//-pthread}"
330 unset glibflags 332 unset glibflags
331 fi 333 fi
337 ewarn "disable it before reporting any bugs related to this useflag." 339 ewarn "disable it before reporting any bugs related to this useflag."
338 ewarn 340 ewarn
339 myconf+=" -qpa" 341 myconf+=" -qpa"
340 fi 342 fi
341 343
342 if use aqua ; then 344 if use aqua; then
343 # On (snow) leopard use the new (frameworked) cocoa code. 345 # On (snow) leopard use the new (frameworked) cocoa code.
344 if [[ ${CHOST##*-darwin} -ge 9 ]] ; then 346 if [[ ${CHOST##*-darwin} -ge 9 ]]; then
345 myconf+=" -cocoa -framework" 347 myconf+=" -cocoa -framework"
348 # We need the source's headers, not the installed ones.
349 myconf+=" -I${S}/include"
350 # Add hint for the framework location.
351 myconf+=" -F${QTLIBDIR}"
346 352
347 # We are crazy and build cocoa + qt3support :-) 353 # We are crazy and build cocoa + qt3support :-)
348 if use qt3support; then 354 if use qt3support; then
349 sed -e "/case \"\$PLATFORM,\$CFG_MAC_COCOA\" in/,/;;/ s|CFG_QT3SUPPORT=\"no\"|CFG_QT3SUPPORT=\"yes\"|" \ 355 sed -e "/case \"\$PLATFORM,\$CFG_MAC_COCOA\" in/,/;;/ s|CFG_QT3SUPPORT=\"no\"|CFG_QT3SUPPORT=\"yes\"|" \
350 -i configure || die 356 -i configure || die
351 fi 357 fi
352 358 else
353 # We need the source's headers, not the installed ones. 359 myconf+=" -no-framework"
354 myconf+=" -I${S}/include"
355
356 # Add hint for the framework location.
357 myconf+=" -F${QTLIBDIR}"
358 fi 360 fi
359 else 361 else
360 # freetype2 include dir is non-standard, thus include it on configure 362 # freetype2 include dir is non-standard, thus include it on configure
361 # use -I from configure 363 # use -I from configure
362 myconf+=" $(pkg-config --cflags freetype2)" 364 myconf+=" $(pkg-config --cflags freetype2)"
380 382
381# @FUNCTION: qt4-build_src_test 383# @FUNCTION: qt4-build_src_test
382# @DESCRIPTION: 384# @DESCRIPTION:
383# Runs tests only in target directories. 385# Runs tests only in target directories.
384qt4-build_src_test() { 386qt4-build_src_test() {
387 # QtMultimedia does not have any test suite (bug #332299)
388 [[ ${PN} == "qt-multimedia" ]] && return
389
385 for dir in ${QT4_TARGET_DIRECTORIES}; do 390 for dir in ${QT4_TARGET_DIRECTORIES}; do
386 emake -j1 check -C ${dir} 391 emake -j1 check -C ${dir}
387 done 392 done
388} 393}
389 394
390# @FUNCTION: fix_includes 395# @FUNCTION: fix_includes
391# @DESCRIPTION: 396# @DESCRIPTION:
392# For MacOS X we need to add some symlinks when frameworks are 397# For MacOS X we need to add some symlinks when frameworks are
393# being used, to avoid complications with some more or less stupid packages. 398# being used, to avoid complications with some more or less stupid packages.
394fix_includes() { 399fix_includes() {
395 if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]] ; then 400 if use aqua && [[ ${CHOST##*-darwin} -ge 9 ]]; then
396 # Some packages tend to include <Qt/...> 401 # Some packages tend to include <Qt/...>
397 dodir "${QTHEADERDIR#${EPREFIX}}"/Qt 402 dodir "${QTHEADERDIR#${EPREFIX}}"/Qt
398 403
399 # Fake normal headers when frameworks are installed... eases life later on 404 # Fake normal headers when frameworks are installed... eases life later on
400 local dest f h 405 local dest f h
458# @INTERNAL 463# @INTERNAL
459# @DESCRIPTION: 464# @DESCRIPTION:
460# Sets up some standard configure options, like libdir (if necessary), whether 465# Sets up some standard configure options, like libdir (if necessary), whether
461# debug info is wanted or not. 466# debug info is wanted or not.
462standard_configure_options() { 467standard_configure_options() {
468 local myconf="
463 local myconf="-prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR} 469 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR}
464 -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR} -plugindir ${QTPLUGINDIR} 470 -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR} -plugindir ${QTPLUGINDIR}
465 $(version_is_at_least 4.7 && echo -importdir ${QTIMPORTDIR}) 471 $(version_is_at_least 4.7 && echo -importdir ${QTIMPORTDIR})
466 -datadir ${QTDATADIR} -translationdir ${QTTRANSDIR} -sysconfdir ${QTSYSCONFDIR} 472 -datadir ${QTDATADIR} -translationdir ${QTTRANSDIR} -sysconfdir ${QTSYSCONFDIR}
467 -examplesdir ${QTEXAMPLESDIR} -demosdir ${QTDEMOSDIR} 473 -examplesdir ${QTEXAMPLESDIR} -demosdir ${QTDEMOSDIR}
468 -opensource -confirm-license -shared -fast -largefile -stl -verbose 474 -opensource -confirm-license -shared -fast -largefile -stl -verbose
477 myconf+=" -release" 483 myconf+=" -release"
478 fi 484 fi
479 myconf+=" -no-separate-debug-info" 485 myconf+=" -no-separate-debug-info"
480 486
481 # exceptions USE flag 487 # exceptions USE flag
482 local exceptions="-exceptions" 488 myconf+=" $(in_iuse exceptions && qt_use exceptions || echo -exceptions)"
483 in_iuse exceptions && exceptions="$(qt_use exceptions)"
484 myconf+=" ${exceptions}"
485 489
486 # disable RPATH on Qt >= 4.8 (bug 380415) 490 # disable RPATH on Qt >= 4.8 (bug 380415)
487 version_is_at_least 4.8 && myconf+=" -no-rpath" 491 version_is_at_least 4.8 && myconf+=" -no-rpath"
488 492
489 # precompiled headers don't work on hardened, where the flag is masked 493 # precompiled headers don't work on hardened, where the flag is masked
493 # This flag seems to introduce major breakage to applications, 497 # This flag seems to introduce major breakage to applications,
494 # mostly to be seen as a core dump with the message "QPixmap: Must 498 # mostly to be seen as a core dump with the message "QPixmap: Must
495 # construct a QApplication before a QPaintDevice" on Solaris. 499 # construct a QApplication before a QPaintDevice" on Solaris.
496 # -- Daniel Vergien 500 # -- Daniel Vergien
497 [[ ${CHOST} != *-solaris* ]] && myconf+=" -reduce-relocations" 501 [[ ${CHOST} != *-solaris* ]] && myconf+=" -reduce-relocations"
498
499 use aqua && myconf+=" -no-framework"
500 502
501 # ARCH is set on Gentoo. Qt now falls back to generic on an unsupported 503 # ARCH is set on Gentoo. Qt now falls back to generic on an unsupported
502 # $(tc-arch). Therefore we convert it to supported values. 504 # $(tc-arch). Therefore we convert it to supported values.
503 case "$(tc-arch)" in 505 case "$(tc-arch)" in
504 amd64|x64-*) myconf+=" -arch x86_64" ;; 506 amd64|x64-*) myconf+=" -arch x86_64" ;;

Legend:
Removed from v.1.117  
changed lines
  Added in v.1.120

  ViewVC Help
Powered by ViewVC 1.1.20