/[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.83 Revision 1.91
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-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.83 2010/09/05 09:25:08 hwoarang Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.91 2011/07/08 11:35:01 ssuominen 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>,
15inherit base eutils multilib toolchain-funcs flag-o-matic versionator 15inherit base eutils multilib toolchain-funcs flag-o-matic versionator
16 16
17MY_PV=${PV/_/-} 17MY_PV=${PV/_/-}
18if version_is_at_least 4.5.99999999; then 18if version_is_at_least 4.5.99999999; then
19 MY_P=qt-everywhere-opensource-src-${MY_PV} 19 MY_P=qt-everywhere-opensource-src-${MY_PV}
20 [[ ${CATEGORY}/${PN} != x11-libs/qt-xmlpatterns ]] && IUSE="+exceptions" 20 [[ ${CATEGORY}/${PN} != x11-libs/qt-xmlpatterns ]] &&
21 [[ ${CATEGORY}/${PN} != x11-themes/qgtkstyle ]] &&
22 IUSE="+exceptions"
21else 23else
22 MY_P=qt-x11-opensource-src-${MY_PV} 24 MY_P=qt-x11-opensource-src-${MY_PV}
23fi 25fi
24 26
25HOMEPAGE="http://qt.nokia.com/" 27HOMEPAGE="http://qt.nokia.com/"
170 die "visibility fixing sed failed" 172 die "visibility fixing sed failed"
171 fi 173 fi
172 # fix libx11 dependency on non X packages 174 # fix libx11 dependency on non X packages
173 if version_is_at_least "4.7.0_beta2"; then 175 if version_is_at_least "4.7.0_beta2"; then
174 local NOLIBX11PKG="qt-core qt-dbus qt-script qt-sql qt-test qt-xmlpatterns" 176 local NOLIBX11PKG="qt-core qt-dbus qt-script qt-sql qt-test qt-xmlpatterns"
175 hasq ${PN} ${NOLIBX11PKG} && qt_nolibx11 177 has ${PN} ${NOLIBX11PKG} && qt_nolibx11
176 [[ ${PN} == "qt-assistant" ]] && qt_assistant_cleanup 178 [[ ${PN} == "qt-assistant" ]] && qt_assistant_cleanup
177 fi 179 fi
178 180
179 if use aqua; then 181 if use aqua; then
180 # provide a proper macx-g++-64 182 # provide a proper macx-g++-64
192 fi 194 fi
193 195
194 if [[ ${CHOST} == *86*-apple-darwin* ]] ; then 196 if [[ ${CHOST} == *86*-apple-darwin* ]] ; then
195 # qmake bus errors with -O2 but -O3 works 197 # qmake bus errors with -O2 but -O3 works
196 replace-flags -O2 -O3 198 replace-flags -O2 -O3
197 fi
198
199 if [[ ${CHOST} == arm* ]] ; then
200 # Fails on arm with -Os, bug 331641
201 # This can be removed once qt-4.7 is stable or the bug on gcc is fixed
202 replace-flags -Os -O2
203 fi 199 fi
204 200
205 # Bug 178652 201 # Bug 178652
206 if [[ $(gcc-major-version) == 3 ]] && use amd64; then 202 if [[ $(gcc-major-version) == 3 ]] && use amd64; then
207 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS" 203 ewarn "Appending -fno-gcse to CFLAGS/CXXFLAGS"
222 ewarn "Appending -mminimal-toc to CFLAGS/CXXFLAGS" 218 ewarn "Appending -mminimal-toc to CFLAGS/CXXFLAGS"
223 append-flags -mminimal-toc 219 append-flags -mminimal-toc
224 fi 220 fi
225 221
226 # Bug 282984 && Bug 295530 222 # Bug 282984 && Bug 295530
227 sed -e "s:\(^SYSTEM_VARIABLES\):CC="$(tc-getCC)"\nCXX="$(tc-getCXX)"\nCFLAGS=\"${CFLAGS}\"\nCXXFLAGS=\"${CXXFLAGS}\"\nLDFLAGS=\"${LDFLAGS}\"\n\1:" \ 223 sed -e "s:\(^SYSTEM_VARIABLES\):CC=\"$(tc-getCC)\"\nCXX=\"$(tc-getCXX)\"\nCFLAGS=\"${CFLAGS}\"\nCXXFLAGS=\"${CXXFLAGS}\"\nLDFLAGS=\"${LDFLAGS}\"\n\1:" \
228 -i configure || die "sed qmake compilers failed" 224 -i configure || die "sed qmake compilers failed"
229 # bug 321335 225 # bug 321335
230 if version_is_at_least 4.6; then 226 if version_is_at_least 4.6; then
231 find ./config.tests/unix -name "*.test" -type f -exec grep -lZ \$MAKE '{}' \; | \ 227 find ./config.tests/unix -name "*.test" -type f -exec grep -lZ \$MAKE '{}' \; | \
232 xargs -0 \ 228 xargs -0 \
233 sed -e "s:\(\$MAKE\):\1 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getCXX)" LINK="$(tc-getCXX)":g" \ 229 sed -e "s:\(\$MAKE\):\1 CC=\"$(tc-getCC)\" CXX=\"$(tc-getCXX)\" LD=\"$(tc-getCXX)\" LINK=\"$(tc-getCXX)\":g" \
234 -i || die "sed test compilers failed" 230 -i || die "sed test compilers failed"
235 fi 231 fi
236 232
237 # Bug 172219 233 # Bug 172219
238 sed -e "s:X11R6/::" \ 234 sed -e "s:X11R6/::" \
335 # freetype2 include dir is non-standard, thus include it on configure 331 # freetype2 include dir is non-standard, thus include it on configure
336 # use -I from configure 332 # use -I from configure
337 myconf+=" $(pkg-config --cflags freetype2)" 333 myconf+=" $(pkg-config --cflags freetype2)"
338 fi 334 fi
339 335
336 # Disable SSE4.x, since auto-detection is currently broken
337 # Upstream bug http://bugreports.qt.nokia.com/browse/QTBUG-13623
338 [[ ${PV} == "4.7.1" ]] && myconf+=" -no-sse4.1 -no-sse4.2"
339
340 echo ./configure ${myconf} 340 echo ./configure ${myconf}
341 ./configure ${myconf} || die "./configure failed" 341 ./configure ${myconf} || die "./configure failed"
342 myconf="" 342 myconf=""
343
344 prepare_directories ${QT4_TARGET_DIRECTORIES}
343} 345}
344 346
345# @FUNCTION: qt4-build_src_compile 347# @FUNCTION: qt4-build_src_compile
346# @DESCRIPTION: Actual compile phase 348# @DESCRIPTION: Actual compile phase
347qt4-build_src_compile() { 349qt4-build_src_compile() {
491 -nomake examples -nomake demos" 493 -nomake examples -nomake demos"
492 494
493 echo "${myconf}" 495 echo "${myconf}"
494} 496}
495 497
496# @FUNCTION: build_directories 498# @FUNCTION: prepare_directories
497# @USAGE: < directories > 499# @USAGE: < directories >
498# @DESCRIPTION: 500# @DESCRIPTION:
499# Compiles the code in $QT4_TARGET_DIRECTORIES 501# Generates makefiles for the directories set in $QT4_TARGET_DIRECTORIES
500build_directories() { 502prepare_directories() {
501 for x in "$@"; do 503 for x in "$@"; do
502 pushd "${S}"/${x} >/dev/null 504 pushd "${S}"/${x} >/dev/null
505 einfo "running qmake in: $x"
503 # avoid running over the maximum argument number, bug #299810 506 # avoid running over the maximum argument number, bug #299810
504 { 507 {
505 echo "${S}"/mkspecs/common/*.conf 508 echo "${S}"/mkspecs/common/*.conf
506 find "${S}" -name '*.pr[io]' 509 find "${S}" -name '*.pr[io]'
507 } | xargs sed -i -e "s:\$\$\[QT_INSTALL_LIBS\]:${EPREFIX}/usr/$(get_libdir)/qt4:g" || die 510 } | xargs sed -i -e "s:\$\$\[QT_INSTALL_LIBS\]:${EPREFIX}/usr/$(get_libdir)/qt4:g" || die
508 "${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" || die "qmake failed" 511 "${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" || die "qmake failed"
512 popd >/dev/null
513 done
514}
515
516
517# @FUNCTION: build_directories
518# @USAGE: < directories >
519# @DESCRIPTION:
520# Compiles the code in $QT4_TARGET_DIRECTORIES
521build_directories() {
522 for x in "$@"; do
523 pushd "${S}"/${x} >/dev/null
509 emake CC="$(tc-getCC)" \ 524 emake CC="$(tc-getCC)" \
510 CXX="$(tc-getCXX)" \ 525 CXX="$(tc-getCXX)" \
511 LINK="$(tc-getCXX)" || die "emake failed" 526 LINK="$(tc-getCXX)" || die "emake failed"
512 popd >/dev/null 527 popd >/dev/null
513 done 528 done
584 599
585 # generate list of QT_CONFIG entries from the existing list 600 # generate list of QT_CONFIG entries from the existing list
586 # including qconfig_add and excluding qconfig_remove 601 # including qconfig_add and excluding qconfig_remove
587 for x in $(sed -n 's/^QT_CONFIG +=//p' \ 602 for x in $(sed -n 's/^QT_CONFIG +=//p' \
588 "${ROOT}${QTDATADIR}"/mkspecs/qconfig.pri) ${qconfig_add}; do 603 "${ROOT}${QTDATADIR}"/mkspecs/qconfig.pri) ${qconfig_add}; do
589 hasq ${x} ${qconfig_remove} || qconfig_new+=" ${x}" 604 has ${x} ${qconfig_remove} || qconfig_new+=" ${x}"
590 done 605 done
591 606
592 # replace the existing QT_CONFIG list with qconfig_new 607 # replace the existing QT_CONFIG list with qconfig_new
593 if ! sed -i -e "s/QT_CONFIG +=.*/QT_CONFIG += ${qconfig_new}/" \ 608 if ! sed -i -e "s/QT_CONFIG +=.*/QT_CONFIG += ${qconfig_new}/" \
594 "${ROOT}${QTDATADIR}"/mkspecs/qconfig.pri; then 609 "${ROOT}${QTDATADIR}"/mkspecs/qconfig.pri; then

Legend:
Removed from v.1.83  
changed lines
  Added in v.1.91

  ViewVC Help
Powered by ViewVC 1.1.20