/[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.27
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.27 2009/10/27 14:16:49 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.
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+="
38 dev-libs/boost 35 dev-libs/boost
39 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=] 36 $(add_kdebase_dep kdepimlibs)
40 " 37 "
41 case ${PN} in 38 case ${PN} in
42 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker) 39 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
43 IUSE+=" +kontact" 40 IUSE+=" +kontact"
44 RDEPEND+=" kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" 41 if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then
42 RDEPEND+=" kontact? ( $(add_kdebase_dep kontactinterfaces) )"
43 fi
45 ;; 44 ;;
46 esac 45 esac
47 ;; 46 ;;
48 kdegames) 47 kdegames)
49 if [[ ${PN} != libkdegames ]]; then 48 if [[ ${PN} != libkdegames ]]; then
50 COMMONDEPEND+=" >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=] " 49 COMMONDEPEND+=" $(add_kdebase_dep libkdegames)"
51 fi 50 fi
52 ;; 51 ;;
53 koffice) 52 koffice)
54 [[ ${PN} != koffice-data ]] && IUSE+=" debug" 53 [[ ${PN} != koffice-data ]] && IUSE+=" debug"
55 RDEPEND+=" 54 RDEPEND+="
215 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 214 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
216 fi 215 fi
217 else 216 else
218 local abort tarball tarfile f extractlist moduleprefix postfix 217 local abort tarball tarfile f extractlist moduleprefix postfix
219 case ${PV} in 218 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) 219 4.3.85 | 4.3.9[0568])
221 # block for normally packed upstream unstable snapshots 220 # block for normally packed upstream unstable snapshots
222 KMTARPARAMS+=" --bzip2" # bz2 221 KMTARPARAMS+=" --bzip2" # bz2
223 postfix="bz2" 222 postfix="bz2"
224 ;; 223 ;;
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*) 224 4.3.[6-9]*)
226 KMTARPARAMS+=" --lzma" # lzma 225 KMTARPARAMS+=" --lzma" # lzma
227 postfix="lzma" 226 postfix="lzma"
228 ;; 227 ;;
229 *) 228 *)
230 KMTARPARAMS+=" --bzip2" # bz2 229 KMTARPARAMS+=" --bzip2" # bz2
356 KMEXTRACTONLY+=" 355 KMEXTRACTONLY+="
357 kleopatra/ConfigureChecks.cmake" 356 kleopatra/ConfigureChecks.cmake"
358 if has kontact ${IUSE//+} && use kontact; then 357 if has kontact ${IUSE//+} && use kontact; then
359 KMEXTRA+=" 358 KMEXTRA+="
360 kontact/plugins/${PLUGINNAME:-${PN}}/" 359 kontact/plugins/${PLUGINNAME:-${PN}}/"
360 if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then
361 KMEXTRACTONLY+=" 361 KMEXTRACTONLY+="
362 kontactinterfaces/" 362 kontactinterfaces/"
363 fi
363 fi 364 fi
364 ;; 365 ;;
365 kdeutils) 366 kdeutils)
366 case ${SLOT} in 367 case ${SLOT} in
367 4.3|4.4|live) 368 4.3|4.4|live)
390 case ${KMNAME} in 391 case ${KMNAME} in
391 kdepim) 392 kdepim)
392 # No need for unpack since 4.2.86 393 # No need for unpack since 4.2.86
393 # Remove when 4.2 is wiped out from the tree 394 # Remove when 4.2 is wiped out from the tree
394 case ${PV} in 395 case ${PV} in
395 4.1*|4.2.0|4.2.1|4.2.2|4.2.3|4.2.4|4.2.85) 396 4.2.[0-4])
396 KMCOMPILEONLY+=" 397 KMCOMPILEONLY+="
397 cmake/modules/" 398 cmake/modules/"
398 ;; 399 ;;
399 *) ;;
400 esac 400 esac
401 ;; 401 ;;
402 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics) 402 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
403 case ${PN} in 403 case ${PN} in
404 libkdegames|libkdeedu|libkworkspace) 404 libkdegames|libkdeedu|libkworkspace)
503 pushd "${S}" > /dev/null 503 pushd "${S}" > /dev/null
504 504
505 comment_all_add_subdirectory ./ 505 comment_all_add_subdirectory ./
506 506
507 # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt 507 # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt
508 if [[ -f "${S}"/CMakeLists.txt ]]; then 508 if [[ -f CMakeLists.txt ]]; then
509 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \ 509 sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
510 -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \ 510 -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
511 -i "${S}"/CMakeLists.txt || die "${LINENO}: cmake sed died" 511 -i CMakeLists.txt || die "${LINENO}: cmake sed died"
512 fi 512 fi
513 513
514 if [[ -z ${KMNOMODULE} ]]; then 514 if [[ -z ${KMNOMODULE} ]]; then
515 # Restore "add_subdirectory" in $KMMODULE subdirectories 515 # Restore "add_subdirectory" in $KMMODULE subdirectories
516 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 516 find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | \
517 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
517 die "${LINENO}: died in KMMODULE section" 518 die "${LINENO}: died in KMMODULE section"
518 _change_cmakelists_parent_dirs ${KMMODULE} 519 _change_cmakelists_parent_dirs ${KMMODULE}
519 fi 520 fi
520 521
521 local i 522 local i
522 523
523 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY 524 # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
524 for i in ${KMEXTRACTONLY}; do 525 for i in ${KMEXTRACTONLY}; do
525 if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then 526 if [[ -d ${i} && -f ${i}/../CMakeLists.txt ]]; then
526 sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \ 527 sed -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" \
528 -i ${i}/../CMakeLists.txt || \
527 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}" 529 die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
528 fi 530 fi
529 done 531 done
530 532
531 # KMCOMPILEONLY 533 # KMCOMPILEONLY
553 # KMEXTRA_NONFATAL section 555 # KMEXTRA_NONFATAL section
554 for i in ${KMEXTRA_NONFATAL}; do 556 for i in ${KMEXTRA_NONFATAL}; do
555 if [[ -d "${S}"/${i} ]]; then 557 if [[ -d "${S}"/${i} ]]; then
556 find "${S}"/${i} -name CMakeLists.txt -print0 | \ 558 find "${S}"/${i} -name CMakeLists.txt -print0 | \
557 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ 559 xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
558 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" 560 die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
559 _change_cmakelists_parent_dirs ${i} 561 _change_cmakelists_parent_dirs ${i}
560 fi 562 fi
561 done 563 done
562 564
563 case ${KMNAME} in 565 case ${KMNAME} in
564 kdebase-workspace) 566 kdebase-workspace)
565 # COLLISION PROTECT section 567 # COLLISION PROTECT section
566 # Install the startkde script just once, as a part of kde-base/kdebase-startkde, 568 # Install the startkde script just once, as a part of kde-base/kdebase-startkde,
567 # not as a part of every package. 569 # not as a part of every package.
568 if [[ ${PN} != kdebase-startkde && -f "${S}"/CMakeLists.txt ]]; then 570 if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
569 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0. 571 # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
570 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ 572 sed -e '/startkde/s/^/#DONOTINSTALL /' \
571 die "${LINENO}: sed died in the kdebase-startkde collision prevention section" 573 -i CMakeLists.txt || die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
572 fi 574 fi
573 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82 575 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
574 if [[ ${PN} != libkworkspace ]]; then 576 if [[ ${PN} != libkworkspace ]]; then
575 sed -i \
576 -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ 577 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" 578 -i CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section"
578 fi 579 fi
579 ;; 580 ;;
580 kdebase-runtime) 581 kdebase-runtime)
581 # COLLISION PROTECT section 582 # COLLISION PROTECT section
582 # Only install the kde4 script as part of kde-base/kdebase-data 583 # Only install the kde4 script as part of kde-base/kdebase-data
583 if [[ ${PN} != kdebase-data && -f "${S}"/CMakeLists.txt ]]; then 584 if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then
584 sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ 585 sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
585 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 586 -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
586 fi 587 fi
588 ;;
589 kdenetwork)
590 # Disable hardcoded kdepimlibs check
591 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
592 -i CMakeLists.txt || die "failed to disable hardcoded checks"
587 ;; 593 ;;
588 kdepim) 594 kdepim)
589 case ${PN} in 595 case ${PN} in
590 kaddressbook|kalarm|kmailcvt|kontact|korganizer|korn) 596 kaddressbook|kalarm|kmailcvt|kontact|korganizer|korn)
591 sed -i -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \ 597 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" 598 -e '/add_custom_target(kmail_xml /,/)/p' \
599 -i kmail/CMakeLists.txt || die "uncommenting xml failed"
593 _change_cmakelists_parent_dirs kmail 600 _change_cmakelists_parent_dirs kmail
594 ;; 601 ;;
595 esac 602 esac
596 ;; 603 ;;
597 kdewebdev) 604 kdewebdev)
603 -i CMakeLists.txt || die "failed to disable hardcoded checks" 610 -i CMakeLists.txt || die "failed to disable hardcoded checks"
604 ;; 611 ;;
605 koffice) 612 koffice)
606 # prevent collisions 613 # prevent collisions
607 if [[ ${PN} != koffice-data ]]; then 614 if [[ ${PN} != koffice-data ]]; then
608 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ 615 sed -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
609 "${S}"/cmake/modules/CMakeLists.txt || \
610 die "${LINENO}: sed died in collision prevention section" 616 -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' \ 617 sed -e '/install(.\+config-openexr\.h.\+)/d' \
619 "${S}"//CMakeLists.txt || \
620 die "${LINENO}: sed died in collision prevention section" 618 -i CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
621 ;;
622 esac
623 fi 619 fi
620 # koffice 2.0
621 case ${PV} in
622 2.0.[1-9])
623 sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \
624 "${S}"/CMakeLists.txt || \
625 die "${LINENO}: sed died in collision prevention section"
626 ;;
627 *) ;;
628 esac
624 esac 629 esac
625 630
626 popd > /dev/null 631 popd > /dev/null
627} 632}
628 633

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

  ViewVC Help
Powered by ViewVC 1.1.20