/[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.119 Revision 1.122
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 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.119 2012/06/22 09:19:46 kensington Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.122 2013/02/02 16:58:00 dilfridge 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
31# for tests you should proceed with setting VIRTUALX_REQUIRED=test. 31# for tests you should proceed with setting VIRTUALX_REQUIRED=test.
32: ${VIRTUALX_REQUIRED:=manual} 32: ${VIRTUALX_REQUIRED:=manual}
33 33
34inherit kde4-functions toolchain-funcs fdo-mime flag-o-matic gnome2-utils base virtualx versionator eutils multilib 34inherit kde4-functions toolchain-funcs fdo-mime flag-o-matic gnome2-utils base virtualx versionator eutils multilib
35 35
36if [[ ${BUILD_TYPE} = live ]]; then 36if [[ ${KDE_BUILD_TYPE} = live ]]; then
37 case ${KDE_SCM} in 37 case ${KDE_SCM} in
38 svn) inherit subversion ;; 38 svn) inherit subversion ;;
39 git) inherit git-2 ;; 39 git) inherit git-2 ;;
40 esac 40 esac
41fi 41fi
64case ${KDEBASE} in 64case ${KDEBASE} in
65 kde-base) 65 kde-base)
66 SLOT=4 66 SLOT=4
67 KDE_MINIMAL="${PV}" 67 KDE_MINIMAL="${PV}"
68 ;; 68 ;;
69 koffice)
70 SLOT="2"
71 ;;
72 kdevelop) 69 kdevelop)
73 if [[ ${BUILD_TYPE} = live ]]; then 70 if [[ ${KDE_BUILD_TYPE} = live ]]; then
74 # @ECLASS-VARIABLE: KDEVELOP_VERSION 71 # @ECLASS-VARIABLE: KDEVELOP_VERSION
75 # @DESCRIPTION: 72 # @DESCRIPTION:
76 # Specifies KDevelop version. Default is 4.0.0 for tagged packages and 9999 for live packages. 73 # Specifies KDevelop version. Default is 4.0.0 for tagged packages and 9999 for live packages.
77 # Applies to KDEBASE=kdevelop only. 74 # Applies to KDEBASE=kdevelop only.
78 KDEVELOP_VERSION="${KDEVELOP_VERSION:-9999}" 75 KDEVELOP_VERSION="${KDEVELOP_VERSION:-9999}"
157# @ECLASS-VARIABLE: KDE_LINGUAS_LIVE_OVERRIDE 154# @ECLASS-VARIABLE: KDE_LINGUAS_LIVE_OVERRIDE
158# @DESCRIPTION: 155# @DESCRIPTION:
159# Set this varible if you want your live package to manage its 156# Set this varible if you want your live package to manage its
160# translations. (Mostly all kde ebuilds does not ship documentation 157# translations. (Mostly all kde ebuilds does not ship documentation
161# and translations in live ebuilds) 158# and translations in live ebuilds)
162if [[ ${BUILD_TYPE} == live && -z ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then 159if [[ ${KDE_BUILD_TYPE} == live && -z ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
163 # Kdebase actualy provides the handbooks even for live stuff 160 # Kdebase actualy provides the handbooks even for live stuff
164 [[ ${KDEBASE} == kde-base ]] || KDE_HANDBOOK=never 161 [[ ${KDEBASE} == kde-base ]] || KDE_HANDBOOK=never
165 KDE_LINGUAS="" 162 KDE_LINGUAS=""
166fi 163fi
167 164
168# Setup packages inheriting this eclass 165# Setup packages inheriting this eclass
169case ${KDEBASE} in 166case ${KDEBASE} in
170 kde-base) 167 kde-base)
171 HOMEPAGE="http://www.kde.org/" 168 HOMEPAGE="http://www.kde.org/"
172 LICENSE="GPL-2" 169 LICENSE="GPL-2"
173 if [[ ${BUILD_TYPE} = live && -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then 170 if [[ ${KDE_BUILD_TYPE} = live && -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
174 # Disable tests for live ebuilds by default 171 # Disable tests for live ebuilds by default
175 RESTRICT+=" test" 172 RESTRICT+=" test"
176 fi
177
178 # Only add the kdeprefix USE flag for older versions, to help
179 # non-portage package managers handle the upgrade
180 if [[ ${PV} < 4.6.4 && ( ( ${KMNAME} != kdepim && ${PN} != kdepim-runtime ) || ${PV} < 4.6 ) ]]; then
181 IUSE+=" kdeprefix"
182 fi 173 fi
183 174
184 # This code is to prevent portage from searching GENTOO_MIRRORS for 175 # This code is to prevent portage from searching GENTOO_MIRRORS for
185 # packages that will never be mirrored. (As they only will ever be in 176 # packages that will never be mirrored. (As they only will ever be in
186 # the overlay). 177 # the overlay).
188 *9999* | 4.?.[6-9]?) 179 *9999* | 4.?.[6-9]?)
189 RESTRICT+=" mirror" 180 RESTRICT+=" mirror"
190 ;; 181 ;;
191 esac 182 esac
192 ;; 183 ;;
193 koffice)
194 HOMEPAGE="http://www.koffice.org/"
195 LICENSE="GPL-2"
196 ;;
197 kdevelop) 184 kdevelop)
198 HOMEPAGE="http://www.kdevelop.org/" 185 HOMEPAGE="http://www.kdevelop.org/"
199 LICENSE="GPL-2" 186 LICENSE="GPL-2"
200 ;; 187 ;;
201esac 188esac
204# @DESCRIPTION: 191# @DESCRIPTION:
205# Determine version of qt we enforce as minimal for the package. 192# Determine version of qt we enforce as minimal for the package.
206if version_is_at_least 4.8.50 "${KDE_MINIMAL}"; then 193if version_is_at_least 4.8.50 "${KDE_MINIMAL}"; then
207 # Upstream has added an *undeclared* dependency on Qt 4.8... 194 # Upstream has added an *undeclared* dependency on Qt 4.8...
208 QT_MINIMAL="${QT_MINIMAL:-4.8.0}" 195 QT_MINIMAL="${QT_MINIMAL:-4.8.0}"
209elif version_is_at_least 4.7.80 "${KDE_MINIMAL}"; then 196else
210 QT_MINIMAL="${QT_MINIMAL:-4.7.4}" 197 QT_MINIMAL="${QT_MINIMAL:-4.7.4}"
211else
212 QT_MINIMAL="${QT_MINIMAL:-4.7.0}"
213fi 198fi
214 199
215# Declarative dependencies 200# Declarative dependencies
216qtdeclarativedepend=" 201qtdeclarativedepend="
217 >=x11-libs/qt-declarative-${QT_MINIMAL}:4 202 >=x11-libs/qt-declarative-${QT_MINIMAL}:4
419DEPEND+=" ${COMMONDEPEND}" 404DEPEND+=" ${COMMONDEPEND}"
420RDEPEND+=" ${COMMONDEPEND}" 405RDEPEND+=" ${COMMONDEPEND}"
421unset COMMONDEPEND 406unset COMMONDEPEND
422 407
423# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a 408# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a
424# koffice ebuild, the URI should be set in the ebuild itself 409# kdevelop ebuild, the URI should be set in the ebuild itself
425_calculate_src_uri() { 410_calculate_src_uri() {
426 debug-print-function ${FUNCNAME} "$@" 411 debug-print-function ${FUNCNAME} "$@"
427 412
428 local _kmname _kmname_pv 413 local _kmname _kmname_pv
429 414
448 case ${PV} in 433 case ${PV} in
449 4.4.11.1) 434 4.4.11.1)
450 # KDEPIM 4.4, special case 435 # KDEPIM 4.4, special case
451 # TODO: Remove this part when KDEPIM 4.4 gets out of the tree 436 # TODO: Remove this part when KDEPIM 4.4 gets out of the tree
452 SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2" ;; 437 SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2" ;;
453 4.[4567].8[05] | 4.[4567].9[0235678])
454 # Unstable KDE SC releases
455 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
456 4.8.[12345])
457 # Stable KDE SC releases with .xz support
458 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.xz" ;;
459 4.[89].8[05] | 4.[89].9[0235678]) 438 4.[89].8[05] | 4.[89].9[0235678])
460 # Unstable KDE SC releases 439 # Unstable KDE SC releases
461 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.xz" ;; 440 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.xz" ;;
441 4.[1234567].[12345])
442 # Stable KDE SC with old .bz2 support
443 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
462 *) 444 *)
463 # Stable KDE SC releases 445 # Stable KDE SC releases
464 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 446 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.xz" ;;
465 esac
466 ;;
467 koffice)
468 case ${PV} in
469 2.[1234].[6-9]*) SRC_URI="mirror://kde/unstable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
470 *) SRC_URI="mirror://kde/stable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
471 esac 447 esac
472 ;; 448 ;;
473 kdevelop|kdevelop-php*|kdevplatform) 449 kdevelop|kdevelop-php*|kdevplatform)
474 case ${KDEVELOP_VERSION} in 450 case ${KDEVELOP_VERSION} in
475 4.[12].[6-9]*) SRC_URI="mirror://kde/unstable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2" ;; 451 4.[12].[6-9]*) SRC_URI="mirror://kde/unstable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2" ;;
535 # Unpack them in toplevel dir, so that they won't conflict with kde4-meta 511 # Unpack them in toplevel dir, so that they won't conflict with kde4-meta
536 # build packages from same svn location. 512 # build packages from same svn location.
537 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}" 513 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
538 ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}" 514 ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}"
539 ;; 515 ;;
540 koffice)
541 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
542 ;;
543 *) 516 *)
544 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}" 517 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
545 ;; 518 ;;
546 esac 519 esac
547 else 520 else
550 ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}" 523 ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}"
551 fi 524 fi
552 # @ECLASS-VARIABLE: ESVN_UP_FREQ 525 # @ECLASS-VARIABLE: ESVN_UP_FREQ
553 # @DESCRIPTION: 526 # @DESCRIPTION:
554 # This variable is used for specifying the timeout between svn synces 527 # This variable is used for specifying the timeout between svn synces
555 # for kde-base and koffice modules. Does not affect misc apps. 528 # for kde-base modules. Does not affect misc apps.
556 # Default value is 1 hour. 529 # Default value is 1 hour.
557 [[ ${KDEBASE} = kde-base || ${KDEBASE} = koffice ]] && ESVN_UP_FREQ=${ESVN_UP_FREQ:-1} 530 [[ ${KDEBASE} = kde-base ]] && ESVN_UP_FREQ=${ESVN_UP_FREQ:-1}
558 ;; 531 ;;
559 git) 532 git)
560 local _kmname 533 local _kmname
561 # @ECLASS-VARIABLE: EGIT_MIRROR 534 # @ECLASS-VARIABLE: EGIT_MIRROR
562 # @DESCRIPTION: 535 # @DESCRIPTION:
588 debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}" 561 debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}"
589 ;; 562 ;;
590 esac 563 esac
591} 564}
592 565
593case ${BUILD_TYPE} in 566case ${KDE_BUILD_TYPE} in
594 live) _calculate_live_repo ;; 567 live) _calculate_live_repo ;;
595 *) _calculate_src_uri ;; 568 *) _calculate_src_uri ;;
596esac 569esac
597 570
598debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}" 571debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
610 debug-print-function ${FUNCNAME} "$@" 583 debug-print-function ${FUNCNAME} "$@"
611 584
612 if has handbook ${IUSE} || has "+handbook" ${IUSE} && [ "${KDE_HANDBOOK}" != optional ] ; then 585 if has handbook ${IUSE} || has "+handbook" ${IUSE} && [ "${KDE_HANDBOOK}" != optional ] ; then
613 eqawarn "Handbook support is enabled via KDE_HANDBOOK=optional in the ebuild." 586 eqawarn "Handbook support is enabled via KDE_HANDBOOK=optional in the ebuild."
614 eqawarn "Please do not just set IUSE=handbook, as this leads to dependency errors." 587 eqawarn "Please do not just set IUSE=handbook, as this leads to dependency errors."
615 fi
616
617 if use_if_iuse kdeprefix; then
618 eerror "Sorry, kdeprefix support has been removed."
619 eerror "Please remove kdeprefix from your USE variable."
620 die "kdeprefix support has been removed"
621 fi
622
623 if [[ ${CATEGORY}/${PN} != kde-base/kdelibs && ${CATEGORY}/${PN} != kde-base/kde-env ]] && \
624 { [[ ${KDE_REQUIRED} == always ]] || { [[ ${KDE_REQUIRED} == optional ]] && use kde; }; } && \
625 has_version kde-base/kdelibs[kdeprefix]; then
626 eerror "Sorry, kdeprefix support has been removed."
627 eerror "Please rebuild kdelibs without kdeprefix support."
628 die "kdeprefix support has been removed"
629 fi 588 fi
630 589
631 # Don't set KDEHOME during compilation, it will cause access violations 590 # Don't set KDEHOME during compilation, it will cause access violations
632 unset KDEHOME 591 unset KDEHOME
633 592
660# @DESCRIPTION: 619# @DESCRIPTION:
661# This function unpacks the source tarballs for KDE4 applications. 620# This function unpacks the source tarballs for KDE4 applications.
662kde4-base_src_unpack() { 621kde4-base_src_unpack() {
663 debug-print-function ${FUNCNAME} "$@" 622 debug-print-function ${FUNCNAME} "$@"
664 623
665 if [[ ${BUILD_TYPE} = live ]]; then 624 if [[ ${KDE_BUILD_TYPE} = live ]]; then
666 case ${KDE_SCM} in 625 case ${KDE_SCM} in
667 svn) 626 svn)
668 migrate_store_dir 627 migrate_store_dir
669 subversion_src_unpack 628 subversion_src_unpack
670 ;; 629 ;;
714 enable_selected_doc_linguas 673 enable_selected_doc_linguas
715 fi 674 fi
716 fi 675 fi
717 676
718 # SCM bootstrap 677 # SCM bootstrap
719 if [[ ${BUILD_TYPE} = live ]]; then 678 if [[ ${KDE_BUILD_TYPE} = live ]]; then
720 case ${KDE_SCM} in 679 case ${KDE_SCM} in
721 svn) subversion_src_prepare ;; 680 svn) subversion_src_prepare ;;
722 esac 681 esac
723 fi 682 fi
724 683
733 # Inject library dependencies 692 # Inject library dependencies
734 if [[ -n ${KMLOADLIBS} ]] ; then 693 if [[ -n ${KMLOADLIBS} ]] ; then
735 load_library_dependencies 694 load_library_dependencies
736 fi 695 fi
737 696
738 # Hack for manuals relying on outdated DTD, only outside kde-base/koffice/... 697 # Hack for manuals relying on outdated DTD, only outside kde-base/...
739 if [[ -z ${KDEBASE} ]]; then 698 if [[ -z ${KDEBASE} ]]; then
740 find "${S}" -name "*.docbook" \ 699 find "${S}" -name "*.docbook" \
741 -exec sed -i -r \ 700 -exec sed -i -r \
742 -e 's:-//KDE//DTD DocBook XML V4\.1(\..)?-Based Variant V1\.[01]//EN:-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN:g' {} + \ 701 -e 's:-//KDE//DTD DocBook XML V4\.1(\..)?-Based Variant V1\.[01]//EN:-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN:g' {} + \
743 || die 'failed to fix DocBook variant version' 702 || die 'failed to fix DocBook variant version'
753 # Build tests in src_test only, where we override this value 712 # Build tests in src_test only, where we override this value
754 local cmakeargs=(-DKDE4_BUILD_TESTS=OFF) 713 local cmakeargs=(-DKDE4_BUILD_TESTS=OFF)
755 714
756 if use_if_iuse debug; then 715 if use_if_iuse debug; then
757 # Set "real" debug mode 716 # Set "real" debug mode
758 CMAKE_BUILD_TYPE="Debugfull" 717 CMAKE_KDE_BUILD_TYPE="Debugfull"
759 else 718 else
760 # Handle common release builds 719 # Handle common release builds
761 append-cppflags -DQT_NO_DEBUG 720 append-cppflags -DQT_NO_DEBUG
762 fi 721 fi
763 722
890# Function storing icon caches 849# Function storing icon caches
891kde4-base_pkg_preinst() { 850kde4-base_pkg_preinst() {
892 debug-print-function ${FUNCNAME} "$@" 851 debug-print-function ${FUNCNAME} "$@"
893 852
894 gnome2_icon_savelist 853 gnome2_icon_savelist
895 if [[ ${BUILD_TYPE} == live && ${KDE_SCM} == svn ]]; then 854 if [[ ${KDE_BUILD_TYPE} == live && ${KDE_SCM} == svn ]]; then
896 subversion_pkg_preinst 855 subversion_pkg_preinst
897 fi 856 fi
898} 857}
899 858
900# @FUNCTION: kde4-base_pkg_postinst 859# @FUNCTION: kde4-base_pkg_postinst
907 fdo-mime_desktop_database_update 866 fdo-mime_desktop_database_update
908 fdo-mime_mime_database_update 867 fdo-mime_mime_database_update
909 buildsycoca 868 buildsycoca
910 869
911 if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then 870 if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
912 if [[ ${BUILD_TYPE} = live ]]; then 871 if [[ ${KDE_BUILD_TYPE} = live ]]; then
913 echo 872 echo
914 einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}" 873 einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}"
915 einfo "Use it at your own risk." 874 einfo "Use it at your own risk."
916 einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!" 875 einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
917 echo 876 echo

Legend:
Removed from v.1.119  
changed lines
  Added in v.1.122

  ViewVC Help
Powered by ViewVC 1.1.20