/[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.43 Revision 1.49
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.43 2009/07/31 22:18:31 tommy Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.49 2009/11/09 19:30:40 ayoy 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# Alex Alexander <wired@gentoo.org>
10# @BLURB: Eclass for Qt4 split ebuilds. 11# @BLURB: Eclass for Qt4 split ebuilds.
11# @DESCRIPTION: 12# @DESCRIPTION:
12# This eclass contains various functions that are used when building Qt4 13# This eclass contains various functions that are used when building Qt4
13 14
14inherit base eutils multilib toolchain-funcs flag-o-matic versionator 15inherit base eutils multilib toolchain-funcs flag-o-matic versionator
43 !>x11-libs/qt-webkit-${PV}-r9999 44 !>x11-libs/qt-webkit-${PV}-r9999
44 !<x11-libs/qt-xmlpatterns-${PV} 45 !<x11-libs/qt-xmlpatterns-${PV}
45 !>x11-libs/qt-xmlpatterns-${PV}-r9999 46 !>x11-libs/qt-xmlpatterns-${PV}-r9999
46" 47"
47case "${PV}" in 48case "${PV}" in
48 4.?.?_rc*) 49 4.?.?_rc* | 4.?.?_beta* )
49 SRCTYPE="${SRCTYPE:-opensource-src}" 50 SRCTYPE="${SRCTYPE:-opensource-src}"
50 MY_PV="${PV/_rc/-rc}" 51 MY_PV="${PV/_/-}"
51 ;; 52 ;;
52 *) 53 *)
53 SRCTYPE="${SRCTYPE:-opensource-src}" 54 SRCTYPE="${SRCTYPE:-opensource-src}"
54 MY_PV="${PV}" 55 MY_PV="${PV}"
55 ;; 56 ;;
56esac 57esac
58
59if version_is_at_least 4.5.99999999 ${PV} ; then
60 MY_P="qt-everywhere-${SRCTYPE}-${MY_PV}"
61else
57MY_P=qt-x11-${SRCTYPE}-${MY_PV} 62 MY_P="qt-x11-${SRCTYPE}-${MY_PV}"
63fi
58S=${WORKDIR}/${MY_P} 64S=${WORKDIR}/${MY_P}
59 65
60HOMEPAGE="http://www.qtsoftware.com/" 66HOMEPAGE="http://qt.nokia.com/"
67if version_is_at_least 4.5.3 ${PV} ; then
68 SRC_URI="http://get.qt.nokia.com/qt/source/${MY_P}.tar.gz"
69else
61SRC_URI="http://get.qtsoftware.com/qt/source/${MY_P}.tar.bz2" 70 SRC_URI="http://get.qt.nokia.com/qt/source/${MY_P}.tar.bz2"
71fi
62 72
63case "${PV}" in 73case "${PV}" in
64 4.4.?) SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-headers.tar.bz2" ;; 74 4.4.?) SRC_URI="${SRC_URI} mirror://gentoo/${MY_P}-headers.tar.bz2" ;;
65 *) ;; 75 *) ;;
66esac 76esac
108# @FUNCTION: qt4-build_src_unpack 118# @FUNCTION: qt4-build_src_unpack
109# @DESCRIPTION: 119# @DESCRIPTION:
110# Unpacks the sources 120# Unpacks the sources
111qt4-build_src_unpack() { 121qt4-build_src_unpack() {
112 setqtenv 122 setqtenv
113 local target targets licenses 123 local target targets licenses tar_pkg tar_args
114 if version_is_at_least 4.5 ${PV} ; then 124 if version_is_at_least 4.5 ${PV} ; then
115 licenses="LICENSE.GPL3 LICENSE.LGPL" 125 licenses="LICENSE.GPL3 LICENSE.LGPL"
116 else 126 else
117 licenses="LICENSE.GPL2 LICENSE.GPL3" 127 licenses="LICENSE.GPL2 LICENSE.GPL3"
118 fi 128 fi
120 src/{qbase,qt_targets,qt_install}.pri bin config.tests mkspecs qmake \ 130 src/{qbase,qt_targets,qt_install}.pri bin config.tests mkspecs qmake \
121 ${QT4_EXTRACT_DIRECTORIES}; do 131 ${QT4_EXTRACT_DIRECTORIES}; do
122 targets="${targets} ${MY_P}/${target}" 132 targets="${targets} ${MY_P}/${target}"
123 done 133 done
124 134
125 echo tar xjpf "${DISTDIR}"/${MY_P}.tar.bz2 ${targets} 135 tar_pkg=${MY_P}.tar.bz2
126 tar xjpf "${DISTDIR}"/${MY_P}.tar.bz2 ${targets} 136 tar_args="xjpf"
137 if version_is_at_least 4.5.3 ${PV} ; then
138 tar_pkg=${tar_pkg/bz2/gz}
139 tar_args="xzpf"
140 fi
141
142 echo tar ${tar_args} "${DISTDIR}"/${tar_pkg} ${targets}
143 tar ${tar_args} "${DISTDIR}"/${tar_pkg} ${targets}
127 144
128 case "${PV}" in 145 case "${PV}" in
129 4.4.?) 146 4.4.?)
130 echo tar xjpf "${DISTDIR}"/${MY_P}-headers.tar.bz2 147 echo tar xjpf "${DISTDIR}"/${MY_P}-headers.tar.bz2
131 tar xjpf "${DISTDIR}"/${MY_P}-headers.tar.bz2 148 tar xjpf "${DISTDIR}"/${MY_P}-headers.tar.bz2
172 ewarn "Appending -fno-stack-protector to CXXFLAGS" 189 ewarn "Appending -fno-stack-protector to CXXFLAGS"
173 append-cxxflags -fno-stack-protector 190 append-cxxflags -fno-stack-protector
174 # Bug 253127 191 # Bug 253127
175 sed -e "/^QMAKE_CFLAGS\t/ s:$: -fno-stack-protector-all:" \ 192 sed -e "/^QMAKE_CFLAGS\t/ s:$: -fno-stack-protector-all:" \
176 -i "${S}"/mkspecs/common/g++.conf || die "sed ${S}/mkspecs/common/g++.conf failed" 193 -i "${S}"/mkspecs/common/g++.conf || die "sed ${S}/mkspecs/common/g++.conf failed"
194 fi
195
196 # Bug 261632
197 if use ppc64; then
198 ewarn "Appending -mminimal-toc to CFLAGS/CXXFLAGS"
199 append-flags -mminimal-toc
177 fi 200 fi
178 201
179 # Bug 172219 202 # Bug 172219
180 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ 203 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \
181 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ 204 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \
284 alpha|arm|ia64|mips|s390|sparc) myconf="${myconf} -arch $(tc-arch)" ;; 307 alpha|arm|ia64|mips|s390|sparc) myconf="${myconf} -arch $(tc-arch)" ;;
285 hppa|sh) myconf="${myconf} -arch generic" ;; 308 hppa|sh) myconf="${myconf} -arch generic" ;;
286 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;; 309 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;;
287 esac 310 esac
288 311
312 # 4.6: build qt-core with exceptions or qt-xmlpatterns won't build
313 local exceptions=
314 case "${PV}" in
315 4.6.*)
316 if [[ ${PN} != "qt-core" ]] && [[ ${PN} != "qt-xmlpatterns" ]]; then
317 exceptions="-no-exceptions"
318 fi
319 ;;
320 *)
321 [[ ${PN} == "qt-xmlpatterns" ]] || exceptions="-no-exceptions"
322 ;;
323 esac
324
289 myconf="${myconf} -platform $(qt_mkspecs_dir) -stl -verbose -largefile -confirm-license -no-rpath 325 myconf="${myconf} -platform $(qt_mkspecs_dir) -stl -verbose -largefile -confirm-license -no-rpath
290 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR} 326 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR}
291 -datadir ${QTDATADIR} -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR} 327 -datadir ${QTDATADIR} -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR}
292 -plugindir ${QTPLUGINDIR} -sysconfdir ${QTSYSCONFDIR} 328 -plugindir ${QTPLUGINDIR} -sysconfdir ${QTSYSCONFDIR}
293 -translationdir ${QTTRANSDIR} -examplesdir ${QTEXAMPLESDIR} 329 -translationdir ${QTTRANSDIR} -examplesdir ${QTEXAMPLESDIR}
294 -demosdir ${QTDEMOSDIR} -silent -fast 330 -demosdir ${QTDEMOSDIR} -silent -fast
295 $([[ ${PN} == qt-xmlpatterns ]] || echo -no-exceptions) 331 ${exceptions}
296 -reduce-relocations -nomake examples -nomake demos" 332 -reduce-relocations -nomake examples -nomake demos"
297 333
298 # Make eclass 4.5.{1,2} ready 334 # Make eclass >= 4.5.x ready
299 case "${MY_PV}" in 335 case "${MY_PV}" in
300 4.5.1 | 4.5.2) 336 4.5.* | 4.6.* )
301 myconf="${myconf} -opensource" 337 myconf="${myconf} -opensource"
302 ;; 338 ;;
303 esac 339 esac
304 340
305 echo "${myconf}" 341 echo "${myconf}"
313 local dirs="$@" 349 local dirs="$@"
314 for x in ${dirs}; do 350 for x in ${dirs}; do
315 cd "${S}"/${x} 351 cd "${S}"/${x}
316 sed -i -e "s:\$\$\[QT_INSTALL_LIBS\]:/usr/$(get_libdir)/qt4:g" $(find "${S}" -name '*.pr[io]') "${S}"/mkspecs/common/linux.conf || die 352 sed -i -e "s:\$\$\[QT_INSTALL_LIBS\]:/usr/$(get_libdir)/qt4:g" $(find "${S}" -name '*.pr[io]') "${S}"/mkspecs/common/linux.conf || die
317 "${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" || die "qmake failed" 353 "${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" || die "qmake failed"
318 emake || die "emake failed" 354 emake CC="@echo compiling \$< && $(tc-getCC)" \
355 CXX="@echo compiling \$< && $(tc-getCXX)" \
356 LINK="@echo linking \$@ && $(tc-getCXX)" || die "emake failed"
319 done 357 done
320} 358}
321 359
322# @FUNCTION: install_directories 360# @FUNCTION: install_directories
323# @USAGE: < directories > 361# @USAGE: < directories >

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.49

  ViewVC Help
Powered by ViewVC 1.1.20