/[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.15 Revision 1.22
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.15 2009/03/12 17:53:05 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.22 2009/06/04 09:29:54 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.
29 HOMEPAGE="http://www.koffice.org/" 29 HOMEPAGE="http://www.koffice.org/"
30 LICENSE="GPL-2" 30 LICENSE="GPL-2"
31 ;; 31 ;;
32esac 32esac
33 33
34# remove this codeblock when 4.2.3 is dropped
35if [[ ${PV} = "4.2.3" ]]; then
36 [[ ${PN} != khelpcenter ]] && has doc ${IUSE//+} \
37 RDEPEND="${RDEPEND} doc? ( >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=] )"
38else
39# Add khelpcenter dependency when installing handbooks
40if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then
41 RDEPEND="${RDEPEND}
42 handbook? ( >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=] )
43 "
44fi
45fi
34# Add dependencies that all packages in a certain module share. 46# Add dependencies that all packages in a certain module share.
35case ${KMNAME} in 47case ${KMNAME} in
36 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphic) 48 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
37 DEPEND="${DEPEND} 49 DEPEND="${DEPEND}
38 >=kde-base/qimageblitz-0.0.4 50 >=kde-base/qimageblitz-0.0.4
39 " 51 "
40 RDEPEND="${RDEPEND} 52 RDEPEND="${RDEPEND}
41 >=kde-base/qimageblitz-0.0.4 53 >=kde-base/qimageblitz-0.0.4
57 RDEPEND="${RDEPEND} 69 RDEPEND="${RDEPEND}
58 dev-libs/boost 70 dev-libs/boost
59 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=] 71 >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]
60 " 72 "
61 case ${PN} in 73 case ${PN} in
62 akregator|kaddressbook|kjots|kmail|kmobiletools|knode|knotes|korganizer|ktimetracker) 74 akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
63 IUSE="+kontact" 75 IUSE="+kontact"
64 RDEPEND="${RDEPEND} 76 RDEPEND="${RDEPEND}
65 kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] ) 77 kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )
66 " 78 "
67 ;; 79 ;;
77 " 89 "
78 fi 90 fi
79 ;; 91 ;;
80 koffice) 92 koffice)
81 [[ ${PN} != koffice-data ]] && IUSE="debug" 93 [[ ${PN} != koffice-data ]] && IUSE="debug"
82 case ${PV} in
83 9999*)
84 DEPEND="${DEPEND}
85 !app-office/${PN}:2
86 "
87 ;;
88 1.9*|2*)
89 DEPEND="${DEPEND}
90 !app-office/${PN}:live
91 "
92 ;;
93 esac
94 DEPEND="${DEPEND} 94 RDEPEND="${RDEPEND}
95 !app-office/${PN}:0 95 !app-office/${PN}:0
96 !app-office/koffice:0 96 !app-office/koffice:0
97 !app-office/koffice-meta:0 97 !app-office/koffice-meta:0
98 " 98 "
99 case ${PN} in 99 if has openexr ${IUSE//+}; then
100 koffice-data) 100 COMMON_DEPEND="media-gfx/imagemagick[openexr?]"
101 DEPEND="${DEPEND} 101 else
102 media-libs/lcms 102 COMMON_DEPEND="media-gfx/imagemagick"
103 " 103 fi
104 RDEPEND="${RDEPEND} 104
105 media-libs/lcms 105 COMMON_DEPEND="${COMMON_DEPEND}
106 "
107 ;;
108 *)
109 COMMON_DEPEND="
110 dev-cpp/eigen:2 106 dev-cpp/eigen:2
111 media-gfx/imagemagick[openexr?]
112 media-libs/fontconfig 107 media-libs/fontconfig
113 media-libs/freetype:2 108 media-libs/freetype:2
114 " 109 "
115 DEPEND="${DEPEND} ${COMMON_DEPEND}" 110 DEPEND="${DEPEND} ${COMMON_DEPEND}"
116 RDEPEND="${RDEPEND} ${COMMON_DEPEND}" 111 RDEPEND="${RDEPEND} ${COMMON_DEPEND}"
117 unset COMMON_DEPEND 112 unset COMMON_DEPEND
118 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then 113 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then
119 DEPEND="${DEPEND} 114 DEPEND="${DEPEND}
120 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=] 115 >=app-office/koffice-libs-${PV}:${SLOT}
121 " 116 "
122 RDEPEND="${RDEPEND} 117 RDEPEND="${RDEPEND}
123 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=] 118 >=app-office/koffice-libs-${PV}:${SLOT}
124 " 119 "
125 fi 120 fi
126 ;;
127 esac
128 ;; 121 ;;
129esac 122esac
130 123
131debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies" 124debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
132debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies" 125debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
135case ${BUILD_TYPE} in 128case ${BUILD_TYPE} in
136 live) 129 live)
137 case ${KMNAME} in 130 case ${KMNAME} in
138 extragear*|playground*) 131 extragear*|playground*)
139 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}" 132 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
133 ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
140 ;; 134 ;;
141 esac 135 esac
142 ;; 136 ;;
143 *) ;;
144esac 137esac
145 138
146# @ECLASS-VARIABLE: KMNAME 139# @ECLASS-VARIABLE: KMNAME
147# @DESCRIPTION: 140# @DESCRIPTION:
148# Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it 141# Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it
170 163
171# @ECLASS-VARIABLE: KMEXTRA 164# @ECLASS-VARIABLE: KMEXTRA
172# @DESCRIPTION: 165# @DESCRIPTION:
173# All subdirectories listed here will be extracted, compiled & installed. 166# All subdirectories listed here will be extracted, compiled & installed.
174# $KMMODULE is always added to $KMEXTRA. 167# $KMMODULE is always added to $KMEXTRA.
175# If the htmlhandbook USE-flag is set, and if this directory exists, 168# If the handbook USE-flag is set, and if this directory exists,
176# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be 169# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be
177# handled in the ebuild. 170# handled in the ebuild.
178# If the documentation is in a different subdirectory, you should add it to KMEXTRA. 171# If the documentation is in a different subdirectory, you should add it to KMEXTRA.
179 172
180# @ECLASS-VARIABLE: KMCOMPILEONLY 173# @ECLASS-VARIABLE: KMCOMPILEONLY
265 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 258 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
266 fi 259 fi
267 else 260 else
268 local abort tarball tarfile f extractlist moduleprefix postfix 261 local abort tarball tarfile f extractlist moduleprefix postfix
269 case ${PV} in 262 case ${PV} in
263 4.2.85|4.2.90)
264 # block for normally packed upstream unstable snapshots
265 KMTARPARAMS="${KMTARPARAMS} --bzip2" # bz2
266 postfix="bz2"
267 ;;
270 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) 268 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*)
271 KMTARPARAMS="${KMTARPARAMS} --lzma" # lzma 269 KMTARPARAMS="${KMTARPARAMS} --lzma" # lzma
272 postfix="lzma" 270 postfix="lzma"
273 ;; 271 ;;
274 *) 272 *)
343# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, 341# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
344# KMEXTRACTONLY and KMTARPARAMS. 342# KMEXTRACTONLY and KMTARPARAMS.
345kde4-meta_create_extractlists() { 343kde4-meta_create_extractlists() {
346 debug-print-function ${FUNCNAME} "$@" 344 debug-print-function ${FUNCNAME} "$@"
347 345
346 # TODO change to KMEXTRA for more strict check
347 # remvove 4.2.3 check when dropped
348 if [[ ${PV} = "4.2.3" ]]; then
349 if has doc ${IUSE//+} && use doc && [[ -n ${KMMODULE} ]]; then
350 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}"
351 fi
352 else
348 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then 353 if has handbook ${IUSE//+} && use handbook && [[ -n ${KMMODULE} ]]; then
349 # We use the basename of $KMMODULE because $KMMODULE can contain 354 # We use the basename of $KMMODULE because $KMMODULE can contain
350 # the path to the module subdirectory. 355 # the path to the module subdirectory.
351 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}" 356 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}"
357 fi
352 fi 358 fi
353 359
354 # Add some CMake-files to KMEXTRACTONLY. 360 # Add some CMake-files to KMEXTRACTONLY.
355 # Note that this actually doesn't include KMEXTRA handling. 361 # Note that this actually doesn't include KMEXTRA handling.
356 # In those cases you should care to add the relevant files to KMEXTRACTONLY 362 # In those cases you should care to add the relevant files to KMEXTRACTONLY
387 kdepim) 393 kdepim)
388 if [[ ${PN} != libkdepim ]]; then 394 if [[ ${PN} != libkdepim ]]; then
389 KMEXTRACTONLY="${KMEXTRACTONLY} 395 KMEXTRACTONLY="${KMEXTRACTONLY}
390 libkdepim" 396 libkdepim"
391 fi 397 fi
398 case ${SLOT} in
399 4.3|live)
400 KMEXTRACTONLY="${KMEXTRACTONLY}
401 kdepim-version.h
402 config-enterprise.h.cmake"
403 ;;
404 esac
392 KMEXTRACTONLY="${KMEXTRACTONLY} 405 KMEXTRACTONLY="${KMEXTRACTONLY}
393 kleopatra/ConfigureChecks.cmake" 406 kleopatra/ConfigureChecks.cmake"
394 if has kontact ${IUSE//+} && use kontact; then 407 if has kontact ${IUSE//+} && use kontact; then
395 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}" 408 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}"
396 KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/" 409 KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/"
406 config-prefix.h.cmake" 419 config-prefix.h.cmake"
407 ;; 420 ;;
408 esac 421 esac
409 # Don't install cmake modules for split ebuilds, to avoid collisions. 422 # Don't install cmake modules for split ebuilds, to avoid collisions.
410 case ${KMNAME} in 423 case ${KMNAME} in
424 kdepim)
425 # No need for unpack since 4.2.86
426 # Remove when 4.2 is wiped out from the tree
427 case ${PV} in
428 4.1*|4.2.0|4.2.1|4.2.2|4.2.3|4.2.4|4.2.85)
429 KMCOMPILEONLY="${KMCOMPILEONLY}
430 cmake/modules/"
431 ;;
432 *) ;;
433 esac
434 ;;
411 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics|kdepim) 435 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
412 case ${PN} in 436 case ${PN} in
413 libkdegames|libkdeedu|marble|libkworkspace) 437 libkdegames|libkdeedu|libkworkspace)
414 KMEXTRA="${KMEXTRA} 438 KMEXTRA="${KMEXTRA}
415 cmake/modules/" 439 cmake/modules/"
416 ;; 440 ;;
417 *) 441 *)
418 KMCOMPILEONLY="${KMCOMPILEONLY} 442 KMCOMPILEONLY="${KMCOMPILEONLY}
579 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ 603 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \
580 die "${LINENO}: sed died in the kdebase-startkde collision prevention section" 604 die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
581 fi 605 fi
582 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82 606 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
583 if [[ ${PN} != libkworkspace ]]; then 607 if [[ ${PN} != libkworkspace ]]; then
608 sed -i \
584 sed -i -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ 609 -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
585 CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip EXPORT section" 610 CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section"
586 fi 611 fi
587 ;; 612 ;;
588 kdebase-runtime) 613 kdebase-runtime)
589 # COLLISION PROTECT section 614 # COLLISION PROTECT section
590 # Only install the kde4 script as part of kde-base/kdebase-data 615 # Only install the kde4 script as part of kde-base/kdebase-data
599 sed -i -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \ 624 sed -i -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
600 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed" 625 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed"
601 _change_cmakelists_parent_dirs kmail 626 _change_cmakelists_parent_dirs kmail
602 ;; 627 ;;
603 esac 628 esac
629 ;;
630 kdewebdev)
631 # Disable hardcoded kdepimlibs check
632 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
633 -e 's/find_package(LibXml2 REQUIRED)/macro_optional_find_package(LibXml2)/' \
634 -e 's/find_package(LibXslt REQUIRED)/macro_optional_find_package(LibXslt)/' \
635 -e 's/find_package(Boost REQUIRED)/macro_optional_find_package(Boost)/' \
636 -i CMakeLists.txt || die "failed to disable hardcoded checks"
604 ;; 637 ;;
605 koffice) 638 koffice)
606 # prevent collisions 639 # prevent collisions
607 if [[ ${PN} != koffice-data ]]; then 640 if [[ ${PN} != koffice-data ]]; then
608 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ 641 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
622# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split 655# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
623# ebuilds. 656# ebuilds.
624kde4-meta_src_configure() { 657kde4-meta_src_configure() {
625 debug-print-function ${FUNCNAME} "$@" 658 debug-print-function ${FUNCNAME} "$@"
626 659
660 # Set some cmake default values here (usually workarounds for automagic deps)
661 case ${KMNAME} in
662 kdewebdev)
663 mycmakeargs="
664 -DWITH_KdepimLibs=OFF
665 -DWITH_LibXml2=OFF
666 -DWITH_LibXslt=OFF
667 -DWITH_Boost=OFF
668 -DWITH_LibTidy=OFF
669 ${mycmakeargs}"
670 ;;
671 esac
672
627 kde4-base_src_configure 673 kde4-base_src_configure
628} 674}
629 675
630# @FUNCTION: kde4-meta_src_compile 676# @FUNCTION: kde4-meta_src_compile
631# @DESCRIPTION: 677# @DESCRIPTION:
651# @DESCRIPTION: 697# @DESCRIPTION:
652# Function for installing KDE4 split applications. 698# Function for installing KDE4 split applications.
653kde4-meta_src_install() { 699kde4-meta_src_install() {
654 debug-print-function $FUNCNAME "$@" 700 debug-print-function $FUNCNAME "$@"
655 701
656 kde4-meta_src_make_doc 702 kde4-base_src_install
657 cmake-utils_src_install
658
659 if [[ -n ${KMSAVELIBS} ]]; then
660 install_library_dependencies
661 fi
662} 703}
663 704
664# @FUNCTION: kde4-meta_src_make_doc 705# @FUNCTION: kde4-meta_src_make_doc
665# @DESCRIPTION: 706# @DESCRIPTION:
666# This function searches in ${S}/${KMMODULE}, 707# This function searches in ${S}/${KMMODULE},
676 kde4-base_src_make_doc 717 kde4-base_src_make_doc
677} 718}
678 719
679# @FUNCTION: kde4-meta_pkg_postinst 720# @FUNCTION: kde4-meta_pkg_postinst
680# @DESCRIPTION: 721# @DESCRIPTION:
681# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split 722# Display information about application handbook and invoke kbuildsycoca4.
682# ebuilds.
683kde4-meta_pkg_postinst() { 723kde4-meta_pkg_postinst() {
684 debug-print-function ${FUNCNAME} "$@" 724 debug-print-function ${FUNCNAME} "$@"
725
726 if has handbook ${IUSE//+} && ! use handbook; then
727 echo
728 einfo "Application handbook for ${PN} has not been installed."
729 einfo "To install handbook, reemerge =${CATEGORY}/${P} with 'handbook' USE flag."
730 echo
731 fi
685 732
686 kde4-base_pkg_postinst 733 kde4-base_pkg_postinst
687} 734}
688 735
689# @FUNCTION: kde4-meta_pkg_postrm 736# @FUNCTION: kde4-meta_pkg_postrm

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.22

  ViewVC Help
Powered by ViewVC 1.1.20