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

Diff of /eclass/kde4-meta.eclass

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

Revision 1.23 Revision 1.31
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-meta.eclass,v 1.23 2009/08/03 21:59:53 wired Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.31 2009/12/14 19:44:15 abcd Exp $
4# 4#
5# @ECLASS: kde4-meta.eclass 5# @ECLASS: kde4-meta.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# kde@gentoo.org 7# kde@gentoo.org
8# @BLURB: Eclass for writing "split" KDE packages. 8# @BLURB: Eclass for writing "split" KDE packages.
14 14
15inherit kde4-base versionator 15inherit kde4-base versionator
16 16
17EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm 17EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm
18 18
19if [[ -z ${KMNAME} ]]; then
20 die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild" 19[[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
21fi
22
23case ${KDEBASE} in
24 kde-base)
25 HOMEPAGE="http://www.kde.org/"
26 LICENSE="GPL-2"
27 ;;
28 koffice)
29 HOMEPAGE="http://www.koffice.org/"
30 LICENSE="GPL-2"
31 ;;
32esac
33 20
34# Add khelpcenter dependency when installing handbooks 21# Add khelpcenter dependency when installing handbooks
35if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then 22if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then
36 RDEPEND+=" handbook? ( >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=] )" 23 RDEPEND+=" handbook? ( $(add_kdebase_dep khelpcenter) )"
37fi 24fi
38 25
39# Add dependencies that all packages in a certain module share. 26# Add dependencies that all packages in a certain module share.
40case ${KMNAME} in 27case ${KMNAME} in
41 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics) 28 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
42 COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4" 29 COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4"
43 ;; 30 ;;
44 kdenetwork)
45 COMMONDEPEND+=" >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]"
46 ;;
47 kdepim|kdepim-runtime) 31 kdepim|kdepim-runtime)
48 COMMONDEPEND+=" 32 COMMONDEPEND+=" $(add_kdebase_dep kdepimlibs)"
49 dev-libs/boost
50 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
51 "
52 case ${PN} in 33 case ${PN} in
53 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker) 34 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
54 IUSE+=" +kontact" 35 IUSE+=" +kontact"
55 RDEPEND+=" kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" 36 if ! slot_is_at_least 4.4 ${SLOT}; then
37 RDEPEND+=" kontact? ( $(add_kdebase_dep kontactinterfaces) )"
38 fi
56 ;; 39 ;;
57 esac 40 esac
58 ;; 41 ;;
59 kdegames) 42 kdegames)
60 if [[ ${PN} != libkdegames ]]; then 43 if [[ ${PN} != libkdegames ]]; then
61 COMMONDEPEND+=" >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=] " 44 COMMONDEPEND+=" $(add_kdebase_dep libkdegames)"
62 fi 45 fi
63 ;; 46 ;;
64 koffice) 47 koffice)
65 [[ ${PN} != koffice-data ]] && IUSE+=" debug" 48 [[ ${PN} != koffice-data ]] && IUSE+=" debug"
66 RDEPEND+=" 49 RDEPEND+="
226 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 209 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
227 fi 210 fi
228 else 211 else
229 local abort tarball tarfile f extractlist moduleprefix postfix 212 local abort tarball tarfile f extractlist moduleprefix postfix
230 case ${PV} in 213 case ${PV} in
231 4.3.85 | 4.3.90 | 4.3.95 | 4.3.96 | 4.3.98 | 4.2.85 | 4.2.90 | 4.2.95 | 4.2.96 | 4.2.98) 214 4.3.8[05] | 4.3.9[0568])
232 # block for normally packed upstream unstable snapshots 215 # block for normally packed upstream unstable snapshots
233 KMTARPARAMS+=" --bzip2" # bz2 216 KMTARPARAMS+=" --bzip2" # bz2
234 postfix="bz2" 217 postfix="bz2"
235 ;; 218 ;;
236 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6* | 4.3.9* | 4.3.8* | 4.3.7* | 4.3.6*) 219 4.3.[6-9]*)
237 KMTARPARAMS+=" --lzma" # lzma 220 # Not passing --xz, as it doesn't work with stable tar
221 KMTARPARAMS+=" --use-compress-program=xz" # xz
238 postfix="lzma" 222 postfix="xz"
239 ;; 223 ;;
240 *) 224 *)
241 KMTARPARAMS+=" --bzip2" # bz2 225 KMTARPARAMS+=" --bzip2" # bz2
242 postfix="bz2" 226 postfix="bz2"
243 ;; 227 ;;
367 KMEXTRACTONLY+=" 351 KMEXTRACTONLY+="
368 kleopatra/ConfigureChecks.cmake" 352 kleopatra/ConfigureChecks.cmake"
369 if has kontact ${IUSE//+} && use kontact; then 353 if has kontact ${IUSE//+} && use kontact; then
370 KMEXTRA+=" 354 KMEXTRA+="
371 kontact/plugins/${PLUGINNAME:-${PN}}/" 355 kontact/plugins/${PLUGINNAME:-${PN}}/"
356 if ! slot_is_at_least 4.4 ${SLOT}; then
372 KMEXTRACTONLY+=" 357 KMEXTRACTONLY+="
373 kontactinterfaces/" 358 kontactinterfaces/"
359 fi
374 fi 360 fi
375 ;; 361 ;;
376 kdeutils) 362 kdeutils)
377 case ${SLOT} in 363 case ${SLOT} in
378 4.3|4.4|live) 364 4.3|4.4|live)
401 case ${KMNAME} in 387 case ${KMNAME} in
402 kdepim) 388 kdepim)
403 # No need for unpack since 4.2.86 389 # No need for unpack since 4.2.86
404 # Remove when 4.2 is wiped out from the tree 390 # Remove when 4.2 is wiped out from the tree
405 case ${PV} in 391 case ${PV} in
406 4.1*|4.2.0|4.2.1|4.2.2|4.2.3|4.2.4|4.2.85) 392 4.2.[0-4])
407 KMCOMPILEONLY+=" 393 KMCOMPILEONLY+="
408 cmake/modules/" 394 cmake/modules/"
409 ;; 395 ;;
410 *) ;;
411 esac 396 esac
412 ;; 397 ;;
413 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics) 398 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
414 case ${PN} in 399 case ${PN} in
415 libkdegames|libkdeedu|libkworkspace) 400 libkdegames|libkdeedu|libkworkspace)
514 pushd "${S}" > /dev/null 499 pushd "${S}" > /dev/null
515 500
516 comment_all_add_subdirectory ./ 501 comment_all_add_subdirectory ./
517 502
518 # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt 503 # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt
519 if [[ -f "${S}"/CMakeLists.txt ]]; then 504 if [[ -f CMakeLists.txt ]]; then
520 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \ 505 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
521 -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \ 506 -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
522 -i "${S}"/CMakeLists.txt || die "${LINENO}: cmake sed died" 507 -i CMakeLists.txt || die "${LINENO}: cmake sed died"
523 fi 508 fi
524 509
525 if [[ -z ${KMNOMODULE} ]]; then 510 if [[ -z ${KMNOMODULE} ]]; then
526 # Restore "add_subdirectory" in $KMMODULE subdirectories 511 # Restore "add_subdirectory" in $KMMODULE subdirectories
527 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 512 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | \
513 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
528 die "${LINENO}: died in KMMODULE section" 514 die "${LINENO}: died in KMMODULE section"
529 _change_cmakelists_parent_dirs ${KMMODULE} 515 _change_cmakelists_parent_dirs ${KMMODULE}
530 fi 516 fi
531 517
532 local i 518 local i
533 519
534 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY 520 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
535 for i in ${KMEXTRACTONLY}; do 521 for i in ${KMEXTRACTONLY}; do
536 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then 522 if [[ -d ${i} && -f ${i}/../CMakeLists.txt ]]; then
537 sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \ 523 sed -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" \
524 -i ${i}/../CMakeLists.txt || \
538 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}" 525 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
539 fi 526 fi
540 done 527 done
541 528
542 # KMCOMPILEONLY 529 # KMCOMPILEONLY
564 # KMEXTRA_NONFATAL section 551 # KMEXTRA_NONFATAL section
565 for i in ${KMEXTRA_NONFATAL}; do 552 for i in ${KMEXTRA_NONFATAL}; do
566 if [[ -d "${S}"/${i} ]]; then 553 if [[ -d "${S}"/${i} ]]; then
567 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 554 find "${S}"/${i} -name CMakeLists.txt -print0 | \
568 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 555 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
569 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" 556 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
570 _change_cmakelists_parent_dirs ${i} 557 _change_cmakelists_parent_dirs ${i}
571 fi 558 fi
572 done 559 done
573 560
574 case ${KMNAME} in 561 case ${KMNAME} in
575 kdebase-workspace) 562 kdebase-workspace)
576 # COLLISION PROTECT section 563 # COLLISION PROTECT section
577 # Install the startkde script just once, as a part of kde-base/kdebase-startkde, 564 # Install the startkde script just once, as a part of kde-base/kdebase-startkde,
578 # not as a part of every package. 565 # not as a part of every package.
579 if [[ ${PN} != kdebase-startkde && -f "${S}"/CMakeLists.txt ]]; then 566 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
580 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0. 567 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
581 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ 568 sed -e '/startkde/s/^/#DONOTINSTALL /' \
582 die "${LINENO}: sed died in the kdebase-startkde collision prevention section" 569 -i CMakeLists.txt || die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
583 fi 570 fi
584 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82 571 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
585 if [[ ${PN} != libkworkspace ]]; then 572 if [[ ${PN} != libkworkspace ]]; then
586 sed -i \
587 -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ 573 sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
588 CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section" 574 -i CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section"
589 fi 575 fi
590 ;; 576 ;;
591 kdebase-runtime) 577 kdebase-runtime)
592 # COLLISION PROTECT section 578 # COLLISION PROTECT section
593 # Only install the kde4 script as part of kde-base/kdebase-data 579 # Only install the kde4 script as part of kde-base/kdebase-data
594 if [[ ${PN} != kdebase-data && -f "${S}"/CMakeLists.txt ]]; then 580 if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then
595 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ 581 sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
596 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 582 -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
597 fi 583 fi
584 ;;
585 kdenetwork)
586 # Disable hardcoded kdepimlibs check
587 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
588 -i CMakeLists.txt || die "failed to disable hardcoded checks"
598 ;; 589 ;;
599 kdepim) 590 kdepim)
600 case ${PN} in 591 case ${PN} in
601 kaddressbook|kalarm|kmailcvt|kontact|korganizer|korn) 592 kaddressbook|kalarm|kmailcvt|kontact|korganizer|korn)
602 sed -i -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \ 593 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
603 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed" 594 -e '/add_custom_target(kmail_xml /,/)/p' \
595 -i kmail/CMakeLists.txt || die "uncommenting xml failed"
604 _change_cmakelists_parent_dirs kmail 596 _change_cmakelists_parent_dirs kmail
605 ;; 597 ;;
606 esac 598 esac
607 ;; 599 ;;
608 kdewebdev) 600 kdewebdev)
614 -i CMakeLists.txt || die "failed to disable hardcoded checks" 606 -i CMakeLists.txt || die "failed to disable hardcoded checks"
615 ;; 607 ;;
616 koffice) 608 koffice)
617 # prevent collisions 609 # prevent collisions
618 if [[ ${PN} != koffice-data ]]; then 610 if [[ ${PN} != koffice-data ]]; then
619 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ 611 sed -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
620 "${S}"/cmake/modules/CMakeLists.txt || \
621 die "${LINENO}: sed died in collision prevention section" 612 -i cmake/modules/CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
622 case ${PV} in
623 2.0.*)
624 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \
625 "${S}"/CMakeLists.txt || \
626 die "${LINENO}: sed died in collision prevention section"
627 ;;
628 *)
629 sed -i -e '/install(.\+config-openexr\.h.\+)/d' \ 613 sed -e '/install(.\+config-openexr\.h.\+)/d' \
630 "${S}"//CMakeLists.txt || \
631 die "${LINENO}: sed died in collision prevention section" 614 -i CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
632 ;;
633 esac
634 fi 615 fi
616 # koffice 2.0
617 case ${PV} in
618 2.0.[1-9])
619 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \
620 "${S}"/CMakeLists.txt || \
621 die "${LINENO}: sed died in collision prevention section"
622 ;;
623 *) ;;
624 esac
635 esac 625 esac
636 626
637 popd > /dev/null 627 popd > /dev/null
638} 628}
639 629
642# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split 632# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
643# ebuilds. 633# ebuilds.
644kde4-meta_src_configure() { 634kde4-meta_src_configure() {
645 debug-print-function ${FUNCNAME} "$@" 635 debug-print-function ${FUNCNAME} "$@"
646 636
637 # backwards-compatibility: make mycmakeargs an array, if it isn't already
638 if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then
639 mycmakeargs=(${mycmakeargs})
640 fi
641
647 # Set some cmake default values here (usually workarounds for automagic deps) 642 # Set some cmake default values here (usually workarounds for automagic deps)
648 case ${KMNAME} in 643 case ${KMNAME} in
649 kdewebdev) 644 kdewebdev)
650 mycmakeargs=" 645 mycmakeargs=(
651 -DWITH_KdepimLibs=OFF 646 -DWITH_KdepimLibs=OFF
652 -DWITH_LibXml2=OFF 647 -DWITH_LibXml2=OFF
653 -DWITH_LibXslt=OFF 648 -DWITH_LibXslt=OFF
654 -DWITH_Boost=OFF 649 -DWITH_Boost=OFF
655 -DWITH_LibTidy=OFF 650 -DWITH_LibTidy=OFF
656 ${mycmakeargs}" 651 "${mycmakeargs[@]}"
652 )
657 ;; 653 ;;
658 esac 654 esac
659 655
660 kde4-base_src_configure 656 kde4-base_src_configure
661} 657}
670 kde4-base_src_compile "$@" 666 kde4-base_src_compile "$@"
671} 667}
672 668
673# @FUNCTION: kde4-meta_src_test 669# @FUNCTION: kde4-meta_src_test
674# @DESCRIPTION: 670# @DESCRIPTION:
675# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split 671# Currently just calls its equivalent in kde4-base.eclass(5) if
676# ebuilds. 672# I_KNOW_WHAT_I_AM_DOING is set. Use this in split ebuilds.
677kde4-meta_src_test() { 673kde4-meta_src_test() {
678 debug-print-function $FUNCNAME "$@" 674 debug-print-function $FUNCNAME "$@"
679 675
676 if [[ $I_KNOW_WHAT_I_AM_DOING ]]; then
680 kde4-base_src_test 677 kde4-base_src_test
678 else
679 einfo "Tests disabled"
680 fi
681} 681}
682 682
683# @FUNCTION: kde4-meta_src_install 683# @FUNCTION: kde4-meta_src_install
684# @DESCRIPTION: 684# @DESCRIPTION:
685# Function for installing KDE4 split applications. 685# Function for installing KDE4 split applications.
704 kde4-base_src_make_doc 704 kde4-base_src_make_doc
705} 705}
706 706
707# @FUNCTION: kde4-meta_pkg_postinst 707# @FUNCTION: kde4-meta_pkg_postinst
708# @DESCRIPTION: 708# @DESCRIPTION:
709# Display information about application handbook and invoke kbuildsycoca4. 709# Invoke kbuildsycoca4.
710kde4-meta_pkg_postinst() { 710kde4-meta_pkg_postinst() {
711 debug-print-function ${FUNCNAME} "$@" 711 debug-print-function ${FUNCNAME} "$@"
712
713 if has handbook ${IUSE//+} && ! use handbook; then
714 echo
715 einfo "Application handbook for ${PN} has not been installed."
716 einfo "To install handbook, reemerge =${CATEGORY}/${PF} with 'handbook' USE flag."
717 echo
718 fi
719 712
720 kde4-base_pkg_postinst 713 kde4-base_pkg_postinst
721} 714}
722 715
723# @FUNCTION: kde4-meta_pkg_postrm 716# @FUNCTION: kde4-meta_pkg_postrm

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.31

  ViewVC Help
Powered by ViewVC 1.1.20