/[gentoo-x86]/eclass/kde4-base.eclass
Gentoo

Diff of /eclass/kde4-base.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.56 Revision 1.57
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/kde4-base.eclass,v 1.56 2009/12/10 17:35:52 abcd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.57 2009/12/14 19:44:15 abcd Exp $
4 4
5# @ECLASS: kde4-base.eclass 5# @ECLASS: kde4-base.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# kde@gentoo.org 7# kde@gentoo.org
8# @BLURB: This eclass provides functions for kde 4.X ebuilds 8# @BLURB: This eclass provides functions for kde 4.X ebuilds
438 # Don't set KDEHOME during compilation, it will cause access violations 438 # Don't set KDEHOME during compilation, it will cause access violations
439 unset KDEHOME 439 unset KDEHOME
440 440
441 if [[ ${KDEBASE} = kde-base ]]; then 441 if [[ ${KDEBASE} = kde-base ]]; then
442 if use kdeprefix; then 442 if use kdeprefix; then
443 KDEDIR=${EPREFIX}/usr/kde/${_kdedir} 443 KDEDIR=/usr/kde/${_kdedir}
444 else 444 else
445 KDEDIR=${EPREFIX}/usr 445 KDEDIR=/usr
446 fi 446 fi
447 : ${PREFIX:=${KDEDIR}} 447 : ${PREFIX:=${KDEDIR}}
448 else 448 else
449 # Determine KDEDIR by loooking for the closest match with KDE_MINIMAL 449 # Determine KDEDIR by loooking for the closest match with KDE_MINIMAL
450 KDEDIR= 450 KDEDIR=
451 local kde_minimal_met 451 local kde_minimal_met
452 for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do 452 for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
453 [[ -z ${kde_minimal_met} ]] && [[ ${slot} = ${KDE_MINIMAL} ]] && kde_minimal_met=1 453 [[ -z ${kde_minimal_met} ]] && [[ ${slot} = ${KDE_MINIMAL} ]] && kde_minimal_met=1
454 if [[ -n ${kde_minimal_met} ]] && has_version "kde-base/kdelibs:${slot}"; then 454 if [[ -n ${kde_minimal_met} ]] && has_version "kde-base/kdelibs:${slot}"; then
455 if has_version "kde-base/kdelibs:${slot}[kdeprefix]"; then 455 if has_version "kde-base/kdelibs:${slot}[kdeprefix]"; then
456 KDEDIR=${EPREFIX}/usr/kde/${slot} 456 KDEDIR=/usr/kde/${slot}
457 else 457 else
458 KDEDIR=${EPREFIX}/usr 458 KDEDIR=/usr
459 fi 459 fi
460 break; 460 break;
461 fi 461 fi
462 done 462 done
463 unset slot 463 unset slot
464 464
465 # Bail out if kdelibs required but not found 465 # Bail out if kdelibs required but not found
466 if [[ ${KDE_REQUIRED} = always ]] || { [[ ${KDE_REQUIRED} = optional ]] && use kde; }; then 466 if [[ ${KDE_REQUIRED} = always ]] || { [[ ${KDE_REQUIRED} = optional ]] && use kde; }; then
467 [[ -z ${KDEDIR} ]] && die "Failed to determine KDEDIR!" 467 [[ -z ${KDEDIR} ]] && die "Failed to determine KDEDIR!"
468 else 468 else
469 [[ -z ${KDEDIR} ]] && KDEDIR=${EPREFIX}/usr 469 [[ -z ${KDEDIR} ]] && KDEDIR=/usr
470 fi 470 fi
471 471
472 : ${PREFIX:=${EPREFIX}/usr} 472 : ${PREFIX:=/usr}
473 fi 473 fi
474 EKDEDIR=${EPREFIX}${KDEDIR}
475
474 # Point pkg-config path to KDE *.pc files 476 # Point pkg-config path to KDE *.pc files
475 export PKG_CONFIG_PATH="${KDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" 477 export PKG_CONFIG_PATH="${EKDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
476 # Point to correct QT plugins path 478 # Point to correct QT plugins path
477 QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/" 479 QT_PLUGIN_PATH="${EKDEDIR}/$(get_libdir)/kde4/plugins/"
478 480
479 # Fix XDG collision with sandbox 481 # Fix XDG collision with sandbox
480 export XDG_CONFIG_HOME="${T}" 482 export XDG_CONFIG_HOME="${T}"
481 # Not needed anymore 483 # Not needed anymore
482 unset _kdedir 484 unset _kdedir
571 573
572 # Set distribution name 574 # Set distribution name
573 [[ ${PN} = kdelibs ]] && cmakeargs+=(-DKDE_DISTRIBUTION_TEXT=Gentoo) 575 [[ ${PN} = kdelibs ]] && cmakeargs+=(-DKDE_DISTRIBUTION_TEXT=Gentoo)
574 576
575 # Here we set the install prefix 577 # Here we set the install prefix
576 cmakeargs+=(-DCMAKE_INSTALL_PREFIX="${PREFIX}") 578 cmakeargs+=(-DCMAKE_INSTALL_PREFIX="${EPREFIX}${PREFIX}")
577 579
578 # Use colors 580 # Use colors
579 QTEST_COLORED=1 581 QTEST_COLORED=1
580 582
581 # Shadow existing /usr installations 583 # Shadow existing /usr installations
582 unset KDEDIRS 584 unset KDEDIRS
583 585
584 # Handle kdeprefix-ed KDE 586 # Handle kdeprefix-ed KDE
585 if [[ ${KDEDIR} != ${EPREFIX}/usr ]]; then 587 if [[ ${KDEDIR} != /usr ]]; then
586 # Override some environment variables - only when kdeprefix is different, 588 # Override some environment variables - only when kdeprefix is different,
587 # to not break ccache/distcc 589 # to not break ccache/distcc
588 PATH="${KDEDIR}/bin:${PATH}" 590 PATH="${EKDEDIR}/bin:${PATH}"
589 LDPATH="${KDEDIR}/$(get_libdir):${LDPATH}" 591 LDPATH="${EKDEDIR}/$(get_libdir)${LDPATH+:}${LDPATH}"
590 592
591 # Append full RPATH 593 # Append full RPATH
592 cmakeargs+=(-DCMAKE_SKIP_RPATH=OFF) 594 cmakeargs+=(-DCMAKE_SKIP_RPATH=OFF)
593 595
594 # Set cmake prefixes to allow buildsystem to locate valid KDE installation 596 # Set cmake prefixes to allow buildsystem to locate valid KDE installation
595 # when more are present 597 # when more are present
596 cmakeargs+=(-DCMAKE_SYSTEM_PREFIX_PATH="${KDEDIR}") 598 cmakeargs+=(-DCMAKE_SYSTEM_PREFIX_PATH="${EKDEDIR}")
597 fi 599 fi
598 600
599 # Handle kdeprefix in application itself 601 # Handle kdeprefix in application itself
600 if ! has kdeprefix ${IUSE//+} || ! use kdeprefix; then 602 if ! has kdeprefix ${IUSE//+} || ! use kdeprefix; then
601 # If prefix is /usr, sysconf needs to be /etc, not /usr/etc 603 # If prefix is /usr, sysconf needs to be /etc, not /usr/etc
602 cmakeargs+=(-DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc) 604 cmakeargs+=(-DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc)
603 fi 605 fi
604 606
605 if [[ $(declare -p mycmakeargs) != "declare -a mycmakeargs="* ]]; then 607 if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then
606 mycmakeargs=(${mycmakeargs}) 608 mycmakeargs=(${mycmakeargs})
607 fi 609 fi
608 610
609 mycmakeargs=("${cmakeargs[@]}" "${mycmakeargs[@]}") 611 mycmakeargs=("${cmakeargs[@]}" "${mycmakeargs[@]}")
610 612
637# @FUNCTION: kde4-base_src_install 639# @FUNCTION: kde4-base_src_install
638# @DESCRIPTION: 640# @DESCRIPTION:
639# Function for installing KDE4 applications. 641# Function for installing KDE4 applications.
640kde4-base_src_install() { 642kde4-base_src_install() {
641 debug-print-function ${FUNCNAME} "$@" 643 debug-print-function ${FUNCNAME} "$@"
644
645 # Prefix support, for usage in ebuilds
646 if [[ ${EAPI} == 2 ]] && ! use prefix; then
647 ED=${D}
648 fi
642 649
643 if [[ -n ${KMSAVELIBS} ]] ; then 650 if [[ -n ${KMSAVELIBS} ]] ; then
644 install_library_dependencies 651 install_library_dependencies
645 fi 652 fi
646 653
667 newdoc "$doc_complete" "${doc%/*}.${doc##*/}" 674 newdoc "$doc_complete" "${doc%/*}.${doc##*/}"
668 fi 675 fi
669 done 676 done
670 fi 677 fi
671 678
672 [[ -z ${ED} ]] && ED=${D}${EPREFIX} 679 [[ -z ${ED} ]] && ED=${D}
673 680
674 if [[ -n ${KDEBASE} ]] && [[ -d ${ED}usr/share/doc/${PF} ]]; then 681 if [[ -n ${KDEBASE} ]] && [[ -d ${ED}usr/share/doc/${PF} ]]; then
675 # work around bug #97196 682 # work around bug #97196
676 dodir /usr/share/doc/KDE4 && \ 683 dodir /usr/share/doc/KDE4 && \
677 cp -r "${ED}usr/share/doc/${PF}" "${ED}usr/share/doc/KDE4/" || \ 684 cp -r "${ED}usr/share/doc/${PF}" "${ED}usr/share/doc/KDE4/" || \

Legend:
Removed from v.1.56  
changed lines
  Added in v.1.57

  ViewVC Help
Powered by ViewVC 1.1.20