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

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

  ViewVC Help
Powered by ViewVC 1.1.20