/[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.37 Revision 1.41
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.37 2009/05/29 20:58:54 hwoarang Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.41 2009/06/28 15:24:42 hwoarang 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>,
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 base 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"
17RDEPEND=" 17RDEPEND="
18 !<x11-libs/qt-assistant-${PV} 18 !<x11-libs/qt-assistant-${PV}
19 !>x11-libs/qt-assistant-${PV}-r9999 19 !>x11-libs/qt-assistant-${PV}-r9999
20 !<x11-libs/qt-core-${PV} 20 !<x11-libs/qt-core-${PV}
21 !>x11-libs/qt-core-${PV}-r9999 21 !>x11-libs/qt-core-${PV}-r9999
56esac 56esac
57MY_P=qt-x11-${SRCTYPE}-${MY_PV} 57MY_P=qt-x11-${SRCTYPE}-${MY_PV}
58S=${WORKDIR}/${MY_P} 58S=${WORKDIR}/${MY_P}
59 59
60HOMEPAGE="http://www.qtsoftware.com/" 60HOMEPAGE="http://www.qtsoftware.com/"
61SRC_URI="http://download.qtsoftware.com/qt/source/${MY_P}.tar.bz2" 61SRC_URI="http://get.qtsoftware.com/qt/source/${MY_P}.tar.bz2"
62 62
63case "${PV}" in 63case "${PV}" in
64 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" ;;
65 *) ;; 65 *) ;;
66esac 66esac
107 if ! version_is_at_least 4.1 $(gcc-version) ; then 107 if ! version_is_at_least 4.1 $(gcc-version) ; then
108 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!"
109 echo 109 echo
110 ebeep 3 110 ebeep 3
111 fi 111 fi
112
113 if use custom-cxxflags; then
114 echo
115 ewarn "You have set USE=custom-cxxflags, which means Qt will be built with the"
116 ewarn "CXXFLAGS you have set in /etc/make.conf. This is not supported, and we"
117 ewarn "recommend to unset this useflag. But you are free to experiment with it."
118 ewarn "Just do not start crying if it breaks your system, or eats your kitten"
119 ewarn "for breakfast. ;-) "
120 echo
121 fi
122
123} 112}
124 113
125# @ECLASS-VARIABLE: QT4_TARGET_DIRECTORIES 114# @ECLASS-VARIABLE: QT4_TARGET_DIRECTORIES
126# @DESCRIPTION: 115# @DESCRIPTION:
127# Arguments for build_target_directories. Takes the directories, in which the 116# Arguments for build_target_directories. Takes the directories, in which the
184 skip_qmake_build_patch 173 skip_qmake_build_patch
185 skip_project_generation_patch 174 skip_project_generation_patch
186 symlink_binaries_to_buildtree 175 symlink_binaries_to_buildtree
187 fi 176 fi
188 177
189 if ! use custom-cxxflags;then
190 # Don't let the user go too overboard with flags.
191 strip-flags
192 replace-flags -O3 -O2
193 fi
194
195 # Bug 178652 178 # Bug 178652
196 if [[ "$(gcc-major-version)" == "3" ]] && use amd64; then 179 if [[ "$(gcc-major-version)" == "3" ]] && use amd64; then
197 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS" 180 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS"
198 append-flags -fno-gcse 181 append-flags -fno-gcse
199 fi 182 fi
216 199
217 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ 200 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \
218 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ 201 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \
219 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \ 202 -e "s:QMAKE_LFLAGS_RELEASE.*=.*:QMAKE_LFLAGS_RELEASE=${LDFLAGS}:" \
220 -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"
221 204
222 base_src_prepare 205 base_src_prepare
223} 206}
224 207
225# @FUNCTION: qt4-build_src_configure 208# @FUNCTION: qt4-build_src_configure
226# @DESCRIPTION: 209# @DESCRIPTION:
289 alpha|arm|ia64|mips|s390|sparc) myconf="${myconf} -arch $(tc-arch)" ;; 272 alpha|arm|ia64|mips|s390|sparc) myconf="${myconf} -arch $(tc-arch)" ;;
290 hppa|sh) myconf="${myconf} -arch generic" ;; 273 hppa|sh) myconf="${myconf} -arch generic" ;;
291 *) 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." ;;
292 esac 275 esac
293 276
294 # Bug 261412 Qt configure detects archs by uname
295 case "$(tc-arch)" in
296 ppc) myconf="${myconf} -platform linux-g++-32";;
297 esac
298
299 myconf="${myconf} -stl -verbose -largefile -confirm-license -no-rpath 277 myconf="${myconf} -platform $(qt_mkspecs_dir) -stl -verbose -largefile -confirm-license -no-rpath
300 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR} 278 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR}
301 -datadir ${QTDATADIR} -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR} 279 -datadir ${QTDATADIR} -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR}
302 -plugindir ${QTPLUGINDIR} -sysconfdir ${QTSYSCONFDIR} 280 -plugindir ${QTPLUGINDIR} -sysconfdir ${QTSYSCONFDIR}
303 -translationdir ${QTTRANSDIR} -examplesdir ${QTEXAMPLESDIR} 281 -translationdir ${QTTRANSDIR} -examplesdir ${QTEXAMPLESDIR}
304 -demosdir ${QTDEMOSDIR} -silent -fast 282 -demosdir ${QTDEMOSDIR} -silent -fast
305 $([[ ${PN} == qt-xmlpatterns ]] || echo -no-exceptions) 283 $([[ ${PN} == qt-xmlpatterns ]] || echo -no-exceptions)
306 -reduce-relocations -nomake examples -nomake demos" 284 -reduce-relocations -nomake examples -nomake demos"
307 285
308 # Make eclass 4.5.{1,2} ready 286 # Make eclass 4.5.{1,2} ready
309 case "${MY_PV}" in 287 case "${MY_PV}" in
310 4.5.1 | 4.5.2) 288 4.5.1 | 4.5.2)
311 myconf="${myconf} -opensource" 289 myconf="${myconf} -opensource"
312 ;; 290 ;;
456 ewarn "Packages that typically need to be recompiled are kdelibs from KDE4, any" 434 ewarn "Packages that typically need to be recompiled are kdelibs from KDE4, any"
457 ewarn "additional KDE4/Qt4 styles, qscintilla and PyQt4. Before filing a bug report," 435 ewarn "additional KDE4/Qt4 styles, qscintilla and PyQt4. Before filing a bug report,"
458 ewarn "make sure all your Qt4 packages are up-to-date and built with the same" 436 ewarn "make sure all your Qt4 packages are up-to-date and built with the same"
459 ewarn "configuration." 437 ewarn "configuration."
460 ewarn 438 ewarn
461 ewarn "For more information, see http://doc.trolltech.com/4.4/plugins-howto.html" 439 ewarn "For more information, see http://doc.trolltech.com/${PV%.*}/plugins-howto.html"
462 echo 440 echo
463} 441}
464 442
465# @FUNCTION: skip_qmake_build_patch 443# @FUNCTION: skip_qmake_build_patch
466# @DESCRIPTION: 444# @DESCRIPTION:
516 rmdir "${D}"/${QTLIBDIR}/pkgconfig 494 rmdir "${D}"/${QTLIBDIR}/pkgconfig
517} 495}
518 496
519# @FUNCTION: qt_use 497# @FUNCTION: qt_use
520# @USAGE: < flag > [ feature ] [ enableval ] 498# @USAGE: < flag > [ feature ] [ enableval ]
521# @DESCRIPTION: 499# @DESCRIPTION:
522# This will echo "${enableval}-${feature}" if <flag> is enabled, or 500# This will echo "${enableval}-${feature}" if <flag> is enabled, or
523# "-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>
524# 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
525# assignment-part 503# assignment-part
526qt_use() { 504qt_use() {
608 fi 586 fi
609} 587}
610 588
611# @FUNCTION: qt_mkspecs_dir 589# @FUNCTION: qt_mkspecs_dir
612# @RETURN: the specs-directory w/o path 590# @RETURN: the specs-directory w/o path
613# @DESCRIPTION: 591# @DESCRIPTION:
614# Allows us to define which mkspecs dir we want to use. 592# Allows us to define which mkspecs dir we want to use.
615qt_mkspecs_dir() { 593qt_mkspecs_dir() {
616 # Allows us to define which mkspecs dir we want to use. 594 # Allows us to define which mkspecs dir we want to use.
617 local spec 595 local spec
618 596

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.41

  ViewVC Help
Powered by ViewVC 1.1.20