/[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.21
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.21 2009/05/29 10:29:10 dagger 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.
28 koffice) 28 koffice)
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
34# Add khelpcenter dependency when installing
35if [[ ${PN} != khelpcenter ]] && has doc ${IUSE//+} && use doc; then
36 RDEPEND="${RDEPEND}
37 >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=]
38 "
39fi
33 40
34# Add dependencies that all packages in a certain module share. 41# Add dependencies that all packages in a certain module share.
35case ${KMNAME} in 42case ${KMNAME} in
36 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphic) 43 kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphic)
37 DEPEND="${DEPEND} 44 DEPEND="${DEPEND}
77 " 84 "
78 fi 85 fi
79 ;; 86 ;;
80 koffice) 87 koffice)
81 [[ ${PN} != koffice-data ]] && IUSE="debug" 88 [[ ${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} 89 RDEPEND="${RDEPEND}
95 !app-office/${PN}:0 90 !app-office/${PN}:0
96 !app-office/koffice:0 91 !app-office/koffice:0
97 !app-office/koffice-meta:0 92 !app-office/koffice-meta:0
98 " 93 "
99 case ${PN} in 94 if has openexr ${IUSE//+}; then
100 koffice-data) 95 COMMON_DEPEND="media-gfx/imagemagick[openexr?]"
101 DEPEND="${DEPEND} 96 else
102 media-libs/lcms 97 COMMON_DEPEND="media-gfx/imagemagick"
103 " 98 fi
104 RDEPEND="${RDEPEND} 99
105 media-libs/lcms 100 COMMON_DEPEND="${COMMON_DEPEND}
106 "
107 ;;
108 *)
109 COMMON_DEPEND="
110 dev-cpp/eigen:2 101 dev-cpp/eigen:2
111 media-gfx/imagemagick[openexr?]
112 media-libs/fontconfig 102 media-libs/fontconfig
113 media-libs/freetype:2 103 media-libs/freetype:2
114 " 104 "
115 DEPEND="${DEPEND} ${COMMON_DEPEND}" 105 DEPEND="${DEPEND} ${COMMON_DEPEND}"
116 RDEPEND="${RDEPEND} ${COMMON_DEPEND}" 106 RDEPEND="${RDEPEND} ${COMMON_DEPEND}"
117 unset COMMON_DEPEND 107 unset COMMON_DEPEND
118 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then 108 if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then
119 DEPEND="${DEPEND} 109 DEPEND="${DEPEND}
120 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=] 110 >=app-office/koffice-libs-${PV}:${SLOT}
121 " 111 "
122 RDEPEND="${RDEPEND} 112 RDEPEND="${RDEPEND}
123 >=app-office/koffice-libs-${PV}:${SLOT}[kdeprefix=] 113 >=app-office/koffice-libs-${PV}:${SLOT}
124 " 114 "
125 fi 115 fi
126 ;;
127 esac
128 ;; 116 ;;
129esac 117esac
130 118
131debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies" 119debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
132debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies" 120debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
135case ${BUILD_TYPE} in 123case ${BUILD_TYPE} in
136 live) 124 live)
137 case ${KMNAME} in 125 case ${KMNAME} in
138 extragear*|playground*) 126 extragear*|playground*)
139 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}" 127 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
128 ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
140 ;; 129 ;;
141 esac 130 esac
142 ;; 131 ;;
143 *) ;;
144esac 132esac
145 133
146# @ECLASS-VARIABLE: KMNAME 134# @ECLASS-VARIABLE: KMNAME
147# @DESCRIPTION: 135# @DESCRIPTION:
148# Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it 136# Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it
170 158
171# @ECLASS-VARIABLE: KMEXTRA 159# @ECLASS-VARIABLE: KMEXTRA
172# @DESCRIPTION: 160# @DESCRIPTION:
173# All subdirectories listed here will be extracted, compiled & installed. 161# All subdirectories listed here will be extracted, compiled & installed.
174# $KMMODULE is always added to $KMEXTRA. 162# $KMMODULE is always added to $KMEXTRA.
175# If the htmlhandbook USE-flag is set, and if this directory exists, 163# If the doc USE-flag is set, and if this directory exists,
176# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be 164# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be
177# handled in the ebuild. 165# handled in the ebuild.
178# If the documentation is in a different subdirectory, you should add it to KMEXTRA. 166# If the documentation is in a different subdirectory, you should add it to KMEXTRA.
179 167
180# @ECLASS-VARIABLE: KMCOMPILEONLY 168# @ECLASS-VARIABLE: KMCOMPILEONLY
265 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" 253 "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
266 fi 254 fi
267 else 255 else
268 local abort tarball tarfile f extractlist moduleprefix postfix 256 local abort tarball tarfile f extractlist moduleprefix postfix
269 case ${PV} in 257 case ${PV} in
258 4.2.85)
259 # block for normally packed upstream unstable snapshots
260 KMTARPARAMS="${KMTARPARAMS} --bzip2" # bz2
261 postfix="bz2"
262 ;;
270 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) 263 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*)
271 KMTARPARAMS="${KMTARPARAMS} --lzma" # lzma 264 KMTARPARAMS="${KMTARPARAMS} --lzma" # lzma
272 postfix="lzma" 265 postfix="lzma"
273 ;; 266 ;;
274 *) 267 *)
343# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, 336# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
344# KMEXTRACTONLY and KMTARPARAMS. 337# KMEXTRACTONLY and KMTARPARAMS.
345kde4-meta_create_extractlists() { 338kde4-meta_create_extractlists() {
346 debug-print-function ${FUNCNAME} "$@" 339 debug-print-function ${FUNCNAME} "$@"
347 340
348 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then 341 # TODO change to KMEXTRA for more strict check
342 if has doc ${IUSE//+} && use doc && [[ -n ${KMMODULE} ]]; then
349 # We use the basename of $KMMODULE because $KMMODULE can contain 343 # We use the basename of $KMMODULE because $KMMODULE can contain
350 # the path to the module subdirectory. 344 # the path to the module subdirectory.
351 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}" 345 KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}"
352 fi 346 fi
353 347
387 kdepim) 381 kdepim)
388 if [[ ${PN} != libkdepim ]]; then 382 if [[ ${PN} != libkdepim ]]; then
389 KMEXTRACTONLY="${KMEXTRACTONLY} 383 KMEXTRACTONLY="${KMEXTRACTONLY}
390 libkdepim" 384 libkdepim"
391 fi 385 fi
386 case ${SLOT} in
387 4.3|live)
388 KMEXTRACTONLY="${KMEXTRACTONLY}
389 kdepim-version.h
390 config-enterprise.h.cmake"
391 ;;
392 esac
392 KMEXTRACTONLY="${KMEXTRACTONLY} 393 KMEXTRACTONLY="${KMEXTRACTONLY}
393 kleopatra/ConfigureChecks.cmake" 394 kleopatra/ConfigureChecks.cmake"
394 if has kontact ${IUSE//+} && use kontact; then 395 if has kontact ${IUSE//+} && use kontact; then
395 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}" 396 KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}"
396 KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/" 397 KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/"
406 config-prefix.h.cmake" 407 config-prefix.h.cmake"
407 ;; 408 ;;
408 esac 409 esac
409 # Don't install cmake modules for split ebuilds, to avoid collisions. 410 # Don't install cmake modules for split ebuilds, to avoid collisions.
410 case ${KMNAME} in 411 case ${KMNAME} in
412 kdepim)
413 # No need for unpack since 4.2.86
414 # Remove when 4.2 is wiped out from the tree
415 case ${PV} in
416 4.1*|4.2.0|4.2.1|4.2.2|4.2.3|4.2.4|4.2.85)
417 KMCOMPILEONLY="${KMCOMPILEONLY}
418 cmake/modules/"
419 ;;
420 *) ;;
421 esac
422 ;;
411 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics|kdepim) 423 kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
412 case ${PN} in 424 case ${PN} in
413 libkdegames|libkdeedu|marble|libkworkspace) 425 libkdegames|libkdeedu|libkworkspace)
414 KMEXTRA="${KMEXTRA} 426 KMEXTRA="${KMEXTRA}
415 cmake/modules/" 427 cmake/modules/"
416 ;; 428 ;;
417 *) 429 *)
418 KMCOMPILEONLY="${KMCOMPILEONLY} 430 KMCOMPILEONLY="${KMCOMPILEONLY}
579 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ 591 sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \
580 die "${LINENO}: sed died in the kdebase-startkde collision prevention section" 592 die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
581 fi 593 fi
582 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82 594 # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
583 if [[ ${PN} != libkworkspace ]]; then 595 if [[ ${PN} != libkworkspace ]]; then
596 sed -i \
584 sed -i -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ 597 -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" 598 CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section"
586 fi 599 fi
587 ;; 600 ;;
588 kdebase-runtime) 601 kdebase-runtime)
589 # COLLISION PROTECT section 602 # COLLISION PROTECT section
590 # Only install the kde4 script as part of kde-base/kdebase-data 603 # 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' \ 612 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" 613 -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed"
601 _change_cmakelists_parent_dirs kmail 614 _change_cmakelists_parent_dirs kmail
602 ;; 615 ;;
603 esac 616 esac
617 ;;
618 kdewebdev)
619 # Disable hardcoded kdepimlibs check
620 sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
621 -e 's/find_package(LibXml2 REQUIRED)/macro_optional_find_package(LibXml2)/' \
622 -e 's/find_package(LibXslt REQUIRED)/macro_optional_find_package(LibXslt)/' \
623 -e 's/find_package(Boost REQUIRED)/macro_optional_find_package(Boost)/' \
624 -i CMakeLists.txt || die "failed to disable hardcoded checks"
604 ;; 625 ;;
605 koffice) 626 koffice)
606 # prevent collisions 627 # prevent collisions
607 if [[ ${PN} != koffice-data ]]; then 628 if [[ ${PN} != koffice-data ]]; then
608 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ 629 sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
622# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split 643# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
623# ebuilds. 644# ebuilds.
624kde4-meta_src_configure() { 645kde4-meta_src_configure() {
625 debug-print-function ${FUNCNAME} "$@" 646 debug-print-function ${FUNCNAME} "$@"
626 647
648 # Set some cmake default values here (usually workarounds for automagic deps)
649 case ${KMNAME} in
650 kdewebdev)
651 mycmakeargs="
652 -DWITH_KdepimLibs=OFF
653 -DWITH_LibXml2=OFF
654 -DWITH_LibXslt=OFF
655 -DWITH_Boost=OFF
656 -DWITH_LibTidy=OFF
657 ${mycmakeargs}"
658 ;;
659 esac
660
627 kde4-base_src_configure 661 kde4-base_src_configure
628} 662}
629 663
630# @FUNCTION: kde4-meta_src_compile 664# @FUNCTION: kde4-meta_src_compile
631# @DESCRIPTION: 665# @DESCRIPTION:
651# @DESCRIPTION: 685# @DESCRIPTION:
652# Function for installing KDE4 split applications. 686# Function for installing KDE4 split applications.
653kde4-meta_src_install() { 687kde4-meta_src_install() {
654 debug-print-function $FUNCNAME "$@" 688 debug-print-function $FUNCNAME "$@"
655 689
656 kde4-meta_src_make_doc 690 kde4-base_src_install
657 cmake-utils_src_install
658
659 if [[ -n ${KMSAVELIBS} ]]; then
660 install_library_dependencies
661 fi
662} 691}
663 692
664# @FUNCTION: kde4-meta_src_make_doc 693# @FUNCTION: kde4-meta_src_make_doc
665# @DESCRIPTION: 694# @DESCRIPTION:
666# This function searches in ${S}/${KMMODULE}, 695# This function searches in ${S}/${KMMODULE},
676 kde4-base_src_make_doc 705 kde4-base_src_make_doc
677} 706}
678 707
679# @FUNCTION: kde4-meta_pkg_postinst 708# @FUNCTION: kde4-meta_pkg_postinst
680# @DESCRIPTION: 709# @DESCRIPTION:
681# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split 710# Display information about application handbook and invoke kbuildsycoca4.
682# ebuilds.
683kde4-meta_pkg_postinst() { 711kde4-meta_pkg_postinst() {
684 debug-print-function ${FUNCNAME} "$@" 712 debug-print-function ${FUNCNAME} "$@"
713
714 if has doc ${IUSE//+} && ! use doc; then
715 echo
716 einfo "Application handbook for ${PN} has not been installed."
717 einfo "To install handbook, reemerge =${CATEGORY}/${P} with 'doc' USE flag."
718 echo
719 fi
685 720
686 kde4-base_pkg_postinst 721 kde4-base_pkg_postinst
687} 722}
688 723
689# @FUNCTION: kde4-meta_pkg_postrm 724# @FUNCTION: kde4-meta_pkg_postrm

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

  ViewVC Help
Powered by ViewVC 1.1.20