/[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.138 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.138 2012/11/01 08:35:43 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|5) : ;; 13 3|4|5) : ;;
14 *) die "qt4-build.eclass: unsupported EAPI=${EAPI:-0}" ;; 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
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
374 -bindir ${QTBINDIR} 370 -bindir ${QTBINDIR}
375 -libdir ${QTLIBDIR} 371 -libdir ${QTLIBDIR}
376 -docdir ${QTDOCDIR} 372 -docdir ${QTDOCDIR}
377 -headerdir ${QTHEADERDIR} 373 -headerdir ${QTHEADERDIR}
378 -plugindir ${QTPLUGINDIR} 374 -plugindir ${QTPLUGINDIR}
379 $(version_is_at_least 4.7 && echo -importdir ${QTIMPORTDIR}) 375 -importdir ${QTIMPORTDIR}
380 -datadir ${QTDATADIR} 376 -datadir ${QTDATADIR}
381 -translationdir ${QTTRANSDIR} 377 -translationdir ${QTTRANSDIR}
382 -sysconfdir ${QTSYSCONFDIR} 378 -sysconfdir ${QTSYSCONFDIR}
383 -examplesdir ${QTEXAMPLESDIR} 379 -examplesdir ${QTEXAMPLESDIR}
384 -demosdir ${QTDEMOSDIR} 380 -demosdir ${QTDEMOSDIR}
548 544
549# @FUNCTION: qt4-build_src_install 545# @FUNCTION: qt4-build_src_install
550# @DESCRIPTION: 546# @DESCRIPTION:
551# Perform the actual installation including some library fixes. 547# Perform the actual installation including some library fixes.
552qt4-build_src_install() { 548qt4-build_src_install() {
553 [[ ${EAPI} == 2 ]] && use !prefix && ED=${D}
554 setqtenv 549 setqtenv
555 550
556 install_directories ${QT4_TARGET_DIRECTORIES} 551 install_directories ${QT4_TARGET_DIRECTORIES}
557 install_qconfigs 552 install_qconfigs
558 fix_library_files 553 fix_library_files
559 fix_includes 554 fix_includes
560 555
561 # remove .la files since we are building only shared Qt libraries 556 # remove .la files since we are building only shared libraries
562 find "${D}"${QTLIBDIR} -type f -name '*.la' -print0 | xargs -0 rm -f 557 prune_libtool_files
563} 558}
564 559
565# @FUNCTION: setqtenv 560# @FUNCTION: setqtenv
566# @INTERNAL 561# @INTERNAL
567setqtenv() { 562setqtenv() {
568 # Set up installation directories 563 # Set up installation directories
569 QTPREFIXDIR=${EPREFIX}/usr 564 QTPREFIXDIR=${EPREFIX}/usr
570 QTBINDIR=${EPREFIX}/usr/bin 565 QTBINDIR=${QTPREFIXDIR}/bin
571 QTLIBDIR=${EPREFIX}/usr/$(get_libdir)/qt4 566 QTLIBDIR=${QTPREFIXDIR}/$(get_libdir)/qt4
572 QTPCDIR=${EPREFIX}/usr/$(get_libdir)/pkgconfig 567 QTPCDIR=${QTPREFIXDIR}/$(get_libdir)/pkgconfig
573 QTDOCDIR=${EPREFIX}/usr/share/doc/qt-${PV} 568 QTDOCDIR=${QTPREFIXDIR}/share/doc/qt-${PV}
574 QTHEADERDIR=${EPREFIX}/usr/include/qt4 569 QTHEADERDIR=${QTPREFIXDIR}/include/qt4
575 QTPLUGINDIR=${QTLIBDIR}/plugins 570 QTPLUGINDIR=${QTLIBDIR}/plugins
576 QTIMPORTDIR=${QTLIBDIR}/imports 571 QTIMPORTDIR=${QTLIBDIR}/imports
577 QTDATADIR=${EPREFIX}/usr/share/qt4 572 QTDATADIR=${QTPREFIXDIR}/share/qt4
578 QTTRANSDIR=${QTDATADIR}/translations 573 QTTRANSDIR=${QTDATADIR}/translations
579 QTSYSCONFDIR=${EPREFIX}/etc/qt4 574 QTSYSCONFDIR=${EPREFIX}/etc/qt4
580 QTEXAMPLESDIR=${QTDATADIR}/examples 575 QTEXAMPLESDIR=${QTDATADIR}/examples
581 QTDEMOSDIR=${QTDATADIR}/demos 576 QTDEMOSDIR=${QTDATADIR}/demos
582 QMAKE_LIBDIR_QT=${QTLIBDIR} 577 QMAKE_LIBDIR_QT=${QTLIBDIR}
583 QT_INSTALL_PREFIX=${EPREFIX}/usr/$(get_libdir)/qt4
584 578
585 PLATFORM=$(qt_mkspecs_dir) 579 PLATFORM=$(qt_mkspecs_dir)
586 unset QMAKESPEC 580 unset QMAKESPEC
587 581
588 export XDG_CONFIG_HOME="${T}" 582 export XDG_CONFIG_HOME="${T}"
592# @USAGE: < directories > 586# @USAGE: < directories >
593# @INTERNAL 587# @INTERNAL
594# @DESCRIPTION: 588# @DESCRIPTION:
595# Generates Makefiles for the given list of directories. 589# Generates Makefiles for the given list of directories.
596prepare_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
597 for x in "$@"; do 600 for x in "$@"; do
598 pushd "${S}"/${x} >/dev/null || die 601 pushd "${S}"/${x} >/dev/null || die
599 einfo "Running qmake in: ${x}" 602 einfo "Running qmake in: ${x}"
600 # avoid running over the maximum argument number, bug #299810 603 "${S}"/bin/qmake \
601 { 604 "LIBS+=-L${QTLIBDIR}" \
602 echo "${S}"/mkspecs/common/*.conf 605 "CONFIG+=nostrip" \
603 find "${S}" -name '*.pr[io]' 606 || die "qmake failed"
604 } | xargs sed -i \
605 -e "s:\$\$\[QT_INSTALL_LIBS\]:${QTLIBDIR}:g" \
606 -e "s:\$\$\[QT_INSTALL_PLUGINS\]:${QTPLUGINDIR}:g" \
607 || die
608 "${S}"/bin/qmake "LIBS+=-L${QTLIBDIR}" "CONFIG+=nostrip" || die "qmake failed"
609 popd >/dev/null || die 607 popd >/dev/null || die
610 done 608 done
611} 609}
612
613 610
614# @FUNCTION: build_directories 611# @FUNCTION: build_directories
615# @USAGE: < directories > 612# @USAGE: < directories >
616# @INTERNAL 613# @INTERNAL
617# @DESCRIPTION: 614# @DESCRIPTION:
618# Compiles the code in the given list of directories. 615# Compiles the code in the given list of directories.
619build_directories() { 616build_directories() {
620 for x in "$@"; do 617 for x in "$@"; do
621 pushd "${S}"/${x} >/dev/null || die 618 pushd "${S}"/${x} >/dev/null || die
619 emake \
620 AR="$(tc-getAR) cqs" \
622 emake CC="$(tc-getCC)" \ 621 CC="$(tc-getCC)" \
623 CXX="$(tc-getCXX)" \ 622 CXX="$(tc-getCXX)" \
624 LINK="$(tc-getCXX)" || die "emake failed" 623 LINK="$(tc-getCXX)" \
624 RANLIB=":" \
625 STRIP=":" \
626 || die "emake failed"
625 popd >/dev/null || die 627 popd >/dev/null || die
626 done 628 done
627} 629}
628 630
629# @FUNCTION: install_directories 631# @FUNCTION: install_directories

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

  ViewVC Help
Powered by ViewVC 1.1.20