/[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.109 Revision 1.110
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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.109 2011/12/26 00:11:07 pesa Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/qt4-build.eclass,v 1.110 2011/12/26 11:59:19 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.
148 echo tar xzf "${DISTDIR}"/${MY_P}.tar.gz ${targets} 148 echo tar xzf "${DISTDIR}"/${MY_P}.tar.gz ${targets}
149 tar xzf "${DISTDIR}"/${MY_P}.tar.gz ${targets} || die 149 tar xzf "${DISTDIR}"/${MY_P}.tar.gz ${targets} || die
150} 150}
151 151
152# @ECLASS-VARIABLE: PATCHES 152# @ECLASS-VARIABLE: PATCHES
153# @DEFAULT_UNSET
153# @DESCRIPTION: 154# @DESCRIPTION:
154# In case you have patches to apply, specify them in PATCHES variable. Make sure 155# PATCHES array variable containing all various patches to be applied.
155# to specify the full path. This variable is necessary for src_prepare phase. 156# This variable is expected to be defined in global scope of ebuild.
156# Example: 157# Make sure to specify the full path. This variable is utilised in
157# PATCHES="${FILESDIR}"/mypatch.patch 158# src_unpack/src_prepare phase, based on EAPI.
158# ${FILESDIR}"/mypatch2.patch"
159# 159#
160# @CODE
161# PATCHES=( "${FILESDIR}/mypatch.patch"
162# "${FILESDIR}/patches_folder/" )
163# @CODE
160 164
161# @FUNCTION: qt4-build_src_prepare 165# @FUNCTION: qt4-build_src_prepare
162# @DESCRIPTION: 166# @DESCRIPTION:
163# Prepare the sources before the configure phase. Strip CFLAGS if necessary, and fix 167# Prepare the sources before the configure phase. Strip CFLAGS if necessary, and fix
164# the build system in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified in /etc/make.conf. 168# the build system in order to respect CFLAGS/CXXFLAGS/LDFLAGS specified in /etc/make.conf.
415 # remove .la files since we are building only shared Qt libraries 419 # remove .la files since we are building only shared Qt libraries
416 find "${D}"${QTLIBDIR} -name "*.la" -print0 | xargs -0 rm 420 find "${D}"${QTLIBDIR} -name "*.la" -print0 | xargs -0 rm
417} 421}
418 422
419# @FUNCTION: setqtenv 423# @FUNCTION: setqtenv
424# @INTERNAL
420setqtenv() { 425setqtenv() {
421 # Set up installation directories 426 # Set up installation directories
422 QTPREFIXDIR=${EPREFIX}/usr 427 QTPREFIXDIR=${EPREFIX}/usr
423 QTBINDIR=${EPREFIX}/usr/bin 428 QTBINDIR=${EPREFIX}/usr/bin
424 QTLIBDIR=${EPREFIX}/usr/$(get_libdir)/qt4 429 QTLIBDIR=${EPREFIX}/usr/$(get_libdir)/qt4
439 444
440 unset QMAKESPEC 445 unset QMAKESPEC
441} 446}
442 447
443# @FUNCTION: standard_configure_options 448# @FUNCTION: standard_configure_options
449# @INTERNAL
444# @DESCRIPTION: 450# @DESCRIPTION:
445# Sets up some standard configure options, like libdir (if necessary), whether 451# Sets up some standard configure options, like libdir (if necessary), whether
446# debug info is wanted or not. 452# debug info is wanted or not.
447standard_configure_options() { 453standard_configure_options() {
448 local myconf="-prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR} 454 local myconf="-prefix ${QTPREFIXDIR} -bindir ${QTBINDIR} -libdir ${QTLIBDIR}
499 echo "${myconf}" 505 echo "${myconf}"
500} 506}
501 507
502# @FUNCTION: prepare_directories 508# @FUNCTION: prepare_directories
503# @USAGE: < directories > 509# @USAGE: < directories >
510# @INTERNAL
504# @DESCRIPTION: 511# @DESCRIPTION:
505# Generates Makefiles for the given list of directories. 512# Generates Makefiles for the given list of directories.
506prepare_directories() { 513prepare_directories() {
507 for x in "$@"; do 514 for x in "$@"; do
508 pushd "${S}"/${x} >/dev/null || die 515 pushd "${S}"/${x} >/dev/null || die
521} 528}
522 529
523 530
524# @FUNCTION: build_directories 531# @FUNCTION: build_directories
525# @USAGE: < directories > 532# @USAGE: < directories >
533# @INTERNAL
526# @DESCRIPTION: 534# @DESCRIPTION:
527# Compiles the code in the given list of directories. 535# Compiles the code in the given list of directories.
528build_directories() { 536build_directories() {
529 for x in "$@"; do 537 for x in "$@"; do
530 pushd "${S}"/${x} >/dev/null || die 538 pushd "${S}"/${x} >/dev/null || die
535 done 543 done
536} 544}
537 545
538# @FUNCTION: install_directories 546# @FUNCTION: install_directories
539# @USAGE: < directories > 547# @USAGE: < directories >
548# @INTERNAL
540# @DESCRIPTION: 549# @DESCRIPTION:
541# Runs emake install in the given directories, which are separated by spaces. 550# Runs emake install in the given directories, which are separated by spaces.
542install_directories() { 551install_directories() {
543 for x in "$@"; do 552 for x in "$@"; do
544 pushd "${S}"/${x} >/dev/null || die 553 pushd "${S}"/${x} >/dev/null || die
561# @DESCRIPTION: 570# @DESCRIPTION:
562# List variables that should be defined at the top of QtCore/qconfig.h 571# List variables that should be defined at the top of QtCore/qconfig.h
563: ${QCONFIG_DEFINE:=} 572: ${QCONFIG_DEFINE:=}
564 573
565# @FUNCTION: install_qconfigs 574# @FUNCTION: install_qconfigs
575# @INTERNAL
566# @DESCRIPTION: 576# @DESCRIPTION:
567# Install gentoo-specific mkspecs configurations. 577# Install gentoo-specific mkspecs configurations.
568install_qconfigs() { 578install_qconfigs() {
569 local x 579 local x
570 if [[ -n ${QCONFIG_ADD} || -n ${QCONFIG_REMOVE} ]]; then 580 if [[ -n ${QCONFIG_ADD} || -n ${QCONFIG_REMOVE} ]]; then
583 doins "${T}"/gentoo-${PN}-qconfig.h || die "installing ${PN}-qconfig.h failed" 593 doins "${T}"/gentoo-${PN}-qconfig.h || die "installing ${PN}-qconfig.h failed"
584 fi 594 fi
585} 595}
586 596
587# @FUNCTION: generate_qconfigs 597# @FUNCTION: generate_qconfigs
598# @INTERNAL
588# @DESCRIPTION: 599# @DESCRIPTION:
589# Generates gentoo-specific qconfig.{h,pri}. 600# Generates gentoo-specific qconfig.{h,pri}.
590generate_qconfigs() { 601generate_qconfigs() {
591 if [[ -n ${QCONFIG_ADD} || -n ${QCONFIG_REMOVE} || -n ${QCONFIG_DEFINE} || ${CATEGORY}/${PN} == x11-libs/qt-core ]]; then 602 if [[ -n ${QCONFIG_ADD} || -n ${QCONFIG_REMOVE} || -n ${QCONFIG_DEFINE} || ${CATEGORY}/${PN} == x11-libs/qt-core ]]; then
592 local x qconfig_add qconfig_remove qconfig_new 603 local x qconfig_add qconfig_remove qconfig_new
657qt4-build_pkg_postinst() { 668qt4-build_pkg_postinst() {
658 generate_qconfigs 669 generate_qconfigs
659} 670}
660 671
661# @FUNCTION: skip_qmake_build 672# @FUNCTION: skip_qmake_build
673# @INTERNAL
662# @DESCRIPTION: 674# @DESCRIPTION:
663# Patches configure to skip qmake compilation, as it's already installed by qt-core. 675# Patches configure to skip qmake compilation, as it's already installed by qt-core.
664skip_qmake_build() { 676skip_qmake_build() {
665 sed -i -e "s:if true:if false:g" "${S}"/configure || die 677 sed -i -e "s:if true:if false:g" "${S}"/configure || die
666} 678}
667 679
668# @FUNCTION: skip_project_generation 680# @FUNCTION: skip_project_generation
681# @INTERNAL
669# @DESCRIPTION: 682# @DESCRIPTION:
670# Exit the script early by throwing in an exit before all of the .pro files are scanned. 683# Exit the script early by throwing in an exit before all of the .pro files are scanned.
671skip_project_generation() { 684skip_project_generation() {
672 sed -i -e "s:echo \"Finding:exit 0\n\necho \"Finding:g" "${S}"/configure || die 685 sed -i -e "s:echo \"Finding:exit 0\n\necho \"Finding:g" "${S}"/configure || die
673} 686}
674 687
675# @FUNCTION: symlink_binaries_to_buildtree 688# @FUNCTION: symlink_binaries_to_buildtree
689# @INTERNAL
676# @DESCRIPTION: 690# @DESCRIPTION:
677# Symlinks generated binaries to buildtree, so they can be used during compilation time. 691# Symlinks generated binaries to buildtree, so they can be used during compilation time.
678symlink_binaries_to_buildtree() { 692symlink_binaries_to_buildtree() {
679 for bin in qmake moc uic rcc; do 693 for bin in qmake moc uic rcc; do
680 ln -s "${QTBINDIR}"/${bin} "${S}"/bin/ || die "symlinking ${bin} to ${S}/bin failed" 694 ln -s "${QTBINDIR}"/${bin} "${S}"/bin/ || die "symlinking ${bin} to ${S}/bin failed"
681 done 695 done
682} 696}
683 697
684# @FUNCTION: fix_library_files 698# @FUNCTION: fix_library_files
699# @INTERNAL
685# @DESCRIPTION: 700# @DESCRIPTION:
686# Fixes the paths in *.la, *.prl, *.pc, as they are wrong due to sandbox and 701# Fixes the paths in *.la, *.prl, *.pc, as they are wrong due to sandbox and
687# moves the *.pc files into the pkgconfig directory. 702# moves the *.pc files into the pkgconfig directory.
688fix_library_files() { 703fix_library_files() {
689 local libfile 704 local libfile
784 799
785 echo "${spec}" 800 echo "${spec}"
786} 801}
787 802
788# @FUNCTION: qt_assistant_cleanup 803# @FUNCTION: qt_assistant_cleanup
804# @INTERNAL
789# @DESCRIPTION: 805# @DESCRIPTION:
790# Tries to clean up tools.pro for qt-assistant ebuilds. 806# Tries to clean up tools.pro for qt-assistant ebuilds.
791# Meant to be called in src_prepare(). 807# Meant to be called in src_prepare().
792# Since Qt 4.7.4 this function is a no-op. 808# Since Qt 4.7.4 this function is a no-op.
793qt_assistant_cleanup() { 809qt_assistant_cleanup() {
813 ;; 829 ;;
814 esac 830 esac
815} 831}
816 832
817# @FUNCTION: qt_nolibx11 833# @FUNCTION: qt_nolibx11
834# @INTERNAL
818# @DESCRIPTION: 835# @DESCRIPTION:
819# Ignore X11 tests for packages that don't need X libraries installed. 836# Ignore X11 tests for packages that don't need X libraries installed.
820qt_nolibx11() { 837qt_nolibx11() {
821 sed -i "/unixtests\/compile.test.*config.tests\/x11\/xlib/,/fi$/d" "${S}"/configure || 838 sed -i "/unixtests\/compile.test.*config.tests\/x11\/xlib/,/fi$/d" "${S}"/configure ||
822 die "x11 check sed failed" 839 die "x11 check sed failed"

Legend:
Removed from v.1.109  
changed lines
  Added in v.1.110

  ViewVC Help
Powered by ViewVC 1.1.20