/[gentoo-x86]/eclass/kde4-base.eclass
Gentoo

Diff of /eclass/kde4-base.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.79 Revision 1.89
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2010 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-base.eclass,v 1.79 2010/12/06 10:17:04 tampakrap Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.89 2011/04/22 11:18:34 scarabeus Exp $
4 4
5# @ECLASS: kde4-base.eclass 5# @ECLASS: kde4-base.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# kde@gentoo.org 7# kde@gentoo.org
8# @BLURB: This eclass provides functions for kde 4.X ebuilds 8# @BLURB: This eclass provides functions for kde 4.X ebuilds
9# @DESCRIPTION: 9# @DESCRIPTION:
10# The kde4-base.eclass provides support for building KDE4 based ebuilds 10# The kde4-base.eclass provides support for building KDE4 based ebuilds
11# and KDE4 applications. 11# and KDE4 applications.
12# 12#
13# NOTE: KDE 4 ebuilds by default define EAPI="2", this can be redefined but 13# NOTE: KDE 4 ebuilds currently support EAPI "3". This will be reviewed
14# eclass will fail with version older than 2. 14# over time as new EAPI versions are approved.
15 15
16# @ECLASS-VARIABLE: VIRTUALX_REQUIRED 16# @ECLASS-VARIABLE: VIRTUALX_REQUIRED
17# @DESCRIPTION: 17# @DESCRIPTION:
18# Do we need an X server? Valid values are "always", "optional", and "manual". 18# For proper description see virtualx.eclass manpage.
19# "tests" is a synonym for "optional". While virtualx.eclass supports in principle 19# Here we redefine default value to be manual, if your package needs virtualx
20# also the use of an X server during other ebuild phases, we only use it in 20# for tests you should proceed with setting VIRTUALX_REQUIRED=test.
21# src_test here. Most likely you'll want to set "optional", which introduces the
22# use-flag "test" (if not already present), adds dependencies conditional on that
23# use-flag, and automatically runs (only) the ebuild test phase with a virtual X server
24# present. This makes things a lot more comfortable than the bare virtualx eclass.
25
26# In case the variable is not set in the ebuild, let virtualx eclass not do anything
27: ${VIRTUALX_REQUIRED:=manual} 21: ${VIRTUALX_REQUIRED:=manual}
28 22
29inherit kde4-functions base virtualx eutils 23inherit kde4-functions fdo-mime gnome2-utils base virtualx versionator eutils
30 24
31get_build_type
32if [[ ${BUILD_TYPE} = live ]]; then 25if [[ ${BUILD_TYPE} = live ]]; then
33 if [[ ${KDEBASE} = kdevelop ]]; then 26 case ${KDE_SCM} in
34 inherit git
35 else
36 inherit subversion 27 svn) inherit subversion ;;
37 fi 28 git) inherit git ;;
29 esac
38fi 30fi
39 31
40# @ECLASS-VARIABLE: CMAKE_REQUIRED 32# @ECLASS-VARIABLE: CMAKE_REQUIRED
41# @DESCRIPTION: 33# @DESCRIPTION:
42# Specify if cmake buildsystem is being used. Possible values are 'always' and 'never'. 34# Specify if cmake buildsystem is being used. Possible values are 'always' and 'never'.
67# One may override this variable to raise version requirements. 59# One may override this variable to raise version requirements.
68# For possible values look at KDE_SLOTS and KDE_LIVE_SLOTS variables. 60# For possible values look at KDE_SLOTS and KDE_LIVE_SLOTS variables.
69# Note that it is fixed to ${SLOT} for kde-base packages. 61# Note that it is fixed to ${SLOT} for kde-base packages.
70KDE_MINIMAL="${KDE_MINIMAL:-4.4}" 62KDE_MINIMAL="${KDE_MINIMAL:-4.4}"
71 63
72# Set slot for packages in kde-base, koffice and kdevelop 64# Set slot for KDEBASE known packages
73case ${KDEBASE} in 65case ${KDEBASE} in
74 kde-base) 66 kde-base)
75 # Determine SLOT from PVs 67 SLOT=$(_calculate_kde_slot)
76 case ${PV} in 68 [[ -z ${SLOT} ]] && die "Unsupported ${PV}"
77 *.9999*) SLOT="${PV/.9999*/}" ;; # stable live
78 4.6* | 4.5.[6-9][0-9]*) SLOT="4.6" ;;
79 4.5* | 4.4.[6-9][0-9]*) SLOT="4.5" ;;
80 4.4* | 4.3.[6-9][0-9]*) SLOT="4.4" ;;
81 9999*) SLOT="live" ;; # regular live
82 *) die "Unsupported ${PV}" ;;
83 esac
84 KDE_MINIMAL="${SLOT}" 69 KDE_MINIMAL="${SLOT}"
85 ;; 70 ;;
86 koffice) 71 koffice)
87 SLOT="2" 72 SLOT="2"
88 ;; 73 ;;
115 fi 100 fi
116 SLOT="4" 101 SLOT="4"
117 ;; 102 ;;
118esac 103esac
119 104
120slot_is_at_least 4.5 ${KDE_MINIMAL} && CMAKE_MIN_VERSION="2.8.1"
121
122inherit ${buildsystem_eclass} 105inherit ${buildsystem_eclass}
123 106
124EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg_postrm 107EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_preinst pkg_postinst pkg_postrm
125 108
126unset buildsystem_eclass 109unset buildsystem_eclass
127unset export_fns 110unset export_fns
128 111
129# @ECLASS-VARIABLE: DECLARATIVE_REQUIRED 112# @ECLASS-VARIABLE: DECLARATIVE_REQUIRED
176# (handbook USE flag) and 'never'. 159# (handbook USE flag) and 'never'.
177# This variable must be set before inheriting any eclasses. Defaults to 'never'. 160# This variable must be set before inheriting any eclasses. Defaults to 'never'.
178# It adds default handbook dirs for kde-base packages to KMEXTRA and in any case it 161# It adds default handbook dirs for kde-base packages to KMEXTRA and in any case it
179# ensures buildtime and runtime dependencies. 162# ensures buildtime and runtime dependencies.
180KDE_HANDBOOK="${KDE_HANDBOOK:-never}" 163KDE_HANDBOOK="${KDE_HANDBOOK:-never}"
164
165# @ECLASS-VARIABLE: KDE_LINGUAS_LIVE_OVERRIDE
166# @DESCRIPTION:
167# Set this varible if you want your live package to manage its
168# translations. (Mostly all kde ebuilds does not ship documentation
169# and translations in live ebuilds)
170if [[ ${BUILD_TYPE} == live && -z ${KDE_LINGUAS_LIVE_OVERRIDE} && ${KDEBASE} != "kde-base" ]]; then
171 KDE_HANDBOOK=never
172 KDE_LINGUAS=""
173fi
181 174
182# Setup packages inheriting this eclass 175# Setup packages inheriting this eclass
183case ${KDEBASE} in 176case ${KDEBASE} in
184 kde-base) 177 kde-base)
185 HOMEPAGE="http://www.kde.org/" 178 HOMEPAGE="http://www.kde.org/"
214 ;; 207 ;;
215esac 208esac
216 209
217# @ECLASS-VARIABLE: QT_MINIMAL 210# @ECLASS-VARIABLE: QT_MINIMAL
218# @DESCRIPTION: 211# @DESCRIPTION:
219# Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1... 212# Determine version of qt we enforce as minimal for the package.
220# 4.6.0 for 4.4, 4.6.3 for 4.5, and 4.7.0 for 4.6 and later
221if slot_is_at_least 4.6 "${KDE_MINIMAL}"; then 213if slot_is_at_least 4.6 "${KDE_MINIMAL}"; then
222 QT_MINIMAL="${QT_MINIMAL:-4.7.0}" 214 QT_MINIMAL="${QT_MINIMAL:-4.7.0}"
223elif slot_is_at_least 4.5 "${KDE_MINIMAL}"; then 215else
224 QT_MINIMAL="${QT_MINIMAL:-4.6.3}" 216 QT_MINIMAL="${QT_MINIMAL:-4.6.3}"
225else
226 QT_MINIMAL="${QT_MINIMAL:-4.6.0}"
227fi 217fi
228 218
229# Declarative dependencies 219# Declarative dependencies
230qtdeclarativedepend=" 220qtdeclarativedepend="
231 >=x11-libs/qt-declarative-${QT_MINIMAL}:4 221 >=x11-libs/qt-declarative-${QT_MINIMAL}:4
367 *) ;; 357 *) ;;
368 esac 358 esac
369 fi 359 fi
370 fi 360 fi
371fi 361fi
362
372kdedepend=" 363kdedepend="
373 dev-util/automoc 364 dev-util/automoc
374 dev-util/pkgconfig 365 dev-util/pkgconfig
375 !aqua? ( 366 !aqua? (
376 || ( >=x11-libs/libXtst-1.1.0 <x11-proto/xextproto-7.1.0 ) 367 >=x11-libs/libXtst-1.1.0
377 x11-proto/xf86vidmodeproto 368 x11-proto/xf86vidmodeproto
378 ) 369 )
379" 370"
371
380kderdepend="" 372kderdepend=""
373
374# all packages needs oxygen icons for basic iconset
375if [[ ${PN} != oxygen-icons ]]; then
376 kderdepend+=" $(add_kdebase_dep oxygen-icons)"
377fi
378
379# add a dependency over kde-l10n if EAPI4 is around
380if [[ ${KDEBASE} != "kde-base" ]] && [[ -n ${KDE_LINGUAS} ]] && has "${EAPI:-0}" 4; then
381 for _lingua in ${KDE_LINGUAS}; do
382 # if our package has lignuas, pull in kde-l10n with selected lingua enabled,
383 # but only for selected ones.
384 # this can't be done on one line because if user doesn't use any localisation
385 # then he is probably not interested in kde-l10n at all.
386 kderdepend+="
387 linguas_${_lingua}? ( $(add_kdebase_dep kde-l10n linguas_${_lingua}(+)?) )
388 "
389 done
390 unset _lingua
391fi
381 392
382kdehandbookdepend=" 393kdehandbookdepend="
383 app-text/docbook-xml-dtd:4.2 394 app-text/docbook-xml-dtd:4.2
384 app-text/docbook-xsl-stylesheets 395 app-text/docbook-xsl-stylesheets
385" 396"
425# Accumulate dependencies set by this eclass 436# Accumulate dependencies set by this eclass
426DEPEND+=" ${COMMONDEPEND}" 437DEPEND+=" ${COMMONDEPEND}"
427RDEPEND+=" ${COMMONDEPEND}" 438RDEPEND+=" ${COMMONDEPEND}"
428unset COMMONDEPEND 439unset COMMONDEPEND
429 440
430# Add experimental kdeenablefinal, disabled by default 441# Add experimental kdeenablefinal, masked by default
431IUSE+=" kdeenablefinal" 442IUSE+=" kdeenablefinal"
432 443
433# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a 444# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a
434# koffice ebuild, the URI should be set in the ebuild itself 445# koffice ebuild, the URI should be set in the ebuild itself
435case ${BUILD_TYPE} in 446_calculate_src_uri() {
436 live) 447 debug-print-function ${FUNCNAME} "$@"
448
449 local _kmname _kmname_pv
450
451 # we calculate URI only for known KDEBASE modules
452 [[ -n ${KDEBASE} ]] || return
453
454 # calculate tarball module name
455 if [[ -n ${KMNAME} ]]; then
456 # fixup kdebase-apps name
457 case ${KMNAME} in
458 kdebase-apps)
459 _kmname="kdebase" ;;
460 *)
461 _kmname="${KMNAME}" ;;
462 esac
463 else
464 _kmname=${PN}
465 fi
466 _kmname_pv="${_kmname}-${PV}"
467 case ${KDEBASE} in
468 kde-base)
469 case ${PV} in
470 4.[456].8[05] | 4.[456].9[023568] | 4.5.94.1)
471 # Unstable KDE SC releases
472 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2"
473 # KDEPIM IS SPECIAL
474 [[ ${KMNAME} == "kdepim" || ${KMNAME} == "kdepim-runtime" ]] && SRC_URI="mirror://kde/unstable/kdepim/${PV}/src/${_kmname_pv}.tar.bz2"
475 ;;
476 4.4.[6789] | 4.4.1?*)
477 # Stable kdepim releases
478 SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2"
479 ;;
480 *)
481 # Stable KDE SC releases
482 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2"
483 ;;
484 esac
485 ;;
486 koffice)
487 case ${PV} in
488 2.[1234].[6-9]*) SRC_URI="mirror://kde/unstable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
489 *) SRC_URI="mirror://kde/stable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
490 esac
491 ;;
492 kdevelop)
493 SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2"
494 ;;
495 esac
496}
497
498_calculate_live_repo() {
499 debug-print-function ${FUNCNAME} "$@"
500
437 SRC_URI="" 501 SRC_URI=""
438 if has subversion ${INHERITED}; then 502 case ${KDE_SCM} in
503 svn)
439 # Determine branch URL based on live type 504 # Determine branch URL based on live type
440 local branch_prefix 505 local branch_prefix
441 case ${PV} in 506 case ${PV} in
442 9999*) 507 9999*)
443 # trunk 508 # trunk
504 # @DESCRIPTION: 569 # @DESCRIPTION:
505 # This variable is used for specifying the timeout between svn synces 570 # This variable is used for specifying the timeout between svn synces
506 # for kde-base and koffice modules. Does not affect misc apps. 571 # for kde-base and koffice modules. Does not affect misc apps.
507 # Default value is 1 hour. 572 # Default value is 1 hour.
508 [[ ${KDEBASE} = kde-base || ${KDEBASE} = koffice ]] && ESVN_UP_FREQ=${ESVN_UP_FREQ:-1} 573 [[ ${KDEBASE} = kde-base || ${KDEBASE} = koffice ]] && ESVN_UP_FREQ=${ESVN_UP_FREQ:-1}
509 elif has git ${INHERITED}; then
510 if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then
511 KMMODULE="${PN}"
512 fi
513 case ${KDEBASE} in
514 kdevelop)
515 EGIT_REPO_URI="git://git.kde.org/${KMMODULE}"
516 ;;
517 esac
518 fi
519 ;; 574 ;;
520 *) 575 git)
576 local _kmname
577 # @ECLASS-VARIABLE: EGIT_MIRROR
578 # @DESCRIPTION:
579 # This variable allows easy overriding of default kde mirror service
580 # (anongit) with anything else you might want to use.
581 EGIT_MIRROR=${EGIT_MIRROR:=git://anongit.kde.org}
582
583 # @ECLASS-VARIABLE: EGIT_REPONAME
584 # @DESCRIPTION:
585 # This variable allows overriding of default repository
586 # name. Specify only if this differ from PN and KMNAME.
521 if [[ -n ${KDEBASE} ]]; then 587 if [[ -n ${EGIT_REPONAME} ]]; then
588 # the repository and kmname different
589 _kmname=${EGIT_REPONAME}
522 if [[ -n ${KMNAME} ]]; then 590 elif [[ -n ${KMNAME} ]]; then
523 case ${KMNAME} in
524 kdebase-apps)
525 _kmname="kdebase" ;;
526 *)
527 _kmname="${KMNAME}" ;; 591 _kmname=${KMNAME}
528 esac
529 else 592 else
530 _kmname=${PN} 593 _kmname=${PN}
531 fi 594 fi
532 _kmname_pv="${_kmname}-${PV}" 595
596 # default branching
533 case ${KDEBASE} in 597 case ${PV} in
534 kde-base) 598 9999*) ;;
599 *)
600 # set EGIT_BRANCH and EGIT_COMMIT to ${SLOT}
601 case ${_kmname} in
602 kdeplasma-addons | kdepim | kdepim-runtime | kdepimlibs)
603 EGIT_BRANCH="${SLOT}"
604 ;;
605 *) EGIT_BRANCH="KDE/${SLOT}" ;;
606 esac
607 ;;
608 esac
609
610 case $_kmname in
611 kdepim|kdepim-runtime)
535 case ${PV} in 612 case ${PV} in
536 4.[456].8[05] | 4.[456].9[023568]) 613 # kdepim still did not branch
537 # Unstable KDE SC releases 614 4.6.9999)
538 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" 615 EGIT_BRANCH="master"
539 ;;
540 4.4.6 | 4.4.7 | 4.4.8)
541 # Only kdepim here
542 SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2"
543 ;;
544 *)
545 # Stable KDE SC releases
546 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2"
547 ;; 616 ;;
548 esac 617 esac
549 ;; 618 ;;
550 koffice)
551 case ${PV} in
552 2.1.[6-9]*) SRC_URI="mirror://kde/unstable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
553 *) SRC_URI="mirror://kde/stable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
554 esac
555 ;;
556 kdevelop)
557 SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2"
558 ;;
559 esac 619 esac
560 unset _kmname _kmname_pv 620 EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}"
561 fi 621 EGIT_PROJECT="${_kmname}"
622
623 debug-print "${FUNCNAME}: Repository: ${EGIT_REPO_URI}"
624 debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}"
562 ;; 625 ;;
626 esac
627}
628
629case ${BUILD_TYPE} in
630 live) _calculate_live_repo ;;
631 *) _calculate_src_uri ;;
563esac 632esac
564 633
565debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}" 634debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
566 635
567# @ECLASS-VARIABLE: PREFIX 636# @ECLASS-VARIABLE: PREFIX
574# @DESCRIPTION: 643# @DESCRIPTION:
575# Do the basic kdeprefix KDEDIR settings and determine with which kde should 644# Do the basic kdeprefix KDEDIR settings and determine with which kde should
576# optional applications link 645# optional applications link
577kde4-base_pkg_setup() { 646kde4-base_pkg_setup() {
578 debug-print-function ${FUNCNAME} "$@" 647 debug-print-function ${FUNCNAME} "$@"
579
580 # Prefix compat:
581 if [[ ${EAPI} == 2 ]] && ! use prefix; then
582 EPREFIX=
583 EROOT=${ROOT}
584 fi
585
586 # Append missing trailing slash character
587 [[ ${EROOT} = */ ]] || EROOT+="/"
588 648
589 # QA ebuilds 649 # QA ebuilds
590 [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})." 650 [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})."
591 651
592 # Don't set KDEHOME during compilation, it will cause access violations 652 # Don't set KDEHOME during compilation, it will cause access violations
641# This function unpacks the source tarballs for KDE4 applications. 701# This function unpacks the source tarballs for KDE4 applications.
642kde4-base_src_unpack() { 702kde4-base_src_unpack() {
643 debug-print-function ${FUNCNAME} "$@" 703 debug-print-function ${FUNCNAME} "$@"
644 704
645 if [[ ${BUILD_TYPE} = live ]]; then 705 if [[ ${BUILD_TYPE} = live ]]; then
646 if has subversion ${INHERITED}; then 706 case ${KDE_SCM} in
707 svn)
647 migrate_store_dir 708 migrate_store_dir
648 subversion_src_unpack 709 subversion_src_unpack
649 elif has git ${INHERITED}; then 710 ;;
711 git)
650 git_src_unpack 712 git_src_unpack
651 fi
652 elif [[ ${EAPI} == 2 ]]; then
653 local file
654 for file in ${A}; do
655 # This setup is because EAPI <= 2 cannot unpack *.tar.xz files
656 # directly, so we do it ourselves (using the exact same code as portage)
657 case ${file} in
658 *.tar.xz)
659 echo ">>> Unpacking ${file} to ${PWD}"
660 xz -dc "${DISTDIR}"/${file} | tar xof -
661 assert "failed unpacking ${file}"
662 ;; 713 ;;
663 *)
664 unpack ${file}
665 ;;
666 esac 714 esac
667 done
668 else 715 else
669 # For EAPI >= 3, we can just use unpack() directly
670 unpack ${A} 716 unpack ${A}
671 fi 717 fi
672} 718}
673 719
674# @FUNCTION: kde4-base_src_prepare 720# @FUNCTION: kde4-base_src_prepare
678# enable_selected_linguas() and enable_selected_doc_linguas() 724# enable_selected_linguas() and enable_selected_doc_linguas()
679# in kde4-functions.eclass(5) for further details. 725# in kde4-functions.eclass(5) for further details.
680kde4-base_src_prepare() { 726kde4-base_src_prepare() {
681 debug-print-function ${FUNCNAME} "$@" 727 debug-print-function ${FUNCNAME} "$@"
682 728
729 # enable handbook and linguas only when not using live ebuild
730
683 # Only enable selected languages, used for KDE extragear apps. 731 # Only enable selected languages, used for KDE extragear apps.
684 if [[ -n ${KDE_LINGUAS} ]]; then 732 if [[ -n ${KDE_LINGUAS} ]]; then
685 enable_selected_linguas 733 enable_selected_linguas
686 fi 734 fi
687 735
688 # Enable/disable handbooks for kde4-base packages 736 # Enable/disable handbooks for kde4-base packages
689 # kde-l10n inherits kde4-base but is metpackage, so no check for doc 737 # kde-l10n inherits kde4-base but is metpackage, so no check for doc
690 # kdelibs inherits kde4-base but handle installing the handbook itself 738 # kdelibs inherits kde4-base but handle installing the handbook itself
691 if ! has kde4-meta ${INHERITED}; then 739 if ! has kde4-meta ${INHERITED} && has handbook ${IUSE//+}; then
692 has handbook ${IUSE//+} && [[ ${PN} != kde-l10n ]] && [[ ${PN} != kdelibs ]] && enable_selected_doc_linguas 740 if [[ ${KDEBASE} == kde-base ]]; then
741 if [[ ${PN} != kde-l10n && ${PN} != kdepim-l10n && ${PN} != kdelibs ]] && use !handbook; then
742 # documentation in kde4-functions
743 : ${KDE_DOC_DIRS:=doc}
744 local dir
745 for dir in ${KDE_DOC_DIRS}; do
746 sed -e "/^[[:space:]]*add_subdirectory[[:space:]]*([[:space:]]*${dir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
747 -e "/^[[:space:]]*ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
748 -e "/^[[:space:]]*macro_optional_add_subdirectory[[:space:]]*([[:space:]]*${dir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
749 -e "/^[[:space:]]*MACRO_OPTIONAL_ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
750 -i CMakeLists.txt || die "failed to comment out handbook"
751 done
752 fi
753 else
754 enable_selected_doc_linguas
755 fi
693 fi 756 fi
694 757
695 # SCM bootstrap 758 # SCM bootstrap
696 if [[ ${BUILD_TYPE} = live ]]; then 759 if [[ ${BUILD_TYPE} = live ]]; then
697 if has subversion ${INHERITED}; then 760 case ${KDE_SCM} in
698 subversion_src_prepare 761 svn) subversion_src_prepare ;;
699 elif has git ${INHERITED}; then 762 esac
700 git_src_prepare
701 fi
702 fi 763 fi
703 764
704 # Apply patches 765 # Apply patches
705 base_src_prepare 766 base_src_prepare
706 767
830 # Override this value, set in kde4-base_src_configure() 891 # Override this value, set in kde4-base_src_configure()
831 mycmakeargs+=(-DKDE4_BUILD_TESTS=ON) 892 mycmakeargs+=(-DKDE4_BUILD_TESTS=ON)
832 cmake-utils_src_configure 893 cmake-utils_src_configure
833 kde4-base_src_compile 894 kde4-base_src_compile
834 895
835 if [[ ${VIRTUALX_REQUIRED} == always ]] || 896 # When run as normal user during ebuild development with the ebuild command, the
836 ( [[ ${VIRTUALX_REQUIRED} != manual ]] && use test ); then 897 # kde tests tend to access the session DBUS. This however is not possible in a real
898 # emerge or on the tinderbox.
899 # > make sure it does not happen, so bad tests can be recognized and disabled
900 unset DBUS_SESSION_BUS_ADDRESS
837 901
838 if [[ ${maketype} ]]; then 902 if [[ ${VIRTUALX_REQUIRED} == always || ${VIRTUALX_REQUIRED} == test ]]; then
903 # check for sanity if anyone already redefined VIRTUALX_COMMAND from the default
904 if [[ ${VIRTUALX_COMMAND} != emake ]]; then
839 # surprise- we are already INSIDE virtualmake!!! 905 # surprise- we are already INSIDE virtualmake!!!
840 ewarn "QA Notice: This version of kde4-base.eclass includes the virtualx functionality." 906 debug-print "QA Notice: This version of kde4-base.eclass includes the virtualx functionality."
841 ewarn " You may NOT set maketype or call virtualmake from the ebuild. Applying workaround." 907 debug-print " You may NOT set VIRTUALX_COMMAND or call virtualmake from the ebuild."
908 debug-print " Setting VIRTUALX_REQUIRED is completely sufficient. See the"
909 debug-print " kde4-base.eclass docs for details... Applying workaround."
842 cmake-utils_src_test 910 cmake-utils_src_test
843 else 911 else
844 export maketype="cmake-utils_src_test" 912 VIRTUALX_COMMAND="cmake-utils_src_test" virtualmake
845 virtualmake
846 fi 913 fi
847 else 914 else
848 cmake-utils_src_test 915 cmake-utils_src_test
849 fi 916 fi
850} 917}
852# @FUNCTION: kde4-base_src_install 919# @FUNCTION: kde4-base_src_install
853# @DESCRIPTION: 920# @DESCRIPTION:
854# Function for installing KDE4 applications. 921# Function for installing KDE4 applications.
855kde4-base_src_install() { 922kde4-base_src_install() {
856 debug-print-function ${FUNCNAME} "$@" 923 debug-print-function ${FUNCNAME} "$@"
857
858 # Prefix support, for usage in ebuilds
859 if [[ ${EAPI} == 2 ]] && ! use prefix; then
860 ED=${D}
861 fi
862 924
863 if [[ -n ${KMSAVELIBS} ]] ; then 925 if [[ -n ${KMSAVELIBS} ]] ; then
864 install_library_dependencies 926 install_library_dependencies
865 fi 927 fi
866 928
867 # Install common documentation of KDE4 applications 929 # Install common documentation of KDE4 applications
868 local doc 930 local doc
869 if ! has kde4-meta ${INHERITED}; then 931 if ! has kde4-meta ${INHERITED}; then
870 for doc in "${S}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do 932 for doc in "${S}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
871 [[ -f "${doc}" ]] && [[ -s "${doc}" ]] && dodoc "${doc}" 933 [[ -f ${doc} && -s ${doc} ]] && dodoc "${doc}"
872 done 934 done
873 for doc in "${S}"/*/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do 935 for doc in "${S}"/*/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
874 [[ -f "${doc}" ]] && [[ -s "${doc}" ]] && newdoc "${doc}" "$(basename $(dirname ${doc})).$(basename ${doc})" 936 [[ -f ${doc} && -s ${doc} ]] && newdoc "${doc}" "$(basename $(dirname ${doc})).$(basename ${doc})"
875 done 937 done
876 fi 938 fi
877 939
878 cmake-utils_src_install 940 cmake-utils_src_install
941}
942
943# @FUNCTION: kde4-base_pkg_preinst
944# @DESCRIPTION:
945# Function storing icon caches
946kde4-base_pkg_preinst() {
947 debug-print-function ${FUNCNAME} "$@"
948
949 gnome2_icon_savelist
879} 950}
880 951
881# @FUNCTION: kde4-base_pkg_postinst 952# @FUNCTION: kde4-base_pkg_postinst
882# @DESCRIPTION: 953# @DESCRIPTION:
883# Function to rebuild the KDE System Configuration Cache after an application has been installed. 954# Function to rebuild the KDE System Configuration Cache after an application has been installed.
884kde4-base_pkg_postinst() { 955kde4-base_pkg_postinst() {
885 debug-print-function ${FUNCNAME} "$@" 956 debug-print-function ${FUNCNAME} "$@"
886 957
958 gnome2_icon_cache_update
959 fdo-mime_desktop_database_update
960 fdo-mime_mime_database_update
887 buildsycoca 961 buildsycoca
888 962
889 if [[ ${BUILD_TYPE} = live ]] && [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then 963 if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
890 echo 964 if has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then
891 einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}"
892 einfo "Use it at your own risk."
893 einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
894 echo
895 elif [[ ${BUILD_TYPE} != live ]] && [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]] && has kdeprefix ${IUSE//+} && use kdeprefix; then
896 # warning about kdeprefix for non-live users
897 echo
898 ewarn "WARNING! You have the kdeprefix useflag enabled."
899 ewarn "This setting is strongly discouraged and might lead to potential trouble"
900 ewarn "with KDE update strategies."
901 ewarn "You are using this setup at your own risk and the kde team does not"
902 ewarn "take responsibilities for dead kittens."
903 echo
904 fi
905 if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]] && ! has_version 'kde-base/kdebase-runtime-meta' && ! has_version 'kde-base/kdebase-startkde'; then
906 # warn about not supported approach
907 if [[ ${KDE_REQUIRED} == always ]] || ( [[ ${KDE_REQUIRED} == optional ]] && use kde ); then
908 echo 965 echo
966 ewarn "WARNING! you have kdeenable final useflag enabled."
967 ewarn "This useflag needs to be enabled on ALL kde using packages and"
968 ewarn "is known to cause issues."
969 ewarn "You are using this setup at your own risk and the kde team does not"
970 ewarn "take responsibilities for dead kittens."
971 echo
972 fi
973 if [[ ${BUILD_TYPE} = live ]]; then
974 echo
975 einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}"
976 einfo "Use it at your own risk."
977 einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
978 echo
979 elif [[ ${BUILD_TYPE} != live ]] && has kdeprefix ${IUSE//+} && use kdeprefix; then
980 # warning about kdeprefix for non-live users
981 echo
982 ewarn "WARNING! You have the kdeprefix useflag enabled."
983 ewarn "This setting is strongly discouraged and might lead to potential trouble"
984 ewarn "with KDE update strategies."
985 ewarn "You are using this setup at your own risk and the kde team does not"
986 ewarn "take responsibilities for dead kittens."
987 echo
988 fi
989 # for all 3rd party soft tell user that he SHOULD install kdebase-startkde or kdebase-runtime-meta
990 if [[ ${KDEBASE} != kde-base ]] && \
991 ! has_version 'kde-base/kdebase-runtime-meta' && \
992 ! has_version 'kde-base/kdebase-startkde'; then
993 if [[ ${KDE_REQUIRED} == always ]] || ( [[ ${KDE_REQUIRED} == optional ]] && use kde ); then
994 echo
909 ewarn "WARNING! Your system configuration contains neither \"kde-base/kdebase-runtime-meta\"" 995 ewarn "WARNING! Your system configuration contains neither \"kde-base/kdebase-runtime-meta\""
910 ewarn "nor \"kde-base/kdebase-startkde\". You need one of above." 996 ewarn "nor \"kde-base/kdebase-startkde\". You need one of above."
911 ewarn "With this setting you are unsupported by KDE team." 997 ewarn "With this setting you are unsupported by KDE team."
912 ewarn "All missing features you report for misc packages will be probably ignored or closed as INVALID." 998 ewarn "All missing features you report for misc packages will be probably ignored or closed as INVALID."
999 fi
913 fi 1000 fi
914 fi 1001 fi
915} 1002}
916 1003
917# @FUNCTION: kde4-base_pkg_postrm 1004# @FUNCTION: kde4-base_pkg_postrm
918# @DESCRIPTION: 1005# @DESCRIPTION:
919# Function to rebuild the KDE System Configuration Cache after an application has been removed. 1006# Function to rebuild the KDE System Configuration Cache after an application has been removed.
920kde4-base_pkg_postrm() { 1007kde4-base_pkg_postrm() {
921 debug-print-function ${FUNCNAME} "$@" 1008 debug-print-function ${FUNCNAME} "$@"
922 1009
1010 gnome2_icon_cache_update
1011 fdo-mime_desktop_database_update
1012 fdo-mime_mime_database_update
923 buildsycoca 1013 buildsycoca
924} 1014}

Legend:
Removed from v.1.79  
changed lines
  Added in v.1.89

  ViewVC Help
Powered by ViewVC 1.1.20