/[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.134 Revision 1.139
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 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.134 2012/07/10 21:43:19 pesa Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.139 2012/11/12 09:28:53 pesa Exp $
4 4
5# @ECLASS: qt4-build.eclass 5# @ECLASS: qt4-build.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Qt herd <qt@gentoo.org> 7# Qt herd <qt@gentoo.org>
8# @BLURB: Eclass for Qt4 split ebuilds. 8# @BLURB: Eclass for Qt4 split ebuilds.
9# @DESCRIPTION: 9# @DESCRIPTION:
10# This eclass contains various functions that are used when building Qt4. 10# This eclass contains various functions that are used when building Qt4.
11 11
12case ${EAPI} in 12case ${EAPI} in
13 2|3|4) : ;; 13 3|4|5) : ;;
14 *) die "qt4-build.eclass requires EAPI 2, 3 or 4." ;; 14 *) die "qt4-build.eclass: unsupported EAPI=${EAPI:-0}" ;;
15esac 15esac
16 16
17inherit eutils flag-o-matic multilib toolchain-funcs versionator 17inherit eutils flag-o-matic multilib toolchain-funcs versionator
18 18
19if [[ ${PV} == *9999* ]]; then 19if [[ ${PV} == *9999* ]]; then
21 inherit git-2 21 inherit git-2
22else 22else
23 QT4_BUILD_TYPE="release" 23 QT4_BUILD_TYPE="release"
24fi 24fi
25 25
26HOMEPAGE="http://qt-project.org/ http://qt.nokia.com/" 26HOMEPAGE="http://qt-project.org/ http://qt.digia.com/"
27LICENSE="|| ( LGPL-2.1 GPL-3 )" 27LICENSE="|| ( LGPL-2.1 GPL-3 )"
28 28
29MY_PV=${PV/_/-} 29MY_PV=${PV/_/-}
30MY_P=qt-everywhere-opensource-src-${MY_PV} 30MY_P=qt-everywhere-opensource-src-${MY_PV}
31 31
99 99
100# @FUNCTION: qt4-build_pkg_setup 100# @FUNCTION: qt4-build_pkg_setup
101# @DESCRIPTION: 101# @DESCRIPTION:
102# Sets up PATH and LD_LIBRARY_PATH. 102# Sets up PATH and LD_LIBRARY_PATH.
103qt4-build_pkg_setup() { 103qt4-build_pkg_setup() {
104 [[ ${EAPI} == 2 ]] && use !prefix && EPREFIX=
105
106 # Protect users by not allowing downgrades between releases. 104 # Protect users by not allowing downgrades between releases.
107 # Downgrading revisions within the same release should be allowed. 105 # Downgrading revisions within the same release should be allowed.
108 if has_version ">${CATEGORY}/${P}-r9999:4"; then 106 if has_version ">${CATEGORY}/${P}-r9999:4"; then
109 if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then 107 if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
110 eerror " *** Sanity check to keep you from breaking your system ***" 108 eerror " *** Sanity check to keep you from breaking your system ***"
188# @DEFAULT_UNSET 186# @DEFAULT_UNSET
189# @DESCRIPTION: 187# @DESCRIPTION:
190# PATCHES array variable containing all various patches to be applied. 188# PATCHES array variable containing all various patches to be applied.
191# This variable is expected to be defined in global scope of ebuild. 189# This variable is expected to be defined in global scope of ebuild.
192# Make sure to specify the full path. This variable is utilised in 190# Make sure to specify the full path. This variable is utilised in
193# src_unpack/src_prepare phase, based on EAPI. 191# src_prepare() phase.
194# 192#
195# @CODE 193# @CODE
196# PATCHES=( "${FILESDIR}/mypatch.patch" 194# PATCHES=( "${FILESDIR}/mypatch.patch"
197# "${FILESDIR}/patches_folder/" ) 195# "${FILESDIR}/patches_folder/" )
198# @CODE 196# @CODE
206 204
207 if [[ ${QT4_BUILD_TYPE} == live ]]; then 205 if [[ ${QT4_BUILD_TYPE} == live ]]; then
208 QTDIR="." ./bin/syncqt || die "syncqt failed" 206 QTDIR="." ./bin/syncqt || die "syncqt failed"
209 fi 207 fi
210 208
211 if version_is_at_least 4.7; then
212 # avoid X11 dependency in non-gui packages 209 # avoid X11 dependency in non-gui packages
213 local nolibx11_pkgs="qt-core qt-dbus qt-script qt-sql qt-test qt-xmlpatterns" 210 local nolibx11_pkgs="qt-core qt-dbus qt-script qt-sql qt-test qt-xmlpatterns"
214 has ${PN} ${nolibx11_pkgs} && qt_nolibx11 211 has ${PN} ${nolibx11_pkgs} && qt_nolibx11
215 fi
216 212
217 if use aqua; then 213 if use aqua; then
218 # provide a proper macx-g++-64 214 # provide a proper macx-g++-64
219 use x64-macos && ln -s macx-g++ mkspecs/$(qt_mkspecs_dir) 215 use x64-macos && ln -s macx-g++ mkspecs/$(qt_mkspecs_dir)
220 216
264 sed -e "/^SYSTEM_VARIABLES=/i \ 260 sed -e "/^SYSTEM_VARIABLES=/i \
265 CC='$(tc-getCC)'\n\ 261 CC='$(tc-getCC)'\n\
266 CXX='$(tc-getCXX)'\n\ 262 CXX='$(tc-getCXX)'\n\
267 CFLAGS='${CFLAGS}'\n\ 263 CFLAGS='${CFLAGS}'\n\
268 CXXFLAGS='${CXXFLAGS}'\n\ 264 CXXFLAGS='${CXXFLAGS}'\n\
269 LDFLAGS='${LDFLAGS}'\n" \ 265 LDFLAGS='${LDFLAGS}'\n\
266 QMakeVar set QMAKE_CFLAGS_RELEASE\n\
267 QMakeVar set QMAKE_CFLAGS_DEBUG\n\
268 QMakeVar set QMAKE_CXXFLAGS_RELEASE\n\
269 QMakeVar set QMAKE_CXXFLAGS_DEBUG\n\
270 QMakeVar set QMAKE_LFLAGS_RELEASE\n\
271 QMakeVar set QMAKE_LFLAGS_DEBUG\n"\
270 -i configure \ 272 -i configure \
271 || die "sed SYSTEM_VARIABLES failed" 273 || die "sed SYSTEM_VARIABLES failed"
272 274
273 # Respect CC, CXX, LINK and *FLAGS in config.tests 275 # Respect CC, CXX, LINK and *FLAGS in config.tests
274 find config.tests/unix -name '*.test' -type f -print0 | xargs -0 \ 276 find config.tests/unix -name '*.test' -type f -print0 | xargs -0 \
368 -bindir ${QTBINDIR} 370 -bindir ${QTBINDIR}
369 -libdir ${QTLIBDIR} 371 -libdir ${QTLIBDIR}
370 -docdir ${QTDOCDIR} 372 -docdir ${QTDOCDIR}
371 -headerdir ${QTHEADERDIR} 373 -headerdir ${QTHEADERDIR}
372 -plugindir ${QTPLUGINDIR} 374 -plugindir ${QTPLUGINDIR}
373 $(version_is_at_least 4.7 && echo -importdir ${QTIMPORTDIR}) 375 -importdir ${QTIMPORTDIR}
374 -datadir ${QTDATADIR} 376 -datadir ${QTDATADIR}
375 -translationdir ${QTTRANSDIR} 377 -translationdir ${QTTRANSDIR}
376 -sysconfdir ${QTSYSCONFDIR} 378 -sysconfdir ${QTSYSCONFDIR}
377 -examplesdir ${QTEXAMPLESDIR} 379 -examplesdir ${QTEXAMPLESDIR}
378 -demosdir ${QTDEMOSDIR} 380 -demosdir ${QTDEMOSDIR}
542 544
543# @FUNCTION: qt4-build_src_install 545# @FUNCTION: qt4-build_src_install
544# @DESCRIPTION: 546# @DESCRIPTION:
545# Perform the actual installation including some library fixes. 547# Perform the actual installation including some library fixes.
546qt4-build_src_install() { 548qt4-build_src_install() {
547 [[ ${EAPI} == 2 ]] && use !prefix && ED=${D}
548 setqtenv 549 setqtenv
549 550
550 install_directories ${QT4_TARGET_DIRECTORIES} 551 install_directories ${QT4_TARGET_DIRECTORIES}
551 install_qconfigs 552 install_qconfigs
552 fix_library_files 553 fix_library_files
553 fix_includes 554 fix_includes
554 555
555 # remove .la files since we are building only shared Qt libraries 556 # remove .la files since we are building only shared libraries
556 find "${D}"${QTLIBDIR} -type f -name '*.la' -print0 | xargs -0 rm -f 557 prune_libtool_files
557} 558}
558 559
559# @FUNCTION: setqtenv 560# @FUNCTION: setqtenv
560# @INTERNAL 561# @INTERNAL
561setqtenv() { 562setqtenv() {
562 # Set up installation directories 563 # Set up installation directories
563 QTPREFIXDIR=${EPREFIX}/usr 564 QTPREFIXDIR=${EPREFIX}/usr
564 QTBINDIR=${EPREFIX}/usr/bin 565 QTBINDIR=${QTPREFIXDIR}/bin
565 QTLIBDIR=${EPREFIX}/usr/$(get_libdir)/qt4 566 QTLIBDIR=${QTPREFIXDIR}/$(get_libdir)/qt4
566 QTPCDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig 567 QTPCDIR=${QTPREFIXDIR}/$(get_libdir)/pkgconfig
567 QTDOCDIR=${EPREFIX}/usr/share/doc/qt-${PV} 568 QTDOCDIR=${QTPREFIXDIR}/share/doc/qt-${PV}
568 QTHEADERDIR=${EPREFIX}/usr/include/qt4 569 QTHEADERDIR=${QTPREFIXDIR}/include/qt4
569 QTPLUGINDIR=${QTLIBDIR}/plugins 570 QTPLUGINDIR=${QTLIBDIR}/plugins
570 QTIMPORTDIR=${QTLIBDIR}/imports 571 QTIMPORTDIR=${QTLIBDIR}/imports
571 QTDATADIR=${EPREFIX}/usr/share/qt4 572 QTDATADIR=${QTPREFIXDIR}/share/qt4
572 QTTRANSDIR=${QTDATADIR}/translations 573 QTTRANSDIR=${QTDATADIR}/translations
573 QTSYSCONFDIR=${EPREFIX}/etc/qt4 574 QTSYSCONFDIR=${EPREFIX}/etc/qt4
574 QTEXAMPLESDIR=${QTDATADIR}/examples 575 QTEXAMPLESDIR=${QTDATADIR}/examples
575 QTDEMOSDIR=${QTDATADIR}/demos 576 QTDEMOSDIR=${QTDATADIR}/demos
576 QMAKE_LIBDIR_QT=${QTLIBDIR} 577 QMAKE_LIBDIR_QT=${QTLIBDIR}
577 QT_INSTALL_PREFIX=${EPREFIX}/usr/$(get_libdir)/qt4
578 578
579 PLATFORM=$(qt_mkspecs_dir) 579 PLATFORM=$(qt_mkspecs_dir)
580 unset QMAKESPEC 580 unset QMAKESPEC
581 581
582 export XDG_CONFIG_HOME="${T}" 582 export XDG_CONFIG_HOME="${T}"
586# @USAGE: < directories > 586# @USAGE: < directories >
587# @INTERNAL 587# @INTERNAL
588# @DESCRIPTION: 588# @DESCRIPTION:
589# Generates Makefiles for the given list of directories. 589# Generates Makefiles for the given list of directories.
590prepare_directories() { 590prepare_directories() {
591 # avoid running over the maximum argument number, bug #299810
592 {
593 echo "${S}"/mkspecs/common/*.conf
594 find "${S}" -name '*.pr[io]'
595 } | xargs sed -i \
596 -e "s:\$\$\[QT_INSTALL_LIBS\]:${QTLIBDIR}:g" \
597 -e "s:\$\$\[QT_INSTALL_PLUGINS\]:${QTPLUGINDIR}:g" \
598 || die
599
591 for x in "$@"; do 600 for x in "$@"; do
592 pushd "${S}"/${x} >/dev/null || die 601 pushd "${S}"/${x} >/dev/null || die
593 einfo "Running qmake in: ${x}" 602 einfo "Running qmake in: ${x}"
594 # avoid running over the maximum argument number, bug #299810 603 "${S}"/bin/qmake \
595 { 604 "LIBS+=-L${QTLIBDIR}" \
596 echo "${S}"/mkspecs/common/*.conf 605 "CONFIG+=nostrip" \
597 find "${S}" -name '*.pr[io]' 606 || die "qmake failed"
598 } | xargs sed -i \
599 -e "s:\$\$\[QT_INSTALL_LIBS\]:${QTLIBDIR}:g" \
600 -e "s:\$\$\[QT_INSTALL_PLUGINS\]:${QTPLUGINDIR}:g" \
601 || die
602 "${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" || die "qmake failed"
603 popd >/dev/null || die 607 popd >/dev/null || die
604 done 608 done
605} 609}
606
607 610
608# @FUNCTION: build_directories 611# @FUNCTION: build_directories
609# @USAGE: < directories > 612# @USAGE: < directories >
610# @INTERNAL 613# @INTERNAL
611# @DESCRIPTION: 614# @DESCRIPTION:
612# Compiles the code in the given list of directories. 615# Compiles the code in the given list of directories.
613build_directories() { 616build_directories() {
614 for x in "$@"; do 617 for x in "$@"; do
615 pushd "${S}"/${x} >/dev/null || die 618 pushd "${S}"/${x} >/dev/null || die
619 emake \
620 AR="$(tc-getAR) cqs" \
616 emake CC="$(tc-getCC)" \ 621 CC="$(tc-getCC)" \
617 CXX="$(tc-getCXX)" \ 622 CXX="$(tc-getCXX)" \
618 LINK="$(tc-getCXX)" || die "emake failed" 623 LINK="$(tc-getCXX)" \
624 RANLIB=":" \
625 STRIP=":" \
626 || die "emake failed"
619 popd >/dev/null || die 627 popd >/dev/null || die
620 done 628 done
621} 629}
622 630
623# @FUNCTION: install_directories 631# @FUNCTION: install_directories

Legend:
Removed from v.1.134  
changed lines
  Added in v.1.139

  ViewVC Help
Powered by ViewVC 1.1.20