/[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.55 Revision 1.56
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.55 2009/12/02 17:07:05 abcd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.56 2009/12/10 17:35:52 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
57# @ECLASS-VARIABLE: OPENGL_REQUIRED 57# @ECLASS-VARIABLE: OPENGL_REQUIRED
58# @DESCRIPTION: 58# @DESCRIPTION:
59# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'. 59# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'.
60# This variable must be set before inheriting any eclasses. Defaults to 'never'. 60# This variable must be set before inheriting any eclasses. Defaults to 'never'.
61OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}" 61OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}"
62
63# @ECLASS-VARIABLE: MULTIMEDIA_REQUIRED
64# @DESCRIPTION:
65# Is qt-multimedia required? Possible values are 'always', 'optional' and 'never'.
66# This variable must be set before inheriting any eclasses. Defaults to 'never'.
67MULTIMEDIA_REQUIRED="${MULTIMEDIA_REQUIRED:-never}"
62 68
63# @ECLASS-VARIABLE: WEBKIT_REQUIRED 69# @ECLASS-VARIABLE: WEBKIT_REQUIRED
64# @DESCRIPTION: 70# @DESCRIPTION:
65# Is qt-webkit requred? Possible values are 'always', 'optional' and 'never'. 71# Is qt-webkit requred? Possible values are 'always', 'optional' and 'never'.
66# This variable must be set before inheriting any eclasses. Defaults to 'never'. 72# This variable must be set before inheriting any eclasses. Defaults to 'never'.
164 COMMONDEPEND+=" opengl? ( ${qtopengldepend} )" 170 COMMONDEPEND+=" opengl? ( ${qtopengldepend} )"
165 ;; 171 ;;
166 *) ;; 172 *) ;;
167esac 173esac
168unset qtopengldepend 174unset qtopengldepend
175
176# MultiMedia dependencies
177qtmultimediadepend="
178 >=x11-libs/qt-multimedia-${QT_MINIMAL}:4
179"
180case ${MULTIMEDIA_REQUIRED} in
181 always)
182 COMMONDEPEND+=" ${qtmultimediadepend}"
183 ;;
184 optional)
185 IUSE+=" multimedia"
186 COMMONDEPEND+=" multimedia? ( ${qtmultimediadepend} )"
187 ;;
188 *) ;;
189esac
190unset qtmultimediadepend
169 191
170# WebKit dependencies 192# WebKit dependencies
171case ${KDE_REQUIRED} in 193case ${KDE_REQUIRED} in
172 always) 194 always)
173 qtwebkitusedeps="[kde]" 195 qtwebkitusedeps="[kde]"
400# optional applications link 422# optional applications link
401kde4-base_pkg_setup() { 423kde4-base_pkg_setup() {
402 debug-print-function ${FUNCNAME} "$@" 424 debug-print-function ${FUNCNAME} "$@"
403 425
404 # Prefix compat: 426 # Prefix compat:
405 use prefix || EROOT=${ROOT} 427 if [[ ${EAPI} == 2 ]] && ! use prefix; then
428 EPREFIX=
429 EROOT=${ROOT}
430 fi
431
406 # Append missing trailing slash character 432 # Append missing trailing slash character
407 [[ ${EROOT} = */ ]] || EROOT+="/" 433 [[ ${EROOT} = */ ]] || EROOT+="/"
408 434
409 # QA ebuilds 435 # QA ebuilds
410 [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})." 436 [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})."
412 # Don't set KDEHOME during compilation, it will cause access violations 438 # Don't set KDEHOME during compilation, it will cause access violations
413 unset KDEHOME 439 unset KDEHOME
414 440
415 if [[ ${KDEBASE} = kde-base ]]; then 441 if [[ ${KDEBASE} = kde-base ]]; then
416 if use kdeprefix; then 442 if use kdeprefix; then
417 KDEDIR="${EROOT}usr/kde/${_kdedir}" 443 KDEDIR=${EPREFIX}/usr/kde/${_kdedir}
418 else 444 else
419 KDEDIR="${EROOT}usr" 445 KDEDIR=${EPREFIX}/usr
420 fi 446 fi
421 PREFIX="${PREFIX:-${KDEDIR}}" 447 : ${PREFIX:=${KDEDIR}}
422 else 448 else
423 # Determine KDEDIR by loooking for the closest match with KDE_MINIMAL 449 # Determine KDEDIR by loooking for the closest match with KDE_MINIMAL
424 KDEDIR= 450 KDEDIR=
425 local kde_minimal_met 451 local kde_minimal_met
426 for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do 452 for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
427 [[ -z ${kde_minimal_met} ]] && [[ ${slot} = ${KDE_MINIMAL} ]] && kde_minimal_met=1 453 [[ -z ${kde_minimal_met} ]] && [[ ${slot} = ${KDE_MINIMAL} ]] && kde_minimal_met=1
428 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
429 if has_version "kde-base/kdelibs:${slot}[kdeprefix]"; then 455 if has_version "kde-base/kdelibs:${slot}[kdeprefix]"; then
430 KDEDIR="${EROOT}usr/kde/${slot}" 456 KDEDIR=${EPREFIX}/usr/kde/${slot}
431 else 457 else
432 KDEDIR="${EROOT}usr" 458 KDEDIR=${EPREFIX}/usr
433 fi 459 fi
434 break; 460 break;
435 fi 461 fi
436 done 462 done
437 unset slot 463 unset slot
438 464
439 # Bail out if kdelibs required but not found 465 # Bail out if kdelibs required but not found
440 if [[ ${KDE_REQUIRED} = always ]] || { [[ ${KDE_REQUIRED} = optional ]] && use kde; }; then 466 if [[ ${KDE_REQUIRED} = always ]] || { [[ ${KDE_REQUIRED} = optional ]] && use kde; }; then
441 [[ -z ${KDEDIR} ]] && die "Failed to determine KDEDIR!" 467 [[ -z ${KDEDIR} ]] && die "Failed to determine KDEDIR!"
442 else 468 else
443 [[ -z ${KDEDIR} ]] && KDEDIR="${EROOT}usr" 469 [[ -z ${KDEDIR} ]] && KDEDIR=${EPREFIX}/usr
444 fi 470 fi
445 471
446 PREFIX="${PREFIX:-${EROOT}usr}" 472 : ${PREFIX:=${EPREFIX}/usr}
447 fi 473 fi
448 # Point pkg-config path to KDE *.pc files 474 # Point pkg-config path to KDE *.pc files
449 export PKG_CONFIG_PATH="${KDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" 475 export PKG_CONFIG_PATH="${KDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
450 # Point to correct QT plugins path 476 # Point to correct QT plugins path
451 QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/" 477 QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/"
463 debug-print-function ${FUNCNAME} "$@" 489 debug-print-function ${FUNCNAME} "$@"
464 490
465 if [[ ${BUILD_TYPE} = live ]]; then 491 if [[ ${BUILD_TYPE} = live ]]; then
466 migrate_store_dir 492 migrate_store_dir
467 subversion_src_unpack 493 subversion_src_unpack
468 elif [[ ${EAPI} == 2 ]]; then 494 elif [[ ${EAPI} == [23] ]]; then
469 local file 495 local file
470 for file in ${A}; do 496 for file in ${A}; do
471 # This setup is because EAPI <= 2 cannot unpack *.tar.xz files 497 # This setup is because EAPI <= 3 cannot unpack *.tar.xz files
472 # directly, so we do it ourselves (using the exact same code as portage) 498 # directly, so we do it ourselves (using the exact same code as portage)
473 case ${file} in 499 case ${file} in
474 *.tar.xz) 500 *.tar.xz)
475 echo ">>> Unpacking ${file} to ${PWD}" 501 echo ">>> Unpacking ${file} to ${PWD}"
476 xz -dc "${DISTDIR}"/${file} | tar xof - 502 xz -dc "${DISTDIR}"/${file} | tar xof -
480 unpack ${file} 506 unpack ${file}
481 ;; 507 ;;
482 esac 508 esac
483 done 509 done
484 else 510 else
485 # For EAPI >= 3, we can just use unpack() directly 511 # For EAPI >= 4, we can just use unpack() directly
486 unpack ${A} 512 unpack ${A}
487 fi 513 fi
488} 514}
489 515
490# @FUNCTION: kde4-base_src_prepare 516# @FUNCTION: kde4-base_src_prepare
527# Function for configuring the build of KDE4 applications. 553# Function for configuring the build of KDE4 applications.
528kde4-base_src_configure() { 554kde4-base_src_configure() {
529 debug-print-function ${FUNCNAME} "$@" 555 debug-print-function ${FUNCNAME} "$@"
530 556
531 # Build tests in src_test only, where we override this value 557 # Build tests in src_test only, where we override this value
532 local cmakeargs="-DKDE4_BUILD_TESTS=OFF" 558 local cmakeargs=(-DKDE4_BUILD_TESTS=OFF)
533 559
534 if has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then 560 if has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then
535 cmakeargs+=" -DKDE4_ENABLE_FINAL=ON" 561 cmakeargs+=(-DKDE4_ENABLE_FINAL=ON)
536 fi 562 fi
537 563
538 if has debug ${IUSE//+} && use debug; then 564 if has debug ${IUSE//+} && use debug; then
539 # Set "real" debug mode 565 # Set "real" debug mode
540 CMAKE_BUILD_TYPE="Debugfull" 566 CMAKE_BUILD_TYPE="Debugfull"
542 # Handle common release builds 568 # Handle common release builds
543 append-cppflags -DQT_NO_DEBUG 569 append-cppflags -DQT_NO_DEBUG
544 fi 570 fi
545 571
546 # Set distribution name 572 # Set distribution name
547 [[ ${PN} = kdelibs ]] && cmakeargs+=" -DKDE_DISTRIBUTION_TEXT=Gentoo" 573 [[ ${PN} = kdelibs ]] && cmakeargs+=(-DKDE_DISTRIBUTION_TEXT=Gentoo)
548 574
549 # Here we set the install prefix 575 # Here we set the install prefix
550 cmakeargs+=" -DCMAKE_INSTALL_PREFIX=${PREFIX}" 576 cmakeargs+=(-DCMAKE_INSTALL_PREFIX="${PREFIX}")
551 577
552 # Use colors 578 # Use colors
553 QTEST_COLORED=1 579 QTEST_COLORED=1
554 580
555 # Shadow existing /usr installations 581 # Shadow existing /usr installations
556 unset KDEDIRS 582 unset KDEDIRS
557 583
558 # Handle kdeprefix-ed KDE 584 # Handle kdeprefix-ed KDE
559 if [[ ${KDEDIR} != "${EROOT}usr" ]]; then 585 if [[ ${KDEDIR} != ${EPREFIX}/usr ]]; then
560 # Override some environment variables - only when kdeprefix is different, 586 # Override some environment variables - only when kdeprefix is different,
561 # to not break ccache/distcc 587 # to not break ccache/distcc
562 PATH="${KDEDIR}/bin:${PATH}" 588 PATH="${KDEDIR}/bin:${PATH}"
563 LDPATH="${KDEDIR}/$(get_libdir):${LDPATH}" 589 LDPATH="${KDEDIR}/$(get_libdir):${LDPATH}"
564 590
565 # Append full RPATH 591 # Append full RPATH
566 cmakeargs+=" -DCMAKE_SKIP_RPATH=OFF" 592 cmakeargs+=(-DCMAKE_SKIP_RPATH=OFF)
567 593
568 # Set cmake prefixes to allow buildsystem to locate valid KDE installation 594 # Set cmake prefixes to allow buildsystem to locate valid KDE installation
569 # when more are present 595 # when more are present
570 cmakeargs+=" -DCMAKE_SYSTEM_PREFIX_PATH=${KDEDIR}" 596 cmakeargs+=(-DCMAKE_SYSTEM_PREFIX_PATH="${KDEDIR}")
571 fi 597 fi
572 598
573 # Handle kdeprefix in application itself 599 # Handle kdeprefix in application itself
574 if ! has kdeprefix ${IUSE//+} || ! use kdeprefix; then 600 if ! has kdeprefix ${IUSE//+} || ! use kdeprefix; then
575 # If prefix is /usr, sysconf needs to be /etc, not /usr/etc 601 # If prefix is /usr, sysconf needs to be /etc, not /usr/etc
576 cmakeargs+=" -DSYSCONF_INSTALL_DIR=${EROOT}etc" 602 cmakeargs+=(-DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc)
577 fi 603 fi
578 604
605 if [[ $(declare -p mycmakeargs) != "declare -a mycmakeargs="* ]]; then
606 mycmakeargs=(${mycmakeargs})
607 fi
608
579 mycmakeargs="${cmakeargs} ${mycmakeargs}" 609 mycmakeargs=("${cmakeargs[@]}" "${mycmakeargs[@]}")
580 610
581 cmake-utils_src_configure 611 cmake-utils_src_configure
582} 612}
583 613
584# @FUNCTION: kde4-base_src_compile 614# @FUNCTION: kde4-base_src_compile
595# Function for testing KDE4 applications. 625# Function for testing KDE4 applications.
596kde4-base_src_test() { 626kde4-base_src_test() {
597 debug-print-function ${FUNCNAME} "$@" 627 debug-print-function ${FUNCNAME} "$@"
598 628
599 # Override this value, set in kde4-base_src_configure() 629 # Override this value, set in kde4-base_src_configure()
600 mycmakeargs+=" -DKDE4_BUILD_TESTS=ON" 630 mycmakeargs+=(-DKDE4_BUILD_TESTS=ON)
601 cmake-utils_src_configure 631 cmake-utils_src_configure
602 kde4-base_src_compile 632 kde4-base_src_compile
603 633
604 cmake-utils_src_test 634 cmake-utils_src_test
605} 635}
637 newdoc "$doc_complete" "${doc%/*}.${doc##*/}" 667 newdoc "$doc_complete" "${doc%/*}.${doc##*/}"
638 fi 668 fi
639 done 669 done
640 fi 670 fi
641 671
672 [[ -z ${ED} ]] && ED=${D}${EPREFIX}
673
642 if [[ -n ${KDEBASE} ]] && [[ -d "${D}${EROOT}usr/share/doc/${PF}" ]]; then 674 if [[ -n ${KDEBASE} ]] && [[ -d ${ED}usr/share/doc/${PF} ]]; then
643 # work around bug #97196 675 # work around bug #97196
644 dodir /usr/share/doc/KDE4 && \ 676 dodir /usr/share/doc/KDE4 && \
645 cp -r "${D}${EROOT}usr/share/doc/${PF}" "${D}${EROOT}usr/share/doc/KDE4/" || \ 677 cp -r "${ED}usr/share/doc/${PF}" "${ED}usr/share/doc/KDE4/" || \
646 die "Failed to move docs to KDE4/." 678 die "Failed to move docs to KDE4/."
647 rm -rf "${D}${EROOT}usr/share/doc/${PF}" 679 rm -rf "${ED}usr/share/doc/${PF}"
648 fi 680 fi
649} 681}
650 682
651# @FUNCTION: kde4-base_pkg_postinst 683# @FUNCTION: kde4-base_pkg_postinst
652# @DESCRIPTION: 684# @DESCRIPTION:

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

  ViewVC Help
Powered by ViewVC 1.1.20