/[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.99 Revision 1.100
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.99 2011/11/19 20:00:35 pesa Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.100 2011/11/19 20:31:12 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.
10# This eclass contains various functions that are used when building Qt4. 10# This eclass contains various functions that are used when building Qt4.
11 11
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/_/-}
15if version_is_at_least 4.5.99999999; then
16 MY_P=qt-everywhere-opensource-src-${MY_PV} 15MY_P=qt-everywhere-opensource-src-${MY_PV}
16
17HOMEPAGE="http://qt.nokia.com/"
18SRC_URI="http://get.qt.nokia.com/qt/source/${MY_P}.tar.gz"
19LICENSE="|| ( LGPL-2.1 GPL-3 )"
20
21IUSE="aqua debug pch"
22
17 [[ ${CATEGORY}/${PN} != x11-libs/qt-xmlpatterns ]] && 23[[ ${CATEGORY}/${PN} != x11-libs/qt-xmlpatterns ]] &&
18 [[ ${CATEGORY}/${PN} != x11-themes/qgtkstyle ]] && 24[[ ${CATEGORY}/${PN} != x11-themes/qgtkstyle ]] &&
19 IUSE="+exceptions" 25 IUSE+=" +exceptions"
20else
21 MY_P=qt-x11-opensource-src-${MY_PV}
22fi
23 26
24if version_is_at_least 4.7.99999999; then 27if version_is_at_least 4.7.99999999; then
25 IUSE+=" c++0x qpa" 28 IUSE+=" c++0x qpa"
26fi 29fi
27
28HOMEPAGE="http://qt.nokia.com/"
29SRC_URI="http://get.qt.nokia.com/qt/source/${MY_P}.tar.gz"
30
31LICENSE="|| ( LGPL-2.1 GPL-3 )"
32IUSE+=" debug pch aqua"
33 30
34RDEPEND=" 31RDEPEND="
35 !<x11-libs/qt-assistant-${PV} 32 !<x11-libs/qt-assistant-${PV}
36 !>x11-libs/qt-assistant-${PV}-r9999 33 !>x11-libs/qt-assistant-${PV}-r9999
37 !<x11-libs/qt-core-${PV} 34 !<x11-libs/qt-core-${PV}
38 !>x11-libs/qt-core-${PV}-r9999 35 !>x11-libs/qt-core-${PV}-r9999
39 !<x11-libs/qt-dbus-${PV} 36 !<x11-libs/qt-dbus-${PV}
40 !>x11-libs/qt-dbus-${PV}-r9999 37 !>x11-libs/qt-dbus-${PV}-r9999
38 !<x11-libs/qt-declarative-${PV}
39 !>x11-libs/qt-declarative-${PV}-r9999
41 !<x11-libs/qt-demo-${PV} 40 !<x11-libs/qt-demo-${PV}
42 !>x11-libs/qt-demo-${PV}-r9999 41 !>x11-libs/qt-demo-${PV}-r9999
43 !<x11-libs/qt-gui-${PV} 42 !<x11-libs/qt-gui-${PV}
44 !>x11-libs/qt-gui-${PV}-r9999 43 !>x11-libs/qt-gui-${PV}-r9999
45 !<x11-libs/qt-multimedia-${PV} 44 !<x11-libs/qt-multimedia-${PV}
72qt4-build_pkg_setup() { 71qt4-build_pkg_setup() {
73 [[ ${EAPI} == 2 ]] && use !prefix && EPREFIX= 72 [[ ${EAPI} == 2 ]] && use !prefix && EPREFIX=
74 73
75 # Protect users by not allowing downgrades between releases 74 # Protect users by not allowing downgrades between releases
76 # Downgrading revisions within the same release should be allowed 75 # Downgrading revisions within the same release should be allowed
77 if has_version '>'${CATEGORY}/${P}-r9999 ; then 76 if has_version '>'${CATEGORY}/${P}-r9999; then
78 if [[ -z $I_KNOW_WHAT_I_AM_DOING ]] ; then 77 if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
79 eerror "Sanity check to keep you from breaking your system:" 78 eerror "Sanity check to keep you from breaking your system:"
80 eerror " Downgrading Qt is completely unsupported and will break your system!" 79 eerror " Downgrading Qt is completely unsupported and will break your system!"
81 die "aborting to save your system" 80 die "aborting to save your system"
82 else 81 else
83 ewarn "Downgrading Qt is completely unsupported and will break your system!" 82 ewarn "Downgrading Qt is completely unsupported and will break your system!"
201 -e '/^CONFIG/s:plugin_no_soname:plugin_with_soname absolute_library_soname:' \ 200 -e '/^CONFIG/s:plugin_no_soname:plugin_with_soname absolute_library_soname:' \
202 -i mkspecs/$(qt_mkspecs_dir)/qmake.conf || die "sed failed" 201 -i mkspecs/$(qt_mkspecs_dir)/qmake.conf || die "sed failed"
203 fi 202 fi
204 203
205 if [[ ${PN} != qt-core ]]; then 204 if [[ ${PN} != qt-core ]]; then
206 skip_qmake_build_patch 205 skip_qmake_build
207 skip_project_generation_patch 206 skip_project_generation
208 symlink_binaries_to_buildtree 207 symlink_binaries_to_buildtree
209 fi 208 fi
210 209
211 if [[ ${CHOST} == *86*-apple-darwin* ]] ; then 210 if [[ ${CHOST} == *86*-apple-darwin* ]] ; then
212 # qmake bus errors with -O2 but -O3 works 211 # qmake bus errors with -O2 but -O3 works
217 if [[ $(gcc-major-version) == 3 ]] && use amd64; then 216 if [[ $(gcc-major-version) == 3 ]] && use amd64; then
218 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS" 217 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS"
219 append-flags -fno-gcse 218 append-flags -fno-gcse
220 fi 219 fi
221 220
222 if has c++0x ${IUSE//+} && use c++0x; then 221 if use_if_iuse c++0x; then
223 ewarn "You are about to build Qt4 using the C++11 standard. Even though" 222 ewarn "You are about to build Qt4 using the C++11 standard. Even though"
224 ewarn "this is an official standard, some of the reverse dependencies" 223 ewarn "this is an official standard, some of the reverse dependencies"
225 ewarn "may fail to compile or link againt the Qt4 libraries. Before" 224 ewarn "may fail to compile or link againt the Qt4 libraries. Before"
226 ewarn "reporting a bug, make sure your bug is reproducible with c++0x" 225 ewarn "reporting a bug, make sure your bug is reproducible with c++0x"
227 ewarn "disabled." 226 ewarn "disabled."
499 alpha|arm|ia64|mips|s390|sparc) myconf+=" -arch $(tc-arch)" ;; 498 alpha|arm|ia64|mips|s390|sparc) myconf+=" -arch $(tc-arch)" ;;
500 hppa|sh) myconf+=" -arch generic" ;; 499 hppa|sh) myconf+=" -arch generic" ;;
501 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;; 500 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;;
502 esac 501 esac
503 502
504 # 4.5: build everything but qt-xmlpatterns w/o exceptions
505 # 4.6: exceptions USE flag 503 # exceptions USE flag
506 local exceptions="-exceptions" 504 local exceptions="-exceptions"
507 case "${PV}" in
508 4.5.*)
509 [[ ${PN} == "qt-xmlpatterns" ]] || exceptions="-no-exceptions"
510 ;;
511 *)
512 has exceptions "${IUSE//+}" && exceptions="$(qt_use exceptions)" 505 in_iuse exceptions && exceptions="$(qt_use exceptions)"
513 ;;
514 esac
515 506
516 # note about -reduce-relocations: 507 # note about -reduce-relocations:
517 # That flag seems to introduce major breakage to applications, 508 # That flag seems to introduce major breakage to applications,
518 # mostly to be seen as a core dump with the message "QPixmap: Must 509 # mostly to be seen as a core dump with the message "QPixmap: Must
519 # construct a QApplication before a QPaintDevice" on Solaris 510 # construct a QApplication before a QPaintDevice" on Solaris
686# breakages and proposed solutions. 677# breakages and proposed solutions.
687qt4-build_pkg_postinst() { 678qt4-build_pkg_postinst() {
688 generate_qconfigs 679 generate_qconfigs
689} 680}
690 681
691# @FUNCTION: skip_qmake_build_patch 682# @FUNCTION: skip_qmake_build
692# @DESCRIPTION: 683# @DESCRIPTION:
693# Don't need to build qmake, as it's already installed from qt-core 684# Don't need to build qmake, as it's already installed from qt-core
694skip_qmake_build_patch() { 685skip_qmake_build() {
695 # Don't need to build qmake, as it's already installed from qt-core 686 # Don't need to build qmake, as it's already installed from qt-core
696 sed -i -e "s:if true:if false:g" "${S}"/configure || die "sed failed" 687 sed -i -e "s:if true:if false:g" "${S}"/configure || die "sed failed"
697} 688}
698 689
699# @FUNCTION: skip_project_generation_patch 690# @FUNCTION: skip_project_generation
700# @DESCRIPTION: 691# @DESCRIPTION:
701# Exit the script early by throwing in an exit before all of the .pro files are scanned 692# Exit the script early by throwing in an exit before all of the .pro files are scanned
702skip_project_generation_patch() { 693skip_project_generation() {
703 # Exit the script early by throwing in an exit before all of the .pro files are scanned 694 # Exit the script early by throwing in an exit before all of the .pro files are scanned
704 sed -e "s:echo \"Finding:exit 0\n\necho \"Finding:g" \ 695 sed -e "s:echo \"Finding:exit 0\n\necho \"Finding:g" \
705 -i "${S}"/configure || die "sed failed" 696 -i "${S}"/configure || die "sed failed"
706} 697}
707 698
709# @DESCRIPTION: 700# @DESCRIPTION:
710# Symlink generated binaries to buildtree so they can be used during compilation 701# Symlink generated binaries to buildtree so they can be used during compilation
711# time 702# time
712symlink_binaries_to_buildtree() { 703symlink_binaries_to_buildtree() {
713 for bin in qmake moc uic rcc; do 704 for bin in qmake moc uic rcc; do
714 ln -s ${QTBINDIR}/${bin} "${S}"/bin/ || die "symlinking ${bin} to ${S}/bin failed" 705 ln -s "${QTBINDIR}"/${bin} "${S}"/bin/ || die "symlinking ${bin} to ${S}/bin failed"
715 done 706 done
716} 707}
717 708
718# @FUNCTION: fix_library_files 709# @FUNCTION: fix_library_files
719# @DESCRIPTION: 710# @DESCRIPTION:
791 *-solaris*) 782 *-solaris*)
792 spec=solaris ;; 783 spec=solaris ;;
793 *-linux-*|*-linux) 784 *-linux-*|*-linux)
794 spec=linux ;; 785 spec=linux ;;
795 *) 786 *)
796 die "Unknown CHOST, no platform chosen." 787 die "Unknown CHOST, no platform chosen"
797 esac 788 esac
798 789
799 CXX=$(tc-getCXX) 790 CXX=$(tc-getCXX)
800 if [[ ${CXX} == *g++* ]]; then 791 if [[ ${CXX} == *g++* ]]; then
801 spec+=-g++ 792 spec+=-g++
802 elif [[ ${CXX} == *icpc* ]]; then 793 elif [[ ${CXX} == *icpc* ]]; then
803 spec+=-icc 794 spec+=-icc
804 else 795 else
805 die "Unknown compiler '${CXX}'." 796 die "Unknown compiler '${CXX}'"
806 fi 797 fi
807 if [[ -n ${LIBDIR/lib} ]]; then 798 if [[ -n ${LIBDIR/lib} ]]; then
808 spec+=-${LIBDIR/lib} 799 spec+=-${LIBDIR/lib}
809 fi 800 fi
810 801

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

  ViewVC Help
Powered by ViewVC 1.1.20