/[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.24 Revision 1.29
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.24 2009/08/07 01:00:11 wired Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.29 2009/12/02 17:07:05 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.
20 die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild" 20 die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
21fi 21fi
22 22
23# Add khelpcenter dependency when installing handbooks 23# Add khelpcenter dependency when installing handbooks
24if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then 24if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then
25 RDEPEND+=" handbook? ( >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=] )" 25 RDEPEND+=" handbook? ( $(add_kdebase_dep khelpcenter) )"
26fi 26fi
27 27
28# Add dependencies that all packages in a certain module share. 28# Add dependencies that all packages in a certain module share.
29case ${KMNAME} in 29case ${KMNAME} in
30 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics) 30 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
31 COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4" 31 COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4"
32 ;; 32 ;;
33 kdenetwork)
34 COMMONDEPEND+=" >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]"
35 ;;
36 kdepim|kdepim-runtime) 33 kdepim|kdepim-runtime)
37 COMMONDEPEND+=" 34 COMMONDEPEND+=" $(add_kdebase_dep kdepimlibs)"
38 dev-libs/boost
39 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
40 "
41 case ${PN} in 35 case ${PN} in
42 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker) 36 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
43 IUSE+=" +kontact" 37 IUSE+=" +kontact"
44 RDEPEND+=" kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" 38 if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then
39 RDEPEND+=" kontact? ( $(add_kdebase_dep kontactinterfaces) )"
40 fi
45 ;; 41 ;;
46 esac 42 esac
47 ;; 43 ;;
48 kdegames) 44 kdegames)
49 if [[ ${PN} != libkdegames ]]; then 45 if [[ ${PN} != libkdegames ]]; then
50 COMMONDEPEND+=" >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=] " 46 COMMONDEPEND+=" $(add_kdebase_dep libkdegames)"
51 fi 47 fi
52 ;; 48 ;;
53 koffice) 49 koffice)
54 [[ ${PN} != koffice-data ]] && IUSE+=" debug" 50 [[ ${PN} != koffice-data ]] && IUSE+=" debug"
55 RDEPEND+=" 51 RDEPEND+="
215 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 211 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
216 fi 212 fi
217 else 213 else
218 local abort tarball tarfile f extractlist moduleprefix postfix 214 local abort tarball tarfile f extractlist moduleprefix postfix
219 case ${PV} in 215 case ${PV} in
220 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) 216 4.3.8[05] | 4.3.9[0568])
221 # block for normally packed upstream unstable snapshots 217 # block for normally packed upstream unstable snapshots
222 KMTARPARAMS+=" --bzip2" # bz2 218 KMTARPARAMS+=" --bzip2" # bz2
223 postfix="bz2" 219 postfix="bz2"
224 ;; 220 ;;
225 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6* | 4.3.9* | 4.3.8* | 4.3.7* | 4.3.6*) 221 4.3.[6-9]*)
226 KMTARPARAMS+=" --lzma" # lzma 222 # Not passing --xz, as it doesn't work with stable tar
223 KMTARPARAMS+=" --use-compress-program=xz" # xz
227 postfix="lzma" 224 postfix="xz"
228 ;; 225 ;;
229 *) 226 *)
230 KMTARPARAMS+=" --bzip2" # bz2 227 KMTARPARAMS+=" --bzip2" # bz2
231 postfix="bz2" 228 postfix="bz2"
232 ;; 229 ;;
356 KMEXTRACTONLY+=" 353 KMEXTRACTONLY+="
357 kleopatra/ConfigureChecks.cmake" 354 kleopatra/ConfigureChecks.cmake"
358 if has kontact ${IUSE//+} && use kontact; then 355 if has kontact ${IUSE//+} && use kontact; then
359 KMEXTRA+=" 356 KMEXTRA+="
360 kontact/plugins/${PLUGINNAME:-${PN}}/" 357 kontact/plugins/${PLUGINNAME:-${PN}}/"
358 if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then
361 KMEXTRACTONLY+=" 359 KMEXTRACTONLY+="
362 kontactinterfaces/" 360 kontactinterfaces/"
361 fi
363 fi 362 fi
364 ;; 363 ;;
365 kdeutils) 364 kdeutils)
366 case ${SLOT} in 365 case ${SLOT} in
367 4.3|4.4|live) 366 4.3|4.4|live)
390 case ${KMNAME} in 389 case ${KMNAME} in
391 kdepim) 390 kdepim)
392 # No need for unpack since 4.2.86 391 # No need for unpack since 4.2.86
393 # Remove when 4.2 is wiped out from the tree 392 # Remove when 4.2 is wiped out from the tree
394 case ${PV} in 393 case ${PV} in
395 4.1*|4.2.0|4.2.1|4.2.2|4.2.3|4.2.4|4.2.85) 394 4.2.[0-4])
396 KMCOMPILEONLY+=" 395 KMCOMPILEONLY+="
397 cmake/modules/" 396 cmake/modules/"
398 ;; 397 ;;
399 *) ;;
400 esac 398 esac
401 ;; 399 ;;
402 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics) 400 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
403 case ${PN} in 401 case ${PN} in
404 libkdegames|libkdeedu|libkworkspace) 402 libkdegames|libkdeedu|libkworkspace)
503 pushd "${S}" > /dev/null 501 pushd "${S}" > /dev/null
504 502
505 comment_all_add_subdirectory ./ 503 comment_all_add_subdirectory ./
506 504
507 # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt 505 # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt
508 if [[ -f "${S}"/CMakeLists.txt ]]; then 506 if [[ -f CMakeLists.txt ]]; then
509 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \ 507 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
510 -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \ 508 -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
511 -i "${S}"/CMakeLists.txt || die "${LINENO}: cmake sed died" 509 -i CMakeLists.txt || die "${LINENO}: cmake sed died"
512 fi 510 fi
513 511
514 if [[ -z ${KMNOMODULE} ]]; then 512 if [[ -z ${KMNOMODULE} ]]; then
515 # Restore "add_subdirectory" in $KMMODULE subdirectories 513 # Restore "add_subdirectory" in $KMMODULE subdirectories
516 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 514 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | \
515 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
517 die "${LINENO}: died in KMMODULE section" 516 die "${LINENO}: died in KMMODULE section"
518 _change_cmakelists_parent_dirs ${KMMODULE} 517 _change_cmakelists_parent_dirs ${KMMODULE}
519 fi 518 fi
520 519
521 local i 520 local i
522 521
523 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY 522 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
524 for i in ${KMEXTRACTONLY}; do 523 for i in ${KMEXTRACTONLY}; do
525 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then 524 if [[ -d ${i} && -f ${i}/../CMakeLists.txt ]]; then
526 sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \ 525 sed -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" \
526 -i ${i}/../CMakeLists.txt || \
527 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}" 527 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
528 fi 528 fi
529 done 529 done
530 530
531 # KMCOMPILEONLY 531 # KMCOMPILEONLY
553 # KMEXTRA_NONFATAL section 553 # KMEXTRA_NONFATAL section
554 for i in ${KMEXTRA_NONFATAL}; do 554 for i in ${KMEXTRA_NONFATAL}; do
555 if [[ -d "${S}"/${i} ]]; then 555 if [[ -d "${S}"/${i} ]]; then
556 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 556 find "${S}"/${i} -name CMakeLists.txt -print0 | \
557 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 557 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
558 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" 558 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
559 _change_cmakelists_parent_dirs ${i} 559 _change_cmakelists_parent_dirs ${i}
560 fi 560 fi
561 done 561 done
562 562
563 case ${KMNAME} in 563 case ${KMNAME} in
564 kdebase-workspace) 564 kdebase-workspace)
565 # COLLISION PROTECT section 565 # COLLISION PROTECT section
566 # Install the startkde script just once, as a part of kde-base/kdebase-startkde, 566 # Install the startkde script just once, as a part of kde-base/kdebase-startkde,
567 # not as a part of every package. 567 # not as a part of every package.
568 if [[ ${PN} != kdebase-startkde && -f "${S}"/CMakeLists.txt ]]; then 568 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
569 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0. 569 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
570 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ 570 sed -e '/startkde/s/^/#DONOTINSTALL /' \
571 die "${LINENO}: sed died in the kdebase-startkde collision prevention section" 571 -i CMakeLists.txt || die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
572 fi 572 fi
573 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82 573 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
574 if [[ ${PN} != libkworkspace ]]; then 574 if [[ ${PN} != libkworkspace ]]; then
575 sed -i \
576 -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ 575 sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
577 CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section" 576 -i CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section"
578 fi 577 fi
579 ;; 578 ;;
580 kdebase-runtime) 579 kdebase-runtime)
581 # COLLISION PROTECT section 580 # COLLISION PROTECT section
582 # Only install the kde4 script as part of kde-base/kdebase-data 581 # Only install the kde4 script as part of kde-base/kdebase-data
583 if [[ ${PN} != kdebase-data && -f "${S}"/CMakeLists.txt ]]; then 582 if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then
584 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ 583 sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
585 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 584 -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
586 fi 585 fi
586 ;;
587 kdenetwork)
588 # Disable hardcoded kdepimlibs check
589 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
590 -i CMakeLists.txt || die "failed to disable hardcoded checks"
587 ;; 591 ;;
588 kdepim) 592 kdepim)
589 case ${PN} in 593 case ${PN} in
590 kaddressbook|kalarm|kmailcvt|kontact|korganizer|korn) 594 kaddressbook|kalarm|kmailcvt|kontact|korganizer|korn)
591 sed -i -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \ 595 sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
592 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed" 596 -e '/add_custom_target(kmail_xml /,/)/p' \
597 -i kmail/CMakeLists.txt || die "uncommenting xml failed"
593 _change_cmakelists_parent_dirs kmail 598 _change_cmakelists_parent_dirs kmail
594 ;; 599 ;;
595 esac 600 esac
596 ;; 601 ;;
597 kdewebdev) 602 kdewebdev)
603 -i CMakeLists.txt || die "failed to disable hardcoded checks" 608 -i CMakeLists.txt || die "failed to disable hardcoded checks"
604 ;; 609 ;;
605 koffice) 610 koffice)
606 # prevent collisions 611 # prevent collisions
607 if [[ ${PN} != koffice-data ]]; then 612 if [[ ${PN} != koffice-data ]]; then
608 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ 613 sed -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
609 "${S}"/cmake/modules/CMakeLists.txt || \
610 die "${LINENO}: sed died in collision prevention section" 614 -i cmake/modules/CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
611 case ${PV} in
612 2.0.*)
613 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \
614 "${S}"/CMakeLists.txt || \
615 die "${LINENO}: sed died in collision prevention section"
616 ;;
617 *)
618 sed -i -e '/install(.\+config-openexr\.h.\+)/d' \ 615 sed -e '/install(.\+config-openexr\.h.\+)/d' \
619 "${S}"//CMakeLists.txt || \
620 die "${LINENO}: sed died in collision prevention section" 616 -i CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
621 ;;
622 esac
623 fi 617 fi
618 # koffice 2.0
619 case ${PV} in
620 2.0.[1-9])
621 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \
622 "${S}"/CMakeLists.txt || \
623 die "${LINENO}: sed died in collision prevention section"
624 ;;
625 *) ;;
626 esac
624 esac 627 esac
625 628
626 popd > /dev/null 629 popd > /dev/null
627} 630}
628 631
693 kde4-base_src_make_doc 696 kde4-base_src_make_doc
694} 697}
695 698
696# @FUNCTION: kde4-meta_pkg_postinst 699# @FUNCTION: kde4-meta_pkg_postinst
697# @DESCRIPTION: 700# @DESCRIPTION:
698# Display information about application handbook and invoke kbuildsycoca4. 701# Invoke kbuildsycoca4.
699kde4-meta_pkg_postinst() { 702kde4-meta_pkg_postinst() {
700 debug-print-function ${FUNCNAME} "$@" 703 debug-print-function ${FUNCNAME} "$@"
701
702 if has handbook ${IUSE//+} && ! use handbook; then
703 echo
704 einfo "Application handbook for ${PN} has not been installed."
705 einfo "To install handbook, reemerge =${CATEGORY}/${PF} with 'handbook' USE flag."
706 echo
707 fi
708 704
709 kde4-base_pkg_postinst 705 kde4-base_pkg_postinst
710} 706}
711 707
712# @FUNCTION: kde4-meta_pkg_postrm 708# @FUNCTION: kde4-meta_pkg_postrm

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.29

  ViewVC Help
Powered by ViewVC 1.1.20