/[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.34 Revision 1.40
1# Copyright 2007-2009 Gentoo Foundation 1# Copyright 2007-2009 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.34 2009/05/22 22:21:38 hwoarang Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.40 2009/06/27 18:55:02 yngwin Exp $
4 4
5# @ECLASS: qt4-build.eclass 5# @ECLASS: qt4-build.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Ben de Groot <yngwin@gentoo.org>, 7# Ben de Groot <yngwin@gentoo.org>,
8# Markos Chandras <hwoarang@gentoo.org>, 8# Markos Chandras <hwoarang@gentoo.org>,
9# Caleb Tennis <caleb@gentoo.org> 9# Caleb Tennis <caleb@gentoo.org>
10# @BLURB: Eclass for Qt4 split ebuilds. 10# @BLURB: Eclass for Qt4 split ebuilds.
11# @DESCRIPTION: 11# @DESCRIPTION:
12# This eclass contains various functions that are used when building Qt4 12# This eclass contains various functions that are used when building Qt4
13 13
14inherit eutils multilib toolchain-funcs flag-o-matic versionator 14inherit base eutils multilib toolchain-funcs flag-o-matic versionator
15 15
16IUSE="${IUSE} custom-cxxflags debug pch" 16IUSE="${IUSE} debug pch"
17 17RDEPEND="
18 !<x11-libs/qt-assistant-${PV}
19 !>x11-libs/qt-assistant-${PV}-r9999
20 !<x11-libs/qt-core-${PV}
21 !>x11-libs/qt-core-${PV}-r9999
22 !<x11-libs/qt-dbus-${PV}
23 !>x11-libs/qt-dbus-${PV}-r9999
24 !<x11-libs/qt-demo-${PV}
25 !>x11-libs/qt-demo-${PV}-r9999
26 !<x11-libs/qt-gui-${PV}
27 !>x11-libs/qt-gui-${PV}-r9999
28 !<x11-libs/qt-opengl-${PV}
29 !>x11-libs/qt-opengl-${PV}-r9999
30 !<x11-libs/qt-phonon-${PV}
31 !>x11-libs/qt-phonon-${PV}-r9999
32 !<x11-libs/qt-qt3support-${PV}
33 !>x11-libs/qt-qt3support-${PV}-r9999
34 !<x11-libs/qt-script-${PV}
35 !>x11-libs/qt-script-${PV}-r9999
36 !<x11-libs/qt-sql-${PV}
37 !>x11-libs/qt-sql-${PV}-r9999
38 !<x11-libs/qt-svg-${PV}
39 !>x11-libs/qt-svg-${PV}-r9999
40 !<x11-libs/qt-test-${PV}
41 !>x11-libs/qt-test-${PV}-r9999
42 !<x11-libs/qt-webkit-${PV}
43 !>x11-libs/qt-webkit-${PV}-r9999
44 !<x11-libs/qt-xmlpatterns-${PV}
45 !>x11-libs/qt-xmlpatterns-${PV}-r9999
46"
18case "${PV}" in 47case "${PV}" in
19 4.?.?_rc*) 48 4.?.?_rc*)
20 SRCTYPE="${SRCTYPE:-opensource-src}" 49 SRCTYPE="${SRCTYPE:-opensource-src}"
21 MY_PV="${PV/_rc/-rc}" 50 MY_PV="${PV/_rc/-rc}"
22 ;; 51 ;;
27esac 56esac
28MY_P=qt-x11-${SRCTYPE}-${MY_PV} 57MY_P=qt-x11-${SRCTYPE}-${MY_PV}
29S=${WORKDIR}/${MY_P} 58S=${WORKDIR}/${MY_P}
30 59
31HOMEPAGE="http://www.qtsoftware.com/" 60HOMEPAGE="http://www.qtsoftware.com/"
32SRC_URI="http://download.qtsoftware.com/qt/source/${MY_P}.tar.bz2" 61SRC_URI="http://get.qtsoftware.com/qt/source/${MY_P}.tar.bz2"
33 62
34case "${PV}" in 63case "${PV}" in
35 4.4.?) SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-headers.tar.bz2" ;; 64 4.4.?) SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-headers.tar.bz2" ;;
36 *) ;; 65 *) ;;
37esac 66esac
78 if ! version_is_at_least 4.1 $(gcc-version) ; then 107 if ! version_is_at_least 4.1 $(gcc-version) ; then
79 ewarn "Using a GCC version lower than 4.1 is not supported!" 108 ewarn "Using a GCC version lower than 4.1 is not supported!"
80 echo 109 echo
81 ebeep 3 110 ebeep 3
82 fi 111 fi
83
84 if use custom-cxxflags; then
85 echo
86 ewarn "You have set USE=custom-cxxflags, which means Qt will be built with the"
87 ewarn "CXXFLAGS you have set in /etc/make.conf. This is not supported, and we"
88 ewarn "recommend to unset this useflag. But you are free to experiment with it."
89 ewarn "Just do not start crying if it breaks your system, or eats your kitten"
90 ewarn "for breakfast. ;-) "
91 echo
92 fi
93
94} 112}
95 113
96# @ECLASS-VARIABLE: QT4_TARGET_DIRECTORIES 114# @ECLASS-VARIABLE: QT4_TARGET_DIRECTORIES
97# @DESCRIPTION: 115# @DESCRIPTION:
98# Arguments for build_target_directories. Takes the directories, in which the 116# Arguments for build_target_directories. Takes the directories, in which the
133 if [[ $EAPI != 2 ]]; then 151 if [[ $EAPI != 2 ]]; then
134 qt4-build_src_prepare 152 qt4-build_src_prepare
135 fi 153 fi
136} 154}
137 155
156# @ECLASS-VARIABLE: PATCHES
157# @DESCRIPTION:
158# In case you have patches to apply, specify them in PATCHES variable. Make sure
159# to specify the full path. This variable is necessary for src_prepare phase.
160# example:
161# PATCHES="${FILESDIR}"/mypatch.patch
162# ${FILESDIR}"/mypatch2.patch"
163#
138 164
139# @FUNCTION: qt4-build_src_prepare 165# @FUNCTION: qt4-build_src_prepare
140# @DESCRIPTION: 166# @DESCRIPTION:
141# Prepare the sources before the configure phase. Strip CFLAGS if necessary, and fix 167# Prepare the sources before the configure phase. Strip CFLAGS if necessary, and fix
142# source files in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified on /etc/make.conf. 168# source files in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified on /etc/make.conf.
145 171
146 if [[ ${PN} != qt-core ]]; then 172 if [[ ${PN} != qt-core ]]; then
147 skip_qmake_build_patch 173 skip_qmake_build_patch
148 skip_project_generation_patch 174 skip_project_generation_patch
149 symlink_binaries_to_buildtree 175 symlink_binaries_to_buildtree
150 fi
151
152 if ! use custom-cxxflags;then
153 # Don't let the user go too overboard with flags.
154 strip-flags
155 replace-flags -O3 -O2
156 fi 176 fi
157 177
158 # Bug 178652 178 # Bug 178652
159 if [[ "$(gcc-major-version)" == "3" ]] && use amd64; then 179 if [[ "$(gcc-major-version)" == "3" ]] && use amd64; then
160 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS" 180 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS"
180 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ 200 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \
181 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ 201 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \
182 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \ 202 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \
183 -i "${S}"/mkspecs/common/g++.conf || die "sed ${S}/mkspecs/common/g++.conf failed" 203 -i "${S}"/mkspecs/common/g++.conf || die "sed ${S}/mkspecs/common/g++.conf failed"
184 204
205 base_src_prepare
185} 206}
186 207
187# @FUNCTION: qt4-build_src_configure 208# @FUNCTION: qt4-build_src_configure
188# @DESCRIPTION: 209# @DESCRIPTION:
189# Default configure phase 210# Default configure phase
251 alpha|arm|ia64|mips|s390|sparc) myconf="${myconf} -arch $(tc-arch)" ;; 272 alpha|arm|ia64|mips|s390|sparc) myconf="${myconf} -arch $(tc-arch)" ;;
252 hppa|sh) myconf="${myconf} -arch generic" ;; 273 hppa|sh) myconf="${myconf} -arch generic" ;;
253 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;; 274 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;;
254 esac 275 esac
255 276
256 # Bug 261412 Qt configure detects archs by uname
257 case "$(tc-arch)" in
258 ppc) myconf="${myconf} -platform linux-g++-32";;
259 esac
260
261 myconf="${myconf} -stl -verbose -largefile -confirm-license -no-rpath 277 myconf="${myconf} -platform $(qt_mkspecs_dir) -stl -verbose -largefile -confirm-license -no-rpath
262 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR} 278 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR}
263 -datadir ${QTDATADIR} -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR} 279 -datadir ${QTDATADIR} -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR}
264 -plugindir ${QTPLUGINDIR} -sysconfdir ${QTSYSCONFDIR} 280 -plugindir ${QTPLUGINDIR} -sysconfdir ${QTSYSCONFDIR}
265 -translationdir ${QTTRANSDIR} -examplesdir ${QTEXAMPLESDIR} 281 -translationdir ${QTTRANSDIR} -examplesdir ${QTEXAMPLESDIR}
266 -demosdir ${QTDEMOSDIR} -silent -fast 282 -demosdir ${QTDEMOSDIR} -silent -fast
267 $([[ ${PN} == qt-xmlpatterns ]] || echo -no-exceptions) 283 $([[ ${PN} == qt-xmlpatterns ]] || echo -no-exceptions)
268 -reduce-relocations -nomake examples -nomake demos" 284 -reduce-relocations -nomake examples -nomake demos"
269 285
270 # Make eclass 4.5.{1,2} ready 286 # Make eclass 4.5.{1,2} ready
271 case "${MY_PV}" in 287 case "${MY_PV}" in
272 4.5.1 | 4.5.2) 288 4.5.1 | 4.5.2)
273 myconf="${myconf} -opensource" 289 myconf="${myconf} -opensource"
274 ;; 290 ;;
275 esac
276
277 # bug 270475
278 case "${MY_PV}" in
279 4.5.1 | 4.5.2)
280 myconf="${myconf} -platform $(qt_mkspecs_dir)"
281 ;;
282 esac 291 esac
283 292
284 echo "${myconf}" 293 echo "${myconf}"
285} 294}
286 295
485 rmdir "${D}"/${QTLIBDIR}/pkgconfig 494 rmdir "${D}"/${QTLIBDIR}/pkgconfig
486} 495}
487 496
488# @FUNCTION: qt_use 497# @FUNCTION: qt_use
489# @USAGE: < flag > [ feature ] [ enableval ] 498# @USAGE: < flag > [ feature ] [ enableval ]
490# @DESCRIPTION: 499# @DESCRIPTION:
491# This will echo "${enableval}-${feature}" if <flag> is enabled, or 500# This will echo "${enableval}-${feature}" if <flag> is enabled, or
492# "-no-${feature} if the flag is disabled. If [feature] is not specified <flag> 501# "-no-${feature} if the flag is disabled. If [feature] is not specified <flag>
493# will be used for that. If [enableval] is not specified, it omits the 502# will be used for that. If [enableval] is not specified, it omits the
494# assignment-part 503# assignment-part
495qt_use() { 504qt_use() {
577 fi 586 fi
578} 587}
579 588
580# @FUNCTION: qt_mkspecs_dir 589# @FUNCTION: qt_mkspecs_dir
581# @RETURN: the specs-directory w/o path 590# @RETURN: the specs-directory w/o path
582# @DESCRIPTION: 591# @DESCRIPTION:
583# Allows us to define which mkspecs dir we want to use. 592# Allows us to define which mkspecs dir we want to use.
584qt_mkspecs_dir() { 593qt_mkspecs_dir() {
585 # Allows us to define which mkspecs dir we want to use. 594 # Allows us to define which mkspecs dir we want to use.
586 local spec 595 local spec
587 596

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.20