/[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.26 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.26 2009/10/06 18:02:12 alexxy 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 20
23# Add khelpcenter dependency when installing handbooks 21# Add khelpcenter dependency when installing handbooks
24if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then 22if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then
25 RDEPEND+=" handbook? ( >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=] )" 23 RDEPEND+=" handbook? ( $(add_kdebase_dep khelpcenter) )"
26fi 24fi
27 25
28# Add dependencies that all packages in a certain module share. 26# Add dependencies that all packages in a certain module share.
29case ${KMNAME} in 27case ${KMNAME} in
30 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics) 28 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
31 COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4" 29 COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4"
32 ;; 30 ;;
33 kdenetwork)
34 COMMONDEPEND+=" >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]"
35 ;;
36 kdepim|kdepim-runtime) 31 kdepim|kdepim-runtime)
37 COMMONDEPEND+=" 32 COMMONDEPEND+=" $(add_kdebase_dep kdepimlibs)"
38 dev-libs/boost
39 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
40 "
41 case ${PN} in 33 case ${PN} in
42 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker) 34 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
43 IUSE+=" +kontact" 35 IUSE+=" +kontact"
44 if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then 36 if ! slot_is_at_least 4.4 ${SLOT}; then
45 RDEPEND+=" kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" 37 RDEPEND+=" kontact? ( $(add_kdebase_dep kontactinterfaces) )"
46 fi 38 fi
47 ;; 39 ;;
48 esac 40 esac
49 ;; 41 ;;
50 kdegames) 42 kdegames)
51 if [[ ${PN} != libkdegames ]]; then 43 if [[ ${PN} != libkdegames ]]; then
52 COMMONDEPEND+=" >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=] " 44 COMMONDEPEND+=" $(add_kdebase_dep libkdegames)"
53 fi 45 fi
54 ;; 46 ;;
55 koffice) 47 koffice)
56 [[ ${PN} != koffice-data ]] && IUSE+=" debug" 48 [[ ${PN} != koffice-data ]] && IUSE+=" debug"
57 RDEPEND+=" 49 RDEPEND+="
217 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 209 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
218 fi 210 fi
219 else 211 else
220 local abort tarball tarfile f extractlist moduleprefix postfix 212 local abort tarball tarfile f extractlist moduleprefix postfix
221 case ${PV} in 213 case ${PV} in
222 4.3.85 | 4.3.9[0568]) 214 4.3.8[05] | 4.3.9[0568])
223 # block for normally packed upstream unstable snapshots 215 # block for normally packed upstream unstable snapshots
224 KMTARPARAMS+=" --bzip2" # bz2 216 KMTARPARAMS+=" --bzip2" # bz2
225 postfix="bz2" 217 postfix="bz2"
226 ;; 218 ;;
227 4.3.[6-9]*) 219 4.3.[6-9]*)
228 KMTARPARAMS+=" --lzma" # lzma 220 # Not passing --xz, as it doesn't work with stable tar
221 KMTARPARAMS+=" --use-compress-program=xz" # xz
229 postfix="lzma" 222 postfix="xz"
230 ;; 223 ;;
231 *) 224 *)
232 KMTARPARAMS+=" --bzip2" # bz2 225 KMTARPARAMS+=" --bzip2" # bz2
233 postfix="bz2" 226 postfix="bz2"
234 ;; 227 ;;
358 KMEXTRACTONLY+=" 351 KMEXTRACTONLY+="
359 kleopatra/ConfigureChecks.cmake" 352 kleopatra/ConfigureChecks.cmake"
360 if has kontact ${IUSE//+} && use kontact; then 353 if has kontact ${IUSE//+} && use kontact; then
361 KMEXTRA+=" 354 KMEXTRA+="
362 kontact/plugins/${PLUGINNAME:-${PN}}/" 355 kontact/plugins/${PLUGINNAME:-${PN}}/"
363 if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then 356 if ! slot_is_at_least 4.4 ${SLOT}; then
364 KMEXTRACTONLY+=" 357 KMEXTRACTONLY+="
365 kontactinterfaces/" 358 kontactinterfaces/"
366 fi 359 fi
367 fi 360 fi
368 ;; 361 ;;
506 pushd "${S}" > /dev/null 499 pushd "${S}" > /dev/null
507 500
508 comment_all_add_subdirectory ./ 501 comment_all_add_subdirectory ./
509 502
510 # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt 503 # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt
511 if [[ -f "${S}"/CMakeLists.txt ]]; then 504 if [[ -f CMakeLists.txt ]]; then
512 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \ 505 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
513 -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \ 506 -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
514 -i "${S}"/CMakeLists.txt || die "${LINENO}: cmake sed died" 507 -i CMakeLists.txt || die "${LINENO}: cmake sed died"
515 fi 508 fi
516 509
517 if [[ -z ${KMNOMODULE} ]]; then 510 if [[ -z ${KMNOMODULE} ]]; then
518 # Restore "add_subdirectory" in $KMMODULE subdirectories 511 # Restore "add_subdirectory" in $KMMODULE subdirectories
519 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' || \
520 die "${LINENO}: died in KMMODULE section" 514 die "${LINENO}: died in KMMODULE section"
521 _change_cmakelists_parent_dirs ${KMMODULE} 515 _change_cmakelists_parent_dirs ${KMMODULE}
522 fi 516 fi
523 517
524 local i 518 local i
525 519
526 # 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
527 for i in ${KMEXTRACTONLY}; do 521 for i in ${KMEXTRACTONLY}; do
528 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then 522 if [[ -d ${i} && -f ${i}/../CMakeLists.txt ]]; then
529 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 || \
530 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}"
531 fi 526 fi
532 done 527 done
533 528
534 # KMCOMPILEONLY 529 # KMCOMPILEONLY
556 # KMEXTRA_NONFATAL section 551 # KMEXTRA_NONFATAL section
557 for i in ${KMEXTRA_NONFATAL}; do 552 for i in ${KMEXTRA_NONFATAL}; do
558 if [[ -d "${S}"/${i} ]]; then 553 if [[ -d "${S}"/${i} ]]; then
559 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 554 find "${S}"/${i} -name CMakeLists.txt -print0 | \
560 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 555 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
561 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}"
562 _change_cmakelists_parent_dirs ${i} 557 _change_cmakelists_parent_dirs ${i}
563 fi 558 fi
564 done 559 done
565 560
566 case ${KMNAME} in 561 case ${KMNAME} in
567 kdebase-workspace) 562 kdebase-workspace)
568 # COLLISION PROTECT section 563 # COLLISION PROTECT section
569 # 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,
570 # not as a part of every package. 565 # not as a part of every package.
571 if [[ ${PN} != kdebase-startkde && -f "${S}"/CMakeLists.txt ]]; then 566 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
572 # 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.
573 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ 568 sed -e '/startkde/s/^/#DONOTINSTALL /' \
574 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"
575 fi 570 fi
576 # 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
577 if [[ ${PN} != libkworkspace ]]; then 572 if [[ ${PN} != libkworkspace ]]; then
578 sed -i \
579 -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' \
580 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"
581 fi 575 fi
582 ;; 576 ;;
583 kdebase-runtime) 577 kdebase-runtime)
584 # COLLISION PROTECT section 578 # COLLISION PROTECT section
585 # 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
586 if [[ ${PN} != kdebase-data && -f "${S}"/CMakeLists.txt ]]; then 580 if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then
587 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ 581 sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
588 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 582 -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
589 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"
590 ;; 589 ;;
591 kdepim) 590 kdepim)
592 case ${PN} in 591 case ${PN} in
593 kaddressbook|kalarm|kmailcvt|kontact|korganizer|korn) 592 kaddressbook|kalarm|kmailcvt|kontact|korganizer|korn)
594 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' \
595 -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"
596 _change_cmakelists_parent_dirs kmail 596 _change_cmakelists_parent_dirs kmail
597 ;; 597 ;;
598 esac 598 esac
599 ;; 599 ;;
600 kdewebdev) 600 kdewebdev)
606 -i CMakeLists.txt || die "failed to disable hardcoded checks" 606 -i CMakeLists.txt || die "failed to disable hardcoded checks"
607 ;; 607 ;;
608 koffice) 608 koffice)
609 # prevent collisions 609 # prevent collisions
610 if [[ ${PN} != koffice-data ]]; then 610 if [[ ${PN} != koffice-data ]]; then
611 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ 611 sed -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
612 "${S}"/cmake/modules/CMakeLists.txt || \
613 die "${LINENO}: sed died in collision prevention section" 612 -i cmake/modules/CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
614 sed -i -e '/install(.\+config-openexr\.h.\+)/d' \ 613 sed -e '/install(.\+config-openexr\.h.\+)/d' \
615 "${S}"//CMakeLists.txt || \
616 die "${LINENO}: sed died in collision prevention section" 614 -i CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
617 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
618 esac 625 esac
619 626
620 popd > /dev/null 627 popd > /dev/null
621} 628}
622 629
625# 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
626# ebuilds. 633# ebuilds.
627kde4-meta_src_configure() { 634kde4-meta_src_configure() {
628 debug-print-function ${FUNCNAME} "$@" 635 debug-print-function ${FUNCNAME} "$@"
629 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
630 # Set some cmake default values here (usually workarounds for automagic deps) 642 # Set some cmake default values here (usually workarounds for automagic deps)
631 case ${KMNAME} in 643 case ${KMNAME} in
632 kdewebdev) 644 kdewebdev)
633 mycmakeargs=" 645 mycmakeargs=(
634 -DWITH_KdepimLibs=OFF 646 -DWITH_KdepimLibs=OFF
635 -DWITH_LibXml2=OFF 647 -DWITH_LibXml2=OFF
636 -DWITH_LibXslt=OFF 648 -DWITH_LibXslt=OFF
637 -DWITH_Boost=OFF 649 -DWITH_Boost=OFF
638 -DWITH_LibTidy=OFF 650 -DWITH_LibTidy=OFF
639 ${mycmakeargs}" 651 "${mycmakeargs[@]}"
652 )
640 ;; 653 ;;
641 esac 654 esac
642 655
643 kde4-base_src_configure 656 kde4-base_src_configure
644} 657}
653 kde4-base_src_compile "$@" 666 kde4-base_src_compile "$@"
654} 667}
655 668
656# @FUNCTION: kde4-meta_src_test 669# @FUNCTION: kde4-meta_src_test
657# @DESCRIPTION: 670# @DESCRIPTION:
658# 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
659# ebuilds. 672# I_KNOW_WHAT_I_AM_DOING is set. Use this in split ebuilds.
660kde4-meta_src_test() { 673kde4-meta_src_test() {
661 debug-print-function $FUNCNAME "$@" 674 debug-print-function $FUNCNAME "$@"
662 675
676 if [[ $I_KNOW_WHAT_I_AM_DOING ]]; then
663 kde4-base_src_test 677 kde4-base_src_test
678 else
679 einfo "Tests disabled"
680 fi
664} 681}
665 682
666# @FUNCTION: kde4-meta_src_install 683# @FUNCTION: kde4-meta_src_install
667# @DESCRIPTION: 684# @DESCRIPTION:
668# Function for installing KDE4 split applications. 685# Function for installing KDE4 split applications.
687 kde4-base_src_make_doc 704 kde4-base_src_make_doc
688} 705}
689 706
690# @FUNCTION: kde4-meta_pkg_postinst 707# @FUNCTION: kde4-meta_pkg_postinst
691# @DESCRIPTION: 708# @DESCRIPTION:
692# Display information about application handbook and invoke kbuildsycoca4. 709# Invoke kbuildsycoca4.
693kde4-meta_pkg_postinst() { 710kde4-meta_pkg_postinst() {
694 debug-print-function ${FUNCNAME} "$@" 711 debug-print-function ${FUNCNAME} "$@"
695
696 if has handbook ${IUSE//+} && ! use handbook; then
697 echo
698 einfo "Application handbook for ${PN} has not been installed."
699 einfo "To install handbook, reemerge =${CATEGORY}/${PF} with 'handbook' USE flag."
700 echo
701 fi
702 712
703 kde4-base_pkg_postinst 713 kde4-base_pkg_postinst
704} 714}
705 715
706# @FUNCTION: kde4-meta_pkg_postrm 716# @FUNCTION: kde4-meta_pkg_postrm

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

  ViewVC Help
Powered by ViewVC 1.1.20