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

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

  ViewVC Help
Powered by ViewVC 1.1.20