/[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.44 Revision 1.51
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.44 2009/08/11 14:44:16 hwoarang Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.51 2009/11/10 00:56:29 spatz 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://qt.nokia.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://download.qt.nokia.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
158 if [[ ${PN} != qt-core ]]; then 175 if [[ ${PN} != qt-core ]]; then
159 skip_qmake_build_patch 176 skip_qmake_build_patch
160 skip_project_generation_patch 177 skip_project_generation_patch
161 symlink_binaries_to_buildtree 178 symlink_binaries_to_buildtree
162 fi 179 fi
180
181 # Bug 282984
182 sed -e "s/\(^SYSTEM_VARIABLES\)/CC=$(tc-getCC)\nCXX=$(tc-getCXX)\n\1/" \
183 -i configure || die "sed qmake compilers failed"
184 sed -e "s/\(\$MAKE\)/\1 CC=$(tc-getCC) CXX=$(tc-getCXX) LD=$(tc-getCXX)/" \
185 -i config.tests/unix/compile.test || die "sed test compilers failed"
163 186
164 # Bug 178652 187 # Bug 178652
165 if [[ "$(gcc-major-version)" == "3" ]] && use amd64; then 188 if [[ "$(gcc-major-version)" == "3" ]] && use amd64; then
166 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS" 189 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS"
167 append-flags -fno-gcse 190 append-flags -fno-gcse
172 ewarn "Appending -fno-stack-protector to CXXFLAGS" 195 ewarn "Appending -fno-stack-protector to CXXFLAGS"
173 append-cxxflags -fno-stack-protector 196 append-cxxflags -fno-stack-protector
174 # Bug 253127 197 # Bug 253127
175 sed -e "/^QMAKE_CFLAGS\t/ s:$: -fno-stack-protector-all:" \ 198 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" 199 -i "${S}"/mkspecs/common/g++.conf || die "sed ${S}/mkspecs/common/g++.conf failed"
200 fi
201
202 # Bug 261632
203 if use ppc64; then
204 ewarn "Appending -mminimal-toc to CFLAGS/CXXFLAGS"
205 append-flags -mminimal-toc
177 fi 206 fi
178 207
179 # Bug 172219 208 # Bug 172219
180 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \ 209 sed -e "s:QMAKE_CFLAGS_RELEASE.*=.*:QMAKE_CFLAGS_RELEASE=${CFLAGS}:" \
181 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \ 210 -e "s:QMAKE_CXXFLAGS_RELEASE.*=.*:QMAKE_CXXFLAGS_RELEASE=${CXXFLAGS}:" \
284 alpha|arm|ia64|mips|s390|sparc) myconf="${myconf} -arch $(tc-arch)" ;; 313 alpha|arm|ia64|mips|s390|sparc) myconf="${myconf} -arch $(tc-arch)" ;;
285 hppa|sh) myconf="${myconf} -arch generic" ;; 314 hppa|sh) myconf="${myconf} -arch generic" ;;
286 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;; 315 *) die "$(tc-arch) is unsupported by this eclass. Please file a bug." ;;
287 esac 316 esac
288 317
318 # 4.6: build qt-core with exceptions or qt-xmlpatterns won't build
319 local exceptions=
320 case "${PV}" in
321 4.6.*)
322 if [[ ${PN} != "qt-core" ]] && [[ ${PN} != "qt-xmlpatterns" ]]; then
323 exceptions="-no-exceptions"
324 fi
325 ;;
326 *)
327 [[ ${PN} == "qt-xmlpatterns" ]] || exceptions="-no-exceptions"
328 ;;
329 esac
330
289 myconf="${myconf} -platform $(qt_mkspecs_dir) -stl -verbose -largefile -confirm-license -no-rpath 331 myconf="${myconf} -platform $(qt_mkspecs_dir) -stl -verbose -largefile -confirm-license
290 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR} 332 -prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR}
291 -datadir ${QTDATADIR} -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR} 333 -datadir ${QTDATADIR} -docdir ${QTDOCDIR} -headerdir ${QTHEADERDIR}
292 -plugindir ${QTPLUGINDIR} -sysconfdir ${QTSYSCONFDIR} 334 -plugindir ${QTPLUGINDIR} -sysconfdir ${QTSYSCONFDIR}
293 -translationdir ${QTTRANSDIR} -examplesdir ${QTEXAMPLESDIR} 335 -translationdir ${QTTRANSDIR} -examplesdir ${QTEXAMPLESDIR}
294 -demosdir ${QTDEMOSDIR} -silent -fast 336 -demosdir ${QTDEMOSDIR} -silent -fast
295 $([[ ${PN} == qt-xmlpatterns ]] || echo -no-exceptions) 337 ${exceptions}
296 -reduce-relocations -nomake examples -nomake demos" 338 -reduce-relocations -nomake examples -nomake demos"
297 339
298 # Make eclass 4.5.{1,2} ready 340 # Make eclass >= 4.5.x ready
299 case "${MY_PV}" in 341 case "${MY_PV}" in
300 4.5.1 | 4.5.2) 342 4.5.* | 4.6.* )
301 myconf="${myconf} -opensource" 343 myconf="${myconf} -opensource"
302 ;; 344 ;;
303 esac 345 esac
304 346
305 echo "${myconf}" 347 echo "${myconf}"
313 local dirs="$@" 355 local dirs="$@"
314 for x in ${dirs}; do 356 for x in ${dirs}; do
315 cd "${S}"/${x} 357 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 358 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" 359 "${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" || die "qmake failed"
318 emake || die "emake failed" 360 emake CC="@echo compiling \$< && $(tc-getCC)" \
361 CXX="@echo compiling \$< && $(tc-getCXX)" \
362 LINK="@echo linking \$@ && $(tc-getCXX)" || die "emake failed"
319 done 363 done
320} 364}
321 365
322# @FUNCTION: install_directories 366# @FUNCTION: install_directories
323# @USAGE: < directories > 367# @USAGE: < directories >

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.51

  ViewVC Help
Powered by ViewVC 1.1.20