/[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.35 Revision 1.39
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.35 2009/05/23 01:08:26 hwoarang Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.39 2009/06/27 12:37:32 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} custom-cxxflags 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
133 if [[ $EAPI != 2 ]]; then 162 if [[ $EAPI != 2 ]]; then
134 qt4-build_src_prepare 163 qt4-build_src_prepare
135 fi 164 fi
136} 165}
137 166
167# @ECLASS-VARIABLE: PATCHES
168# @DESCRIPTION:
169# In case you have patches to apply, specify them in PATCHES variable. Make sure
170# to specify the full path. This variable is necessary for src_prepare phase.
171# example:
172# PATCHES="${FILESDIR}"/mypatch.patch
173# ${FILESDIR}"/mypatch2.patch"
174#
138 175
139# @FUNCTION: qt4-build_src_prepare 176# @FUNCTION: qt4-build_src_prepare
140# @DESCRIPTION: 177# @DESCRIPTION:
141# Prepare the sources before the configure phase. Strip CFLAGS if necessary, and fix 178# 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. 179# source files in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified on /etc/make.conf.
180 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ 217 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \
181 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ 218 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \
182 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \ 219 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \
183 -i "${S}"/mkspecs/common/g++.conf || die "sed ${S}/mkspecs/common/g++.conf failed" 220 -i "${S}"/mkspecs/common/g++.conf || die "sed ${S}/mkspecs/common/g++.conf failed"
184 221
222 base_src_prepare
185} 223}
186 224
187# @FUNCTION: qt4-build_src_configure 225# @FUNCTION: qt4-build_src_configure
188# @DESCRIPTION: 226# @DESCRIPTION:
189# Default configure phase 227# Default configure phase
251 alpha|arm|ia64|mips|s390|sparc) myconf="${myconf} -arch $(tc-arch)" ;; 289 alpha|arm|ia64|mips|s390|sparc) myconf="${myconf} -arch $(tc-arch)" ;;
252 hppa|sh) myconf="${myconf} -arch generic" ;; 290 hppa|sh) myconf="${myconf} -arch generic" ;;
253 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;; 291 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;;
254 esac 292 esac
255 293
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 294 myconf="${myconf} -platform $(qt_mkspecs_dir) -stl -verbose -largefile -confirm-license -no-rpath
262 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR} 295 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR}
263 -datadir ${QTDATADIR} -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR} 296 -datadir ${QTDATADIR} -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR}
264 -plugindir ${QTPLUGINDIR} -sysconfdir ${QTSYSCONFDIR} 297 -plugindir ${QTPLUGINDIR} -sysconfdir ${QTSYSCONFDIR}
265 -translationdir ${QTTRANSDIR} -examplesdir ${QTEXAMPLESDIR} 298 -translationdir ${QTTRANSDIR} -examplesdir ${QTEXAMPLESDIR}
266 -demosdir ${QTDEMOSDIR} -silent -fast 299 -demosdir ${QTDEMOSDIR} -silent -fast
267 $([[ ${PN} == qt-xmlpatterns ]] || echo -no-exceptions) 300 $([[ ${PN} == qt-xmlpatterns ]] || echo -no-exceptions)
268 -reduce-relocations -nomake examples -nomake demos" 301 -reduce-relocations -nomake examples -nomake demos"
269 302
270 # Make eclass 4.5.{1,2} ready 303 # Make eclass 4.5.{1,2} ready
271 case "${MY_PV}" in 304 case "${MY_PV}" in
272 4.5.1 | 4.5.2) 305 4.5.1 | 4.5.2)
273 myconf="${myconf} -opensource" 306 myconf="${myconf} -opensource"
274 ;; 307 ;;
478 rmdir "${D}"/${QTLIBDIR}/pkgconfig 511 rmdir "${D}"/${QTLIBDIR}/pkgconfig
479} 512}
480 513
481# @FUNCTION: qt_use 514# @FUNCTION: qt_use
482# @USAGE: < flag > [ feature ] [ enableval ] 515# @USAGE: < flag > [ feature ] [ enableval ]
483# @DESCRIPTION: 516# @DESCRIPTION:
484# This will echo "${enableval}-${feature}" if <flag> is enabled, or 517# This will echo "${enableval}-${feature}" if <flag> is enabled, or
485# "-no-${feature} if the flag is disabled. If [feature] is not specified <flag> 518# "-no-${feature} if the flag is disabled. If [feature] is not specified <flag>
486# will be used for that. If [enableval] is not specified, it omits the 519# will be used for that. If [enableval] is not specified, it omits the
487# assignment-part 520# assignment-part
488qt_use() { 521qt_use() {
570 fi 603 fi
571} 604}
572 605
573# @FUNCTION: qt_mkspecs_dir 606# @FUNCTION: qt_mkspecs_dir
574# @RETURN: the specs-directory w/o path 607# @RETURN: the specs-directory w/o path
575# @DESCRIPTION: 608# @DESCRIPTION:
576# Allows us to define which mkspecs dir we want to use. 609# Allows us to define which mkspecs dir we want to use.
577qt_mkspecs_dir() { 610qt_mkspecs_dir() {
578 # Allows us to define which mkspecs dir we want to use. 611 # Allows us to define which mkspecs dir we want to use.
579 local spec 612 local spec
580 613

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.39

  ViewVC Help
Powered by ViewVC 1.1.20