/[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.100 Revision 1.108
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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.100 2011/11/19 20:31:12 pesa Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.108 2011/12/25 18:49:52 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.
12inherit base eutils multilib toolchain-funcs flag-o-matic versionator 12inherit base eutils multilib toolchain-funcs flag-o-matic versionator
13 13
14MY_PV=${PV/_/-} 14MY_PV=${PV/_/-}
15MY_P=qt-everywhere-opensource-src-${MY_PV} 15MY_P=qt-everywhere-opensource-src-${MY_PV}
16 16
17HOMEPAGE="http://qt.nokia.com/" 17HOMEPAGE="http://qt.nokia.com/ http://qt-project.org/"
18SRC_URI="http://get.qt.nokia.com/qt/source/${MY_P}.tar.gz" 18SRC_URI="http://get.qt.nokia.com/qt/source/${MY_P}.tar.gz"
19LICENSE="|| ( LGPL-2.1 GPL-3 )" 19LICENSE="|| ( LGPL-2.1 GPL-3 )"
20 20
21IUSE="aqua debug pch" 21IUSE="aqua debug pch"
22 22
26 26
27if version_is_at_least 4.7.99999999; then 27if version_is_at_least 4.7.99999999; then
28 IUSE+=" c++0x qpa" 28 IUSE+=" c++0x qpa"
29fi 29fi
30 30
31DEPEND="dev-util/pkgconfig"
31RDEPEND=" 32RDEPEND="
32 !<x11-libs/qt-assistant-${PV} 33 !<x11-libs/qt-assistant-${PV}
33 !>x11-libs/qt-assistant-${PV}-r9999 34 !>x11-libs/qt-assistant-${PV}-r9999
34 !<x11-libs/qt-core-${PV} 35 !<x11-libs/qt-core-${PV}
35 !>x11-libs/qt-core-${PV}-r9999 36 !>x11-libs/qt-core-${PV}-r9999
175# source files in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified on /etc/make.conf. 176# source files in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified on /etc/make.conf.
176qt4-build_src_prepare() { 177qt4-build_src_prepare() {
177 setqtenv 178 setqtenv
178 cd "${S}" 179 cd "${S}"
179 180
180 # fix qt 4.7 regression that skips -fvisibility=hidden
181 if version_is_at_least "4.7.0_beta1"; then
182 sed -e "s/^gcc|g++)/*gcc|*g++)/" \
183 -i config.tests/unix/fvisibility.test ||
184 die "visibility fixing sed failed"
185 fi
186
187 if version_is_at_least "4.7"; then 181 if version_is_at_least "4.7"; then
188 # fix libX11 dependency on non X packages 182 # fix libX11 dependency on non X packages
189 local nolibx11_pkgs="qt-core qt-dbus qt-script qt-sql qt-test qt-xmlpatterns" 183 local nolibx11_pkgs="qt-core qt-dbus qt-script qt-sql qt-test qt-xmlpatterns"
190 has ${PN} ${nolibx11_pkgs} && qt_nolibx11 184 has ${PN} ${nolibx11_pkgs} && qt_nolibx11
191 185
364 # freetype2 include dir is non-standard, thus include it on configure 358 # freetype2 include dir is non-standard, thus include it on configure
365 # use -I from configure 359 # use -I from configure
366 myconf+=" $(pkg-config --cflags freetype2)" 360 myconf+=" $(pkg-config --cflags freetype2)"
367 fi 361 fi
368 362
369 # Disable SSE4.x, since auto-detection is currently broken
370 # Upstream bug http://bugreports.qt.nokia.com/browse/QTBUG-13623
371 [[ ${PV} == "4.7.1" ]] && myconf+=" -no-sse4.1 -no-sse4.2"
372
373 echo ./configure ${myconf} 363 echo ./configure ${myconf}
374 ./configure ${myconf} || die "./configure failed" 364 ./configure ${myconf} || die "./configure failed"
375 myconf="" 365 myconf=""
376 366
377 prepare_directories ${QT4_TARGET_DIRECTORIES} 367 prepare_directories ${QT4_TARGET_DIRECTORIES}
448 QTPCDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig 438 QTPCDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig
449 QTDATADIR=${EPREFIX}/usr/share/qt4 439 QTDATADIR=${EPREFIX}/usr/share/qt4
450 QTDOCDIR=${EPREFIX}/usr/share/doc/qt-${PV} 440 QTDOCDIR=${EPREFIX}/usr/share/doc/qt-${PV}
451 QTHEADERDIR=${EPREFIX}/usr/include/qt4 441 QTHEADERDIR=${EPREFIX}/usr/include/qt4
452 QTPLUGINDIR=${QTLIBDIR}/plugins 442 QTPLUGINDIR=${QTLIBDIR}/plugins
443 QTIMPORTDIR=${QTLIBDIR}/imports
453 QTSYSCONFDIR=${EPREFIX}/etc/qt4 444 QTSYSCONFDIR=${EPREFIX}/etc/qt4
454 QTTRANSDIR=${QTDATADIR}/translations 445 QTTRANSDIR=${QTDATADIR}/translations
455 QTEXAMPLESDIR=${QTDATADIR}/examples 446 QTEXAMPLESDIR=${QTDATADIR}/examples
456 QTDEMOSDIR=${QTDATADIR}/demos 447 QTDEMOSDIR=${QTDATADIR}/demos
457 QT_INSTALL_PREFIX=${EPREFIX}/usr/$(get_libdir)/qt4 448 QT_INSTALL_PREFIX=${EPREFIX}/usr/$(get_libdir)/qt4
463# @FUNCTION: standard_configure_options 454# @FUNCTION: standard_configure_options
464# @DESCRIPTION: 455# @DESCRIPTION:
465# Sets up some standard configure options, like libdir (if necessary), whether 456# Sets up some standard configure options, like libdir (if necessary), whether
466# debug info is wanted or not. 457# debug info is wanted or not.
467standard_configure_options() { 458standard_configure_options() {
468 local myconf= 459 local myconf="-prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR}
460 -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR} -plugindir ${QTPLUGINDIR}
461 -importdir ${QTIMPORTDIR} -datadir ${QTDATADIR} -translationdir ${QTTRANSDIR}
462 -sysconfdir ${QTSYSCONFDIR} -examplesdir ${QTEXAMPLESDIR} -demosdir ${QTDEMOSDIR}
463 -opensource -confirm-license -shared -fast -largefile -stl -verbose
464 -platform $(qt_mkspecs_dir) -nomake examples -nomake demos"
469 465
470 [[ $(get_libdir) != lib ]] && myconf+=" -L${EPREFIX}/usr/$(get_libdir)" 466 [[ $(get_libdir) != lib ]] && myconf+=" -L${EPREFIX}/usr/$(get_libdir)"
471 467
472 # Disable visibility explicitly if gcc version isn't 4 468 # debug/release
473 if [[ $(gcc-major-version) -lt 4 ]]; then
474 myconf+=" -no-reduce-exports"
475 fi
476
477 # precompiled headers doesn't work on hardened, where the flag is masked.
478 myconf+=" $(qt_use pch)"
479
480 if use debug; then 469 if use debug; then
481 myconf+=" -debug" 470 myconf+=" -debug"
482 else 471 else
483 myconf+=" -release" 472 myconf+=" -release"
484 fi 473 fi
485 myconf+=" -no-separate-debug-info" 474 myconf+=" -no-separate-debug-info"
486 475
476 # exceptions USE flag
477 local exceptions="-exceptions"
478 in_iuse exceptions && exceptions="$(qt_use exceptions)"
479 myconf+=" ${exceptions}"
480
481 # disable RPATH on Qt >= 4.8 (bug 380415)
482 version_is_at_least 4.8 && myconf+=" -no-rpath"
483
484 # precompiled headers don't work on hardened, where the flag is masked
485 myconf+=" $(qt_use pch)"
486
487 # -reduce-relocations
488 # This flag seems to introduce major breakage to applications,
489 # mostly to be seen as a core dump with the message "QPixmap: Must
490 # construct a QApplication before a QPaintDevice" on Solaris.
491 # -- Daniel Vergien
492 [[ ${CHOST} != *-solaris* ]] && myconf+=" -reduce-relocations"
493
487 use aqua && myconf+=" -no-framework" 494 use aqua && myconf+=" -no-framework"
488 495
489 # ARCH is set on Gentoo. Qt now falls back to generic on an unsupported 496 # ARCH is set on Gentoo. Qt now falls back to generic on an unsupported
490 # $(tc-arch). Therefore we convert it to supported values. 497 # $(tc-arch). Therefore we convert it to supported values.
491 case "$(tc-arch)" in 498 case "$(tc-arch)" in
492 amd64|x64-*) myconf+=" -arch x86_64" ;; 499 amd64|x64-*) myconf+=" -arch x86_64" ;;
493 ppc-macos) myconf+=" -arch ppc" ;; 500 ppc-macos) myconf+=" -arch ppc" ;;
494 ppc|ppc64|ppc-*) myconf+=" -arch powerpc" ;; 501 ppc|ppc64|ppc-*) myconf+=" -arch powerpc" ;;
495 sparc|sparc-*) myconf+=" -arch sparc" ;; 502 sparc|sparc-*|sparc64-*) myconf+=" -arch sparc" ;;
496 x86-macos) myconf+=" -arch x86" ;; 503 x86-macos) myconf+=" -arch x86" ;;
497 x86|x86-*) myconf+=" -arch i386" ;; 504 x86|x86-*) myconf+=" -arch i386" ;;
498 alpha|arm|ia64|mips|s390|sparc) myconf+=" -arch $(tc-arch)" ;; 505 alpha|arm|ia64|mips|s390) myconf+=" -arch $(tc-arch)" ;;
499 hppa|sh) myconf+=" -arch generic" ;; 506 hppa|sh) myconf+=" -arch generic" ;;
500 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;; 507 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;;
501 esac 508 esac
502
503 # exceptions USE flag
504 local exceptions="-exceptions"
505 in_iuse exceptions && exceptions="$(qt_use exceptions)"
506
507 # note about -reduce-relocations:
508 # That flag seems to introduce major breakage to applications,
509 # mostly to be seen as a core dump with the message "QPixmap: Must
510 # construct a QApplication before a QPaintDevice" on Solaris
511 # -- Daniel Vergien
512 [[ ${CHOST} != *-solaris* ]] && myconf+=" -reduce-relocations"
513
514 myconf+=" -platform $(qt_mkspecs_dir) -stl -verbose -largefile -confirm-license
515 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR}
516 -datadir ${QTDATADIR} -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR}
517 -plugindir ${QTPLUGINDIR} -sysconfdir ${QTSYSCONFDIR}
518 -translationdir ${QTTRANSDIR} -examplesdir ${QTEXAMPLESDIR}
519 -demosdir ${QTDEMOSDIR} -silent -fast -opensource
520 ${exceptions}
521 -nomake examples -nomake demos"
522 509
523 echo "${myconf}" 510 echo "${myconf}"
524} 511}
525 512
526# @FUNCTION: prepare_directories 513# @FUNCTION: prepare_directories
533 einfo "Running qmake in: ${x}" 520 einfo "Running qmake in: ${x}"
534 # avoid running over the maximum argument number, bug #299810 521 # avoid running over the maximum argument number, bug #299810
535 { 522 {
536 echo "${S}"/mkspecs/common/*.conf 523 echo "${S}"/mkspecs/common/*.conf
537 find "${S}" -name '*.pr[io]' 524 find "${S}" -name '*.pr[io]'
538 } | xargs sed -i -e "s:\$\$\[QT_INSTALL_LIBS\]:${EPREFIX}/usr/$(get_libdir)/qt4:g" || die 525 } | xargs sed -i \
526 -e "s:\$\$\[QT_INSTALL_LIBS\]:${QTLIBDIR}:g" \
527 -e "s:\$\$\[QT_INSTALL_PLUGINS\]:${QTPLUGINDIR}:g" \
528 || die
539 "${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" || die "qmake failed" 529 "${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" || die "qmake failed"
540 popd >/dev/null 530 popd >/dev/null
541 done 531 done
542} 532}
543 533

Legend:
Removed from v.1.100  
changed lines
  Added in v.1.108

  ViewVC Help
Powered by ViewVC 1.1.20