commit: 608516d7a209419b4e7204247f242e38ac318003 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> AuthorDate: Wed Nov 8 22:32:35 2017 +0000 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> CommitDate: Thu Nov 9 19:14:15 2017 +0000 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=608516d7
eclass: Drop unused kde4-{base,functions}.eclass eclass/kde4-base.eclass | 1014 ------------------------------------------ eclass/kde4-functions.eclass | 429 ------------------ 2 files changed, 1443 deletions(-) diff --git a/eclass/kde4-base.eclass b/eclass/kde4-base.eclass deleted file mode 100644 index 0c7b4c11bb..0000000000 --- a/eclass/kde4-base.eclass +++ /dev/null @@ -1,1014 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: kde4-base.eclass -# @MAINTAINER: -# k...@gentoo.org -# @BLURB: This eclass provides functions for kde 4.X ebuilds -# @DESCRIPTION: -# The kde4-base.eclass provides support for building KDE4 based ebuilds -# and KDE4 applications. -# -# NOTE: KDE 4 ebuilds currently support EAPI 5. This will be -# reviewed over time as new EAPI versions are approved. - -if [[ -z ${_KDE4_BASE_ECLASS} ]]; then -_KDE4_BASE_ECLASS=1 - -# @ECLASS-VARIABLE: KDE_SELINUX_MODULE -# @DESCRIPTION: -# If set to "none", do nothing. -# For any other value, add selinux to IUSE, and depending on that useflag -# add a dependency on sec-policy/selinux-${KDE_SELINUX_MODULE} to (R)DEPEND -: ${KDE_SELINUX_MODULE:=none} - -# @ECLASS-VARIABLE: VIRTUALDBUS_TEST -# @DESCRIPTION: -# If defined, launch and use a private dbus session during src_test. - -# @ECLASS-VARIABLE: VIRTUALX_REQUIRED -# @DESCRIPTION: -# For proper description see virtualx.eclass manpage. -# Here we redefine default value to be manual, if your package needs virtualx -# for tests you should proceed with setting VIRTUALX_REQUIRED=test. -: ${VIRTUALX_REQUIRED:=manual} - -inherit kde4-functions toolchain-funcs flag-o-matic gnome2-utils virtualx versionator eutils multilib xdg-utils - -if [[ ${KDE_BUILD_TYPE} = live ]]; then - case ${KDE_SCM} in - svn) inherit subversion ;; - git) inherit git-r3 ;; - esac -fi - -# @ECLASS-VARIABLE: CMAKE_REQUIRED -# @DESCRIPTION: -# Specify if cmake buildsystem is being used. Possible values are 'always' and 'never'. -# Please note that if it's set to 'never' you need to explicitly override following phases: -# src_configure, src_compile, src_test and src_install. -# Defaults to 'always'. -: ${CMAKE_REQUIRED:=always} -if [[ ${CMAKE_REQUIRED} = always ]]; then - buildsystem_eclass="cmake-utils" - export_fns="src_configure src_compile src_test src_install" -fi - -# @ECLASS-VARIABLE: KDE_MINIMAL -# @DESCRIPTION: -# This variable is used when KDE_REQUIRED is set, to specify required KDE minimal -# version for apps to work. Currently defaults to 4.4 -# One may override this variable to raise version requirements. -# Note that it is fixed to ${PV} for kde-base packages. -KDE_MINIMAL="${KDE_MINIMAL:-4.4}" - -# Set slot for KDEBASE known packages -case ${KDEBASE} in - kde-base) - SLOT=4/$(get_version_component_range 1-2) - KDE_MINIMAL="${PV}" - ;; - kdevelop) - if [[ ${KDE_BUILD_TYPE} = live ]]; then - # @ECLASS-VARIABLE: KDEVELOP_VERSION - # @DESCRIPTION: - # Specifies KDevelop version. Default is 4.0.0 for tagged packages and 9999 for live packages. - # Applies to KDEBASE=kdevelop only. - KDEVELOP_VERSION="${KDEVELOP_VERSION:-4.9999}" - # @ECLASS-VARIABLE: KDEVPLATFORM_VERSION - # @DESCRIPTION: - # Specifies KDevplatform version. Default is 1.0.0 for tagged packages and 9999 for live packages. - # Applies to KDEBASE=kdevelop only. - KDEVPLATFORM_VERSION="${KDEVPLATFORM_VERSION:-4.9999}" - else - case ${PN} in - kdevelop) - KDEVELOP_VERSION=${PV} - KDEVPLATFORM_VERSION="$(($(get_major_version)-3)).$(get_after_major_version)" - ;; - kdevplatform|kdevelop-php*|kdevelop-python) - KDEVELOP_VERSION="$(($(get_major_version)+3)).$(get_after_major_version)" - KDEVPLATFORM_VERSION=${PV} - ;; - *) - KDEVELOP_VERSION="${KDEVELOP_VERSION:-4.0.0}" - KDEVPLATFORM_VERSION="${KDEVPLATFORM_VERSION:-1.0.0}" - esac - fi - SLOT="4" - ;; -esac - -inherit ${buildsystem_eclass} - -EXPORT_FUNCTIONS pkg_setup pkg_nofetch src_unpack src_prepare ${export_fns} pkg_preinst pkg_postinst pkg_postrm - -unset buildsystem_eclass -unset export_fns - -# @ECLASS-VARIABLE: DECLARATIVE_REQUIRED -# @DESCRIPTION: -# Is qtdeclarative required? Possible values are 'always', 'optional' and 'never'. -# This variable must be set before inheriting any eclasses. Defaults to 'never'. -DECLARATIVE_REQUIRED="${DECLARATIVE_REQUIRED:-never}" - -# @ECLASS-VARIABLE: QT3SUPPORT_REQUIRED -# @DESCRIPTION: -# Is qt3support required? Possible values are 'true' or 'false'. -# This variable must be set before inheriting any eclasses. Defaults to 'false'. -QT3SUPPORT_REQUIRED="${QT3SUPPORT_REQUIRED:-false}" - -# @ECLASS-VARIABLE: QTHELP_REQUIRED -# @DESCRIPTION: -# Is qthelp required? Possible values are 'always', 'optional' and 'never'. -# This variable must be set before inheriting any eclasses. Defaults to 'never'. -QTHELP_REQUIRED="${QTHELP_REQUIRED:-never}" - -# @ECLASS-VARIABLE: OPENGL_REQUIRED -# @DESCRIPTION: -# Is qtopengl required? Possible values are 'always', 'optional' and 'never'. -# This variable must be set before inheriting any eclasses. Defaults to 'never'. -OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}" - -# @ECLASS-VARIABLE: MULTIMEDIA_REQUIRED -# @DESCRIPTION: -# Is qtmultimedia required? Possible values are 'always', 'optional' and 'never'. -# This variable must be set before inheriting any eclasses. Defaults to 'never'. -MULTIMEDIA_REQUIRED="${MULTIMEDIA_REQUIRED:-never}" - -# @ECLASS-VARIABLE: SQL_REQUIRED -# @DESCRIPTION: -# Is qtsql required? Possible values are 'always', 'optional' and 'never'. -# This variable must be set before inheriting any eclasses. Defaults to 'never'. -SQL_REQUIRED="${SQL_REQUIRED:-never}" - -# @ECLASS-VARIABLE: WEBKIT_REQUIRED -# @DESCRIPTION: -# Is qtwebkit required? Possible values are 'always', 'optional' and 'never'. -# This variable must be set before inheriting any eclasses. Defaults to 'never'. -WEBKIT_REQUIRED="${WEBKIT_REQUIRED:-never}" - -# @ECLASS-VARIABLE: CPPUNIT_REQUIRED -# @DESCRIPTION: -# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'. -# This variable must be set before inheriting any eclasses. Defaults to 'never'. -CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}" - -# @ECLASS-VARIABLE: KDE_REQUIRED -# @DESCRIPTION: -# Is kde required? Possible values are 'always', 'optional' and 'never'. -# This variable must be set before inheriting any eclasses. Defaults to 'always' -# If set to 'always' or 'optional', KDE_MINIMAL may be overriden as well. -# Note that for kde-base packages this variable is fixed to 'always'. -KDE_REQUIRED="${KDE_REQUIRED:-always}" - -# @ECLASS-VARIABLE: KDE_HANDBOOK -# @DESCRIPTION: -# Set to enable handbook in application. Possible values are 'always', 'optional' -# (handbook USE flag) and 'never'. -# This variable must be set before inheriting any eclasses. Defaults to 'never'. -# It adds default handbook dirs for kde-base packages to KMEXTRA and in any case it -# ensures buildtime and runtime dependencies. -KDE_HANDBOOK="${KDE_HANDBOOK:-never}" - -# @ECLASS-VARIABLE: KDE_LINGUAS_LIVE_OVERRIDE -# @DESCRIPTION: -# Set this varible if you want your live package to manage its -# translations. (Mostly all kde ebuilds does not ship documentation -# and translations in live ebuilds) -if [[ ${KDE_BUILD_TYPE} == live && -z ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then - # Kdebase actually provides the handbooks even for live stuff - [[ ${KDEBASE} == kde-base ]] || KDE_HANDBOOK=never - KDE_LINGUAS="" -fi - -# @ECLASS-VARIABLE: KDE_UNRELEASED -# @INTERNAL -# @DESCRIPTION -# An array of $CATEGORY-$PV pairs of packages that are unreleased upstream. -# Any package matching this will have fetch restriction enabled, and receive -# a proper error message via pkg_nofetch. -KDE_UNRELEASED=( ) - -# Setup packages inheriting this eclass -case ${KDEBASE} in - kde-base) - HOMEPAGE="https://www.kde.org/" - LICENSE="GPL-2" - if [[ ${KDE_BUILD_TYPE} = live && -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then - # Disable tests for live ebuilds by default - RESTRICT+=" test" - fi - - # This code is to prevent portage from searching GENTOO_MIRRORS for - # packages that will never be mirrored. (As they only will ever be in - # the overlay). - case ${PV} in - *9999* | 4.?.[6-9]? | 4.??.[6-9]? | ??.?.[6-9]? | ??.??.[6-9]?) - RESTRICT+=" mirror" - ;; - esac - ;; - kdevelop) - HOMEPAGE="https://www.kdevelop.org/" - LICENSE="GPL-2" - ;; -esac - -# @ECLASS-VARIABLE: QT_MINIMAL -# @DESCRIPTION: -# Determine version of qt we enforce as minimal for the package. -QT_MINIMAL="${QT_MINIMAL:-4.8.5}" - -# Declarative dependencies -qtdeclarativedepend=" - >=dev-qt/qtdeclarative-${QT_MINIMAL}:4 -" -case ${DECLARATIVE_REQUIRED} in - always) - COMMONDEPEND+=" ${qtdeclarativedepend}" - ;; - optional) - IUSE+=" declarative" - COMMONDEPEND+=" declarative? ( ${qtdeclarativedepend} )" - ;; - *) ;; -esac -unset qtdeclarativedepend - -# Qt3Support dependencies -qt3supportdepend=" - >=dev-qt/qt3support-${QT_MINIMAL}:4[accessibility] -" -case ${QT3SUPPORT_REQUIRED} in - true) - COMMONDEPEND+=" ${qt3supportdepend}" - [[ -n ${qtcoreuse} ]] && qtcoreuse+=",qt3support" || qtcoreuse="qt3support" - [[ -n ${qtsqluse} ]] && qtsqluse+=",qt3support" || qtsqluse="qt3support" - [[ -n ${kdelibsuse} ]] && kdelibsuse+=",qt3support(+)" || kdelibsuse="qt3support(+)" - ;; - *) ;; -esac -unset qt3supportdepend - -# QtHelp dependencies -qthelpdepend=" - >=dev-qt/qthelp-${QT_MINIMAL}:4 -" -case ${QTHELP_REQUIRED} in - always) - COMMONDEPEND+=" ${qthelpdepend}" - ;; - optional) - IUSE+=" qthelp" - COMMONDEPEND+=" qthelp? ( ${qthelpdepend} )" - ;; -esac -unset qthelpdepend - -# OpenGL dependencies -qtopengldepend=" - >=dev-qt/qtopengl-${QT_MINIMAL}:4 -" -case ${OPENGL_REQUIRED} in - always) - COMMONDEPEND+=" ${qtopengldepend}" - ;; - optional) - IUSE+=" opengl" - COMMONDEPEND+=" opengl? ( ${qtopengldepend} )" - ;; - *) ;; -esac -unset qtopengldepend - -# MultiMedia dependencies -qtmultimediadepend=" - >=dev-qt/qtmultimedia-${QT_MINIMAL}:4 -" -case ${MULTIMEDIA_REQUIRED} in - always) - COMMONDEPEND+=" ${qtmultimediadepend}" - ;; - optional) - IUSE+=" multimedia" - COMMONDEPEND+=" multimedia? ( ${qtmultimediadepend} )" - ;; - *) ;; -esac -unset qtmultimediadepend - -# Sql dependencies -[[ -n ${qtsqluse} ]] && qtsqluse="[${qtsqluse}]" -qtsqldepend=" - >=dev-qt/qtsql-${QT_MINIMAL}:4${qtsqluse} -" -case ${SQL_REQUIRED} in - always) - COMMONDEPEND+=" ${qtsqldepend}" - ;; - optional) - IUSE+=" sql" - COMMONDEPEND+=" sql? ( ${qtsqldepend} )" - ;; - *) ;; -esac -unset qtsqluse -unset qtsqldepend - -# WebKit dependencies -qtwebkitdepend=" - >=dev-qt/qtwebkit-${QT_MINIMAL}:4 -" -case ${WEBKIT_REQUIRED} in - always) - COMMONDEPEND+=" ${qtwebkitdepend}" - [[ -n ${kdelibsuse} ]] && kdelibsuse+=",webkit(+)" || kdelibsuse="webkit(+)" - ;; - optional) - IUSE+=" +webkit" - COMMONDEPEND+=" webkit? ( ${qtwebkitdepend} )" - [[ -n ${kdelibsuse} ]] && kdelibsuse+=",webkit?" || kdelibsuse="webkit?" - ;; - *) ;; -esac -unset qtwebkitdepend - -# CppUnit dependencies -cppuintdepend=" - dev-util/cppunit -" -case ${CPPUNIT_REQUIRED} in - always) - DEPEND+=" ${cppuintdepend}" - ;; - optional) - IUSE+=" test" - DEPEND+=" test? ( ${cppuintdepend} )" - ;; - *) ;; -esac -unset cppuintdepend - -# KDE dependencies -# Qt accessibility classes are needed in various places, bug 325461 -[[ -n ${qtcoreuse} ]] && qtcoreuse+=",ssl" || qtcoreuse="ssl" -[[ -n ${qtcoreuse} ]] && qtcoreuse="[${qtcoreuse}]" -kdecommondepend=" - dev-lang/perl - >=dev-qt/designer-${QT_MINIMAL}:4 - >=dev-qt/qtcore-${QT_MINIMAL}:4${qtcoreuse} - >=dev-qt/qtdbus-${QT_MINIMAL}:4 - >=dev-qt/qtgui-${QT_MINIMAL}:4[accessibility,dbus(+)] - >=dev-qt/qtscript-${QT_MINIMAL}:4 - >=dev-qt/qtsvg-${QT_MINIMAL}:4 - >=dev-qt/qttest-${QT_MINIMAL}:4 -" -unset qtcoreuse - -if [[ ${PN} != kdelibs ]]; then - [[ -n ${kdelibsuse} ]] && kdelibsuse="[${kdelibsuse}]" - kdecommondepend+=" kde-frameworks/kdelibs:4${kdelibsuse}" - if [[ ${KDEBASE} = kdevelop ]]; then - if [[ ${PN} != kdevplatform ]]; then - # @ECLASS-VARIABLE: KDEVPLATFORM_REQUIRED - # @DESCRIPTION: - # Specifies whether kdevplatform is required. Possible values are 'always' (default) and 'never'. - # Applies to KDEBASE=kdevelop only. - KDEVPLATFORM_REQUIRED="${KDEVPLATFORM_REQUIRED:-always}" - case ${KDEVPLATFORM_REQUIRED} in - always) - kdecommondepend+=" - >=dev-util/kdevplatform-${KDEVPLATFORM_VERSION}:4 - " - ;; - *) ;; - esac - fi - fi -fi -unset kdelibsuse - -kdedepend=" - dev-util/automoc - virtual/pkgconfig - >=x11-libs/libXtst-1.1.0 - x11-proto/xf86vidmodeproto -" - -kderdepend="" - -# all packages needs oxygen icons for basic iconset -if [[ ${PN} != oxygen-icons ]]; then - kderdepend+=" kde-frameworks/oxygen-icons" -fi - -# add a dependency over kde4-l10n -if [[ ${KDEBASE} != "kde-base" && -n ${KDE_LINGUAS} ]]; then - for _lingua in $(kde4_lingua_to_l10n ${KDE_LINGUAS}); do - # if our package has linguas, pull in kde4-l10n with selected lingua enabled, - # but only for selected ones. - # this can't be done on one line because if user doesn't use any localisation - # then he is probably not interested in kde4-l10n at all. - kderdepend+=" - l10n_${_lingua}? ( $(add_kdeapps_dep kde4-l10n "l10n_${_lingua}(+)") ) - " - done - unset _lingua -fi - -kdehandbookdepend=" - app-text/docbook-xml-dtd:4.2 - app-text/docbook-xsl-stylesheets -" -kdehandbookrdepend=" - kde-frameworks/kdelibs:4[handbook] -" -case ${KDE_HANDBOOK} in - always) - kdedepend+=" ${kdehandbookdepend}" - [[ ${PN} != kdelibs ]] && kderdepend+=" ${kdehandbookrdepend}" - ;; - optional) - IUSE+=" +handbook" - kdedepend+=" handbook? ( ${kdehandbookdepend} )" - [[ ${PN} != kdelibs ]] && kderdepend+=" handbook? ( ${kdehandbookrdepend} )" - ;; - *) ;; -esac -unset kdehandbookdepend kdehandbookrdepend - -case ${KDE_SELINUX_MODULE} in - none) ;; - *) - IUSE+=" selinux" - kderdepend+=" selinux? ( sec-policy/selinux-${KDE_SELINUX_MODULE} )" - ;; -esac - -case ${KDE_REQUIRED} in - always) - [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" ${kdecommondepend}" - [[ -n ${kdedepend} ]] && DEPEND+=" ${kdedepend}" - [[ -n ${kderdepend} ]] && RDEPEND+=" ${kderdepend}" - ;; - optional) - IUSE+=" kde" - [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" kde? ( ${kdecommondepend} )" - [[ -n ${kdedepend} ]] && DEPEND+=" kde? ( ${kdedepend} )" - [[ -n ${kderdepend} ]] && RDEPEND+=" kde? ( ${kderdepend} )" - ;; - *) ;; -esac - -unset kdecommondepend kdedepend kderdepend - -debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: COMMONDEPEND is ${COMMONDEPEND}" -debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND (only) is ${DEPEND}" -debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND (only) is ${RDEPEND}" - -# Accumulate dependencies set by this eclass -DEPEND+=" ${COMMONDEPEND}" -RDEPEND+=" ${COMMONDEPEND}" -unset COMMONDEPEND - -_kde_is_unreleased() { - local pair - for pair in "${KDE_UNRELEASED[@]}" ; do - if [[ "${pair}" = "${CATEGORY}-${PV}" ]]; then - return 0 - fi - done - - return 1 -} - -# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a -# kdevelop ebuild, the URI should be set in the ebuild itself -_calculate_src_uri() { - debug-print-function ${FUNCNAME} "$@" - - local _kmname _kmname_pv - - # we calculate URI only for known KDEBASE modules - [[ -n ${KDEBASE} ]] || return - - # calculate tarball module name - if [[ -n ${KMNAME} ]]; then - _kmname="${KMNAME}" - else - _kmname=${PN} - fi - _kmname_pv="${_kmname}-${PV}" - case ${KDEBASE} in - kde-base) - case ${PV} in - 4.4.20*) - # KDEPIM 4.4 no-akonadi branch, special case - # TODO: Remove this part when KDEPIM 4.4 gets out of the tree - SRC_URI="https://dev.gentoo.org/~dilfridge/distfiles/${_kmname_pv}.tar.xz" ;; - 4.?.[6-9]? | 4.??.[6-9]?) - # Unstable KDE SC releases - SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.xz" ;; - 4.11.22) - # Part of 15.08.0 actually, sigh. Not stable for next release! - SRC_URI="mirror://kde/Attic/applications/15.08.0/src/${_kmname_pv}.tar.xz" ;; - 4.14.3) - # Last SC release - SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.xz" ;; - 4.14.10) - # Part of 15.04.3 actually, sigh. Used by last version of KDE PIM 4. - SRC_URI="mirror://kde/Attic/applications/15.04.3/src/${_kmname_pv}.tar.xz" ;; - 4.14.11*) - # KDEPIM 4.14 snapshot with Gentoo patches - SRC_URI="https://dev.gentoo.org/~asturm/distfiles/${_kmname_pv}.tar.xz" ;; - 16.12.3) - SRC_URI="mirror://kde/Attic/applications/16.12.3/src/${_kmname_pv}.tar.xz" ;; - ??.?.[6-9]? | ??.??.[4-9]?) - # Unstable KDE Applications releases - SRC_URI="mirror://kde/unstable/applications/${PV}/src/${_kmname}-${PV}.tar.xz" ;; - *) - # Stable KDE Applications releases - SRC_URI="mirror://kde/stable/applications/${PV}/src/${_kmname}-${PV}.tar.xz" - ;; - esac - ;; - kdevelop|kdevelop-php*|kdevplatform) - case ${KDEVELOP_VERSION} in - 4.[123].[6-9]*) SRC_URI="mirror://kde/unstable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.xz" ;; - 4.7.3) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2" ;; - 4.7.4) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/${P}.tar.xz" ;; - *) SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.xz" ;; - esac - ;; - esac - - if _kde_is_unreleased ; then - RESTRICT+=" fetch" - fi -} - -_calculate_live_repo() { - debug-print-function ${FUNCNAME} "$@" - - SRC_URI="" - case ${KDE_SCM} in - svn) - # Determine branch URL based on live type - local branch_prefix - case ${PV} in - 9999*) - # trunk - branch_prefix="trunk/KDE" - ;; - *) - # branch - branch_prefix="branches/KDE/$(get_kde_version)" - - if [[ ${PV} == ??.??.49.9999 && ${CATEGORY} = kde-apps ]]; then - branch_prefix="branches/Applications/$(get_kde_version)" - fi - - # @ECLASS-VARIABLE: ESVN_PROJECT_SUFFIX - # @DESCRIPTION - # Suffix appended to ESVN_PROJECT depending on fetched branch. - # Defaults is empty (for -9999 = trunk), and "-${PV}" otherwise. - ESVN_PROJECT_SUFFIX="-${PV}" - ;; - esac - # @ECLASS-VARIABLE: ESVN_MIRROR - # @DESCRIPTION: - # This variable allows easy overriding of default kde mirror service - # (anonsvn) with anything else you might want to use. - ESVN_MIRROR=${ESVN_MIRROR:=svn://anonsvn.kde.org/home/kde} - # Split ebuild, or extragear stuff - if [[ -n ${KMNAME} ]]; then - ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}" - if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then - KMMODULE="${PN}" - fi - # Split kde-base/ ebuilds: (they reside in trunk/KDE) - case ${KMNAME} in - kdebase-*) - ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/kdebase/${KMNAME#kdebase-}" - ;; - kdelibs-*) - ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/kdelibs/${KMNAME#kdelibs-}" - ;; - kdereview*) - ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}" - ;; - kdesupport) - ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}" - ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}" - ;; - kde*) - ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/${KMNAME}" - ;; - extragear*|playground*) - # Unpack them in toplevel dir, so that they won't conflict with kde4-meta - # build packages from same svn location. - ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}" - ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}" - ;; - *) - ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}" - ;; - esac - else - # kdelibs, kdepimlibs - ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/${PN}" - ESVN_PROJECT="${PN}${ESVN_PROJECT_SUFFIX}" - fi - # @ECLASS-VARIABLE: ESVN_UP_FREQ - # @DESCRIPTION: - # This variable is used for specifying the timeout between svn synces - # for kde-base modules. Does not affect misc apps. - # Default value is 1 hour. - [[ ${KDEBASE} = kde-base ]] && ESVN_UP_FREQ=${ESVN_UP_FREQ:-1} - ;; - git) - local _kmname - # @ECLASS-VARIABLE: EGIT_MIRROR - # @DESCRIPTION: - # This variable allows easy overriding of default kde mirror service - # (anongit) with anything else you might want to use. - EGIT_MIRROR=${EGIT_MIRROR:=https://anongit.kde.org} - - # @ECLASS-VARIABLE: EGIT_REPONAME - # @DESCRIPTION: - # This variable allows overriding of default repository - # name. Specify only if this differ from PN and KMNAME. - if [[ -n ${EGIT_REPONAME} ]]; then - # the repository and kmname different - _kmname=${EGIT_REPONAME} - elif [[ -n ${KMNAME} ]]; then - _kmname=${KMNAME} - else - _kmname=${PN} - fi - - # default branching - [[ ${PV} != 4.9999* && ${PV} != 9999 && ${KDEBASE} == kde-base ]] && \ - EGIT_BRANCH="KDE/$(get_kde_version)" - - # Applications branching - [[ ${PV} == ??.??.49.9999 && ${KDEBASE} == kde-base ]] && \ - EGIT_BRANCH="Applications/$(get_kde_version)" - - # default repo uri - EGIT_REPO_URI+=( "${EGIT_MIRROR}/${_kmname}" ) - - debug-print "${FUNCNAME}: Repository: ${EGIT_REPO_URI}" - debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}" - ;; - esac -} - -case ${KDE_BUILD_TYPE} in - live) _calculate_live_repo ;; - *) _calculate_src_uri ;; -esac - -debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}" - -# @ECLASS-VARIABLE: PREFIX -# @DESCRIPTION: -# Set the installation PREFIX for non kde-base applications. It defaults to /usr. -# kde-base packages go into KDE4 installation directory (/usr). -# No matter the PREFIX, package will be built against KDE installed in /usr. - -# @FUNCTION: kde4-base_pkg_setup -# @DESCRIPTION: -# Do some basic settings -kde4-base_pkg_setup() { - debug-print-function ${FUNCNAME} "$@" - - if has handbook ${IUSE} || has "+handbook" ${IUSE} && [[ "${KDE_HANDBOOK}" != optional ]] ; then - eqawarn "Handbook support is enabled via KDE_HANDBOOK=optional in the ebuild." - eqawarn "Please do not just set IUSE=handbook, as this leads to dependency errors." - fi - - # Don't set KDEHOME during compilation, it will cause access violations - unset KDEHOME - - KDEDIR=/usr - : ${PREFIX:=/usr} - EKDEDIR=${EPREFIX}/usr - - # Point to correct QT plugins path - QT_PLUGIN_PATH="${EPREFIX}/usr/$(get_libdir)/kde4/plugins/" - - # Fix XDG collision with sandbox - export XDG_CONFIG_HOME="${T}" -} - -# @FUNCTION: kde4-base_pkg_nofetch -# @DESCRIPTION: -# Display package publication status -kde4-base_pkg_nofetch() { - if ! _kde_is_unreleased ; then - return - fi - - eerror " _ _ _ _ ____ _____ _ _____ _ ____ _____ ____ " - eerror "| | | | \ | | _ \| ____| | | ____| / \ / ___|| ____| _ \ " - eerror "| | | | \| | |_) | _| | | | _| / _ \ \___ \| _| | | | |" - eerror "| |_| | |\ | _ <| |___| |___| |___ / ___ \ ___) | |___| |_| |" - eerror " \___/|_| \_|_| \_\_____|_____|_____/_/ \_\____/|_____|____/ " - eerror " " - eerror " ____ _ ____ _ __ _ ____ _____ " - eerror "| _ \ / \ / ___| |/ / / \ / ___| ____|" - eerror "| |_) / _ \| | | ' / / _ \| | _| _| " - eerror "| __/ ___ \ |___| . \ / ___ \ |_| | |___ " - eerror "|_| /_/ \_\____|_|\_\/_/ \_\____|_____|" - eerror - eerror "${CATEGORY}/${P} has not been released to the public yet" - eerror "and is only available to packagers right now." - eerror "" - eerror "This is not a bug. Please do not file bugs or contact upstream about this." - eerror "" - eerror "Please consult the upstream release schedule to see when this " - eerror "package is scheduled to be released:" - eerror "https://community.kde.org/Schedules" -} - -# @FUNCTION: kde4-base_src_unpack -# @DESCRIPTION: -# This function unpacks the source tarballs for KDE4 applications. -kde4-base_src_unpack() { - debug-print-function ${FUNCNAME} "$@" - - if [[ ${KDE_BUILD_TYPE} = live ]]; then - case ${KDE_SCM} in - svn) - subversion_src_unpack - ;; - git) - git-r3_src_unpack - ;; - esac - else - unpack ${A} - fi -} - -# @FUNCTION: kde4-base_src_prepare -# @DESCRIPTION: -# General pre-configure and pre-compile function for KDE4 applications. -# It also handles translations if KDE_LINGUAS is defined. See KDE_LINGUAS and -# enable_selected_linguas() and enable_selected_doc_linguas() -# in kde4-functions.eclass(5) for further details. -kde4-base_src_prepare() { - debug-print-function ${FUNCNAME} "$@" - - # enable handbook and linguas only when not using live ebuild - - # Only enable selected languages, used for KDE extragear apps. - if [[ -n ${KDE_LINGUAS} ]]; then - enable_selected_linguas - fi - - # Enable/disable handbooks for kde4-base packages - # kde4-l10n inherits kde4-base but is metapackage, so no check for doc - # kdelibs inherits kde4-base but handle installing the handbook itself - if ! has kde4-meta ${INHERITED} && in_iuse handbook; then - if [[ ${KDEBASE} == kde-base ]]; then - if [[ ${PN} != kde4-l10n && ${PN} != kdepim-l10n && ${PN} != kdelibs ]] && use !handbook; then - # documentation in kde4-functions - : ${KDE_DOC_DIRS:=doc} - local dir - for dir in ${KDE_DOC_DIRS}; do - sed -e "\!^[[:space:]]*add_subdirectory[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \ - -e "\!^[[:space:]]*ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \ - -e "\!^[[:space:]]*macro_optional_add_subdirectory[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \ - -e "\!^[[:space:]]*MACRO_OPTIONAL_ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \ - -i CMakeLists.txt || die "failed to comment out handbook" - done - fi - else - enable_selected_doc_linguas - fi - fi - - # SCM bootstrap - if [[ ${KDE_BUILD_TYPE} = live ]]; then - case ${KDE_SCM} in - svn) subversion_src_prepare ;; - esac - fi - - # Apply patches, cmake-utils does the job already - cmake-utils_src_prepare - - # Save library dependencies - if [[ -n ${KMSAVELIBS} ]] ; then - save_library_dependencies - fi - - # Inject library dependencies - if [[ -n ${KMLOADLIBS} ]] ; then - load_library_dependencies - fi - - # Hack for manuals relying on outdated DTD, only outside kde-base/... - if [[ -z ${KDEBASE} ]]; then - find "${S}" -name "*.docbook" \ - -exec sed -i -r \ - -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' {} + \ - || die 'failed to fix DocBook variant version' - fi -} - -# @FUNCTION: kde4-base_src_configure -# @DESCRIPTION: -# Function for configuring the build of KDE4 applications. -kde4-base_src_configure() { - debug-print-function ${FUNCNAME} "$@" - - # Build tests in src_test only, where we override this value - local cmakeargs=(-DKDE4_BUILD_TESTS=OFF) - - if use_if_iuse debug; then - # Set "real" debug mode - CMAKE_KDE_BUILD_TYPE="Debugfull" - else - # Handle common release builds - append-cppflags -DQT_NO_DEBUG - fi - - # Set distribution name - [[ ${PN} = kdelibs ]] && cmakeargs+=(-DKDE_DISTRIBUTION_TEXT=Gentoo) - - # Here we set the install prefix - tc-is-cross-compiler || cmakeargs+=(-DCMAKE_INSTALL_PREFIX="${EPREFIX}${PREFIX}") - - # Use colors - QTEST_COLORED=1 - - # Shadow existing installations - unset KDEDIRS - - #qmake -query QT_INSTALL_LIBS unavailable when cross-compiling - tc-is-cross-compiler && cmakeargs+=(-DQT_LIBRARY_DIR=${ROOT}/usr/$(get_libdir)/qt4) - #kde-config -path data unavailable when cross-compiling - tc-is-cross-compiler && cmakeargs+=(-DKDE4_DATA_DIR=${ROOT}/usr/share/apps/) - - # sysconf needs to be /etc, not /usr/etc - cmakeargs+=(-DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc) - - if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then - if [[ ${mycmakeargs} ]]; then - eqawarn "mycmakeargs should always be declared as an array, not a string" - fi - mycmakeargs=(${mycmakeargs}) - fi - - mycmakeargs=("${cmakeargs[@]}" "${mycmakeargs[@]}") - - cmake-utils_src_configure -} - -# @FUNCTION: kde4-base_src_compile -# @DESCRIPTION: -# General function for compiling KDE4 applications. -kde4-base_src_compile() { - debug-print-function ${FUNCNAME} "$@" - - cmake-utils_src_compile "$@" -} - -# @FUNCTION: kde4-base_src_test -# @DESCRIPTION: -# Function for testing KDE4 applications. -kde4-base_src_test() { - debug-print-function ${FUNCNAME} "$@" - - local kded4_pid - - _test_runner() { - if [[ -n "${VIRTUALDBUS_TEST}" ]]; then - export $(dbus-launch) - kded4 2>&1 > /dev/null & - kded4_pid=$! - fi - - cmake-utils_src_test - } - - # When run as normal user during ebuild development with the ebuild command, the - # kde tests tend to access the session DBUS. This however is not possible in a real - # emerge or on the tinderbox. - # > make sure it does not happen, so bad tests can be recognized and disabled - unset DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID - - # Override this value, set in kde4-base_src_configure() - mycmakeargs+=(-DKDE4_BUILD_TESTS=ON) - cmake-utils_src_configure - kde4-base_src_compile - - if [[ ${VIRTUALX_REQUIRED} == always || ${VIRTUALX_REQUIRED} == test ]]; then - # check for sanity if anyone already redefined VIRTUALX_COMMAND from the default - if [[ ${VIRTUALX_COMMAND} != emake ]]; then - # surprise- we are already INSIDE virtualmake!!! - debug-print "QA Notice: This version of kde4-base.eclass includes the virtualx functionality." - debug-print " You may NOT set VIRTUALX_COMMAND or call virtualmake from the ebuild." - debug-print " Setting VIRTUALX_REQUIRED is completely sufficient. See the" - debug-print " kde4-base.eclass docs for details... Applying workaround." - _test_runner - else - virtx _test_runner - fi - else - _test_runner - fi - - if [ -n "${kded4_pid}" ] ; then - kill ${kded4_pid} - fi - - if [ -n "${DBUS_SESSION_BUS_PID}" ] ; then - kill ${DBUS_SESSION_BUS_PID} - fi -} - -# @FUNCTION: kde4-base_src_install -# @DESCRIPTION: -# Function for installing KDE4 applications. -kde4-base_src_install() { - debug-print-function ${FUNCNAME} "$@" - - if [[ -n ${KMSAVELIBS} ]] ; then - install_library_dependencies - fi - - # Install common documentation of KDE4 applications - local doc - if ! has kde4-meta ${INHERITED}; then - for doc in "${S}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do - [[ -f ${doc} && -s ${doc} ]] && dodoc "${doc}" - done - for doc in "${S}"/*/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do - [[ -f ${doc} && -s ${doc} ]] && newdoc "${doc}" "$(basename $(dirname ${doc})).$(basename ${doc})" - done - fi - - cmake-utils_src_install - - # We don't want ${PREFIX}/share/doc/HTML to be compressed, - # because then khelpcenter can't find the docs - [[ -d ${ED}/${PREFIX}/share/doc/HTML ]] && - docompress -x ${PREFIX}/share/doc/HTML -} - -# @FUNCTION: kde4-base_pkg_preinst -# @DESCRIPTION: -# Function storing icon caches -kde4-base_pkg_preinst() { - debug-print-function ${FUNCNAME} "$@" - - gnome2_icon_savelist - if [[ ${KDE_BUILD_TYPE} == live && ${KDE_SCM} == svn ]]; then - subversion_pkg_preinst - fi -} - -# @FUNCTION: kde4-base_pkg_postinst -# @DESCRIPTION: -# Function to rebuild the KDE System Configuration Cache after an application has been installed. -kde4-base_pkg_postinst() { - debug-print-function ${FUNCNAME} "$@" - - if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then - gnome2_icon_cache_update - fi - xdg_desktop_database_update - xdg_mimeinfo_database_update - buildsycoca - - if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then - if [[ ${KDE_BUILD_TYPE} = live ]]; then - echo - einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}" - einfo "Use it at your own risk." - einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!" - echo - fi - fi -} - -# @FUNCTION: kde4-base_pkg_postrm -# @DESCRIPTION: -# Function to rebuild the KDE System Configuration Cache after an application has been removed. -kde4-base_pkg_postrm() { - debug-print-function ${FUNCNAME} "$@" - - if [[ -n ${GNOME2_ECLASS_ICONS} ]]; then - gnome2_icon_cache_update - fi - xdg_desktop_database_update - xdg_mimeinfo_database_update - buildsycoca -} - -fi diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass deleted file mode 100644 index 558191db5e..0000000000 --- a/eclass/kde4-functions.eclass +++ /dev/null @@ -1,429 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -# @ECLASS: kde4-functions.eclass -# @MAINTAINER: -# k...@gentoo.org -# @BLURB: Common ebuild functions for KDE 4 packages -# @DESCRIPTION: -# This eclass contains all functions shared by the different eclasses, -# for KDE 4 ebuilds. - -if [[ -z ${_KDE4_FUNCTIONS_ECLASS} ]]; then -_KDE4_FUNCTIONS_ECLASS=1 - -inherit versionator - -# @ECLASS-VARIABLE: EAPI -# @DESCRIPTION: -# Currently kde4 eclasses support EAPI 5 and 6. -case ${EAPI} in - 5|6) : ;; - *) die "EAPI=${EAPI:-0} is not supported" ;; -esac - -# @ECLASS-VARIABLE: KDE_OVERRIDE_MINIMAL -# @DESCRIPTION: -# For use only in very few well-defined cases; normally it should be unset. -# If this variable is set, all calls to add_kdebase_dep return a dependency on -# at least this version, independent of the version of the package itself. -# If you know exactly that one specific NEW KDE component builds and runs fine -# with all the rest of KDE at an OLDER version, you can set this old version here. -# Warning- may lead to general instability and kill your pet targh. - -# @ECLASS-VARIABLE: KDEBASE -# @DESCRIPTION: -# This gets set to a non-zero value when a package is considered a kde or -# kdevelop ebuild. -if [[ ${CATEGORY} = kde-base || ${CATEGORY} == kde-plasma || ${CATEGORY} = kde-apps || ${CATEGORY} = kde-frameworks ]]; then - debug-print "${ECLASS}: KDEBASE ebuild recognized" - KDEBASE=kde-base -elif [[ ${KMNAME-${PN}} = kdevelop ]]; then - KDEBASE=kdevelop -fi - -debug-print "${ECLASS}: ${KDEBASE} ebuild recognized" - -# determine the build type -if [[ ${PV} = *9999* ]]; then - KDE_BUILD_TYPE="live" -else - KDE_BUILD_TYPE="release" -fi -export KDE_BUILD_TYPE - -# Set reponame and SCM for modules that have fully migrated to git -# (hack - it's here because it needs to be before SCM inherits from kde4-base) -if [[ ${KDE_BUILD_TYPE} == live ]]; then - case "${KMNAME}" in - kdebase-workspace) - EGIT_REPONAME=${EGIT_REPONAME:=kde-workspace} - ;; - kdebase-runtime) - EGIT_REPONAME=${EGIT_REPONAME:=kde-runtime} - ;; - esac -fi - -# @ECLASS-VARIABLE: KDE_SCM -# @DESCRIPTION: -# If this is a live package which scm does it use -# Everything else uses git by default -KDE_SCM="${KDE_SCM:-git}" -case ${KDE_SCM} in - svn|git) ;; - *) die "KDE_SCM: ${KDE_SCM} is not supported" ;; -esac - -# @FUNCTION: kde4_lingua_to_l10n -# @USAGE: <lingua>... -# @INTERNAL -# @DESCRIPTION: -# Output l10n flag name(s) (without prefix(es)) appropriate for given KDE -# locale(s). -kde4_lingua_to_l10n() { - local l - for l; do - case ${l} in - ca@valencia) echo ca-valencia;; - sr@ijekavian) echo sr-ijekavsk;; - sr@ijekavianlatin) echo sr-Latn-ijekavsk;; - sr@latin|sr@Latn) echo sr-Latn;; - uz@cyrillic) echo uz-Cyrl;; - *@*) die "${FUNCNAME}: Unhandled KDE_LINGUAS: ${l}";; - *) echo "${l/_/-}";; - esac - done -} - -# @ECLASS-VARIABLE: KDE_LINGUAS -# @DESCRIPTION: -# This is a whitespace-separated list of translations this ebuild supports. -# These translations are automatically added to IUSE. Therefore ebuilds must set -# this variable before inheriting any eclasses. To enable only selected -# translations, ebuilds must call enable_selected_linguas(). kde4-{base,meta}.eclass does -# this for you. -# -# Example: KDE_LINGUAS="de en_GB nl" -if [[ ${KDE_BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then - for _lingua in $(kde4_lingua_to_l10n ${KDE_LINGUAS}); do - IUSE="${IUSE} l10n_${_lingua}" - done -fi - -# @FUNCTION: buildsycoca -# @DESCRIPTION: -# Function to rebuild the KDE System Configuration Cache. -# All KDE ebuilds should run this in pkg_postinst and pkg_postrm. -buildsycoca() { - debug-print-function ${FUNCNAME} "$@" - - # We no longer need to run kbuildsycoca4, as kded does that automatically, as needed - - # fix permission for some directories - for x in usr/share/{config,kde4}; do - DIRS=${EROOT}usr - [[ -d "${EROOT}${x}" ]] || break # nothing to do if directory does not exist - # fixes Bug 318237 - if use userland_BSD ; then - [[ $(stat -f %p "${EROOT}${x}") != 40755 ]] - local stat_rtn="$?" - else - [[ $(stat --format=%a "${EROOT}${x}") != 755 ]] - local stat_rtn=$? - fi - if [[ $stat_rtn != 1 ]] ; then - ewarn "QA Notice:" - ewarn "Package ${PN} is breaking ${EROOT}${x} permissions." - ewarn "Please report this issue to gentoo bugzilla." - einfo "Permissions will get adjusted automatically now." - find "${EROOT}${x}" -type d -print0 | xargs -0 chmod 755 - fi - done -} - -# @FUNCTION: comment_all_add_subdirectory -# @USAGE: [list of directory names] -# @DESCRIPTION: -# Recursively comment all add_subdirectory instructions in listed directories, -# except those in cmake/. -comment_all_add_subdirectory() { - find "$@" -name CMakeLists.txt -print0 | grep -vFzZ "./cmake" | \ - xargs -0 sed -i \ - -e '/^[[:space:]]*add_subdirectory/s/^/#DONOTCOMPILE /' \ - -e '/^[[:space:]]*ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \ - -e '/^[[:space:]]*macro_optional_add_subdirectory/s/^/#DONOTCOMPILE /' \ - -e '/^[[:space:]]*MACRO_OPTIONAL_ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \ - || die "${LINENO}: Initial sed died" -} - -# @FUNCTION: enable_selected_linguas -# @DESCRIPTION: -# Enable translations based on L10N settings and translations supported by -# the package (see KDE_LINGUAS). By default, translations are found in "${S}"/po -# but this default can be overridden by defining KDE_LINGUAS_DIR. -enable_selected_linguas() { - debug-print-function ${FUNCNAME} "$@" - - local x - - # @ECLASS-VARIABLE: KDE_LINGUAS_DIR - # @DESCRIPTION: - # Specified folder where application translations are located. - # Can be defined as array of folders where translations are located. - # Note that space separated list of dirs is not supported. - # Default value is set to "po". - if [[ "$(declare -p KDE_LINGUAS_DIR 2>/dev/null 2>&1)" == "declare -a"* ]]; then - debug-print "$FUNCNAME: we have these subfolders defined: ${KDE_LINGUAS_DIR}" - for x in ${KDE_LINGUAS_DIR[@]}; do - _enable_selected_linguas_dir ${x} - done - else - KDE_LINGUAS_DIR=${KDE_LINGUAS_DIR:="po"} - _enable_selected_linguas_dir ${KDE_LINGUAS_DIR} - fi -} - -# @FUNCTION: enable_selected_doc_linguas -# @DESCRIPTION: -# Enable only selected L10N enabled doc folders. -enable_selected_doc_linguas() { - debug-print-function ${FUNCNAME} "$@" - - # @ECLASS-VARIABLE: KDE_DOC_DIRS - # @DESCRIPTION: - # Variable specifying whitespace separated patterns for documentation locations. - # Default is "doc/%lingua" - KDE_DOC_DIRS=${KDE_DOC_DIRS:='doc/%lingua'} - local linguas - for pattern in ${KDE_DOC_DIRS}; do - - local handbookdir=`dirname ${pattern}` - local translationdir=`basename ${pattern}` - # Do filename pattern supplied, treat as directory - [[ ${handbookdir} = '.' ]] && handbookdir=${translationdir} && translationdir= - [[ -d ${handbookdir} ]] || die 'wrong doc dir specified' - - if ! use handbook; then - # Disable whole directory - sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \ - -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \ - -i CMakeLists.txt || die 'failed to comment out all handbooks' - else - # Disable subdirectories recursively - comment_all_add_subdirectory "${handbookdir}" - - # In certain packages, the default handbook is en_US instead of the usual en. Since there is no en_US 'translation', - # it makes no sense to add to KDE_LINGUAS which causes this type of handbook to not be installed. - if [[ -d "${handbookdir}/en_US" && ! -d "${handbookdir}/en" ]]; then - mv "${handbookdir}/en_US" "${handbookdir}/en" || die - sed -e "s/en_US/en/" -i "${handbookdir}/CMakeLists.txt" - fi - - # Add requested translations - local lingua - for lingua in en ${KDE_LINGUAS}; do - if [[ ${lingua} = en ]] || use "l10n_$(kde4_lingua_to_l10n "${lingua}")"; then - if [[ -d ${handbookdir}/${translationdir//%lingua/${lingua}} ]]; then - sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \ - -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \ - -i "${handbookdir}"/CMakeLists.txt && ! has ${lingua} ${linguas} && linguas="${linguas} ${lingua}" - fi - fi - done - fi - - done - [[ -n "${linguas}" ]] && einfo "Enabling handbook translations:${linguas}" -} - -# Functions handling KMLOADLIBS and KMSAVELIBS - -# @FUNCTION: save_library_dependencies -# @DESCRIPTION: -# Add exporting CMake dependencies for current package -save_library_dependencies() { - local depsfile="${T}/${PN}" - - ebegin "Saving library dependencies in ${depsfile##*/}" - echo "EXPORT_LIBRARY_DEPENDENCIES(\"${depsfile}\")" >> "${S}/CMakeLists.txt" || \ - die "Failed to save the library dependencies." - eend $? -} - -# @FUNCTION: install_library_dependencies -# @DESCRIPTION: -# Install generated CMake library dependencies to /var/lib/kde -install_library_dependencies() { - local depsfile="${T}/${PN}" - - ebegin "Installing library dependencies as ${depsfile##*/}" - insinto /var/lib/kde - doins "${depsfile}" || die "Failed to install library dependencies." - eend $? -} - -# @FUNCTION: load_library_dependencies -# @DESCRIPTION: -# Inject specified library dependencies in current package -load_library_dependencies() { - local pn i depsfile - ebegin "Injecting library dependencies from '${KMLOADLIBS}'" - - i=0 - for pn in ${KMLOADLIBS} ; do - ((i++)) - depsfile="${EPREFIX}/var/lib/kde/${pn}" - [[ -r ${depsfile} ]] || depsfile="${EPREFIX}/var/lib/kde/${pn}:$(get_kde_version)" - [[ -r ${depsfile} ]] || die "Depsfile '${depsfile}' not accessible. You probably need to reinstall ${pn}." - sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || \ - die "Failed to include library dependencies for ${pn}" - done - eend $? -} - -# @FUNCTION: add_kdeapps_dep -# @DESCRIPTION: -# Create proper dependency for kde-apps/ dependencies. -# This takes 1 to 3 arguments. The first being the package name, the optional -# second is additional USE flags to append, and the optional third is the -# version to use instead of the automatic version (use sparingly). -# The output of this should be added directly to DEPEND/RDEPEND, and may be -# wrapped in a USE conditional (but not an || conditional without an extra set -# of parentheses). -add_kdeapps_dep() { - debug-print-function ${FUNCNAME} "$@" - - local ver - - if [[ -n ${2} ]] ; then - local use="[${2}]" - fi - - if [[ -n ${3} ]]; then - ver=${3} - elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then - ver=${KDE_OVERRIDE_MINIMAL} - elif [[ ${KDEBASE} != kde-base ]]; then - ver=${KDE_MINIMAL} - # if building kde-apps, live master or stable-live branch, - # use the final SC version since there are no further general releases. - # except when it is kdepim split packages, which rely on same-version deps - elif [[ ${CATEGORY} == kde-apps || ${PV} == *9999 ]] && [[ ${KMNAME} != "kdepim" ]]; then - ver=4.14.3 - else - ver=${PV} - fi - - [[ -z ${1} ]] && die "Missing parameter" - - echo " >=kde-apps/${1}-${ver}:4${use}" -} - -# @FUNCTION: add_kdebase_dep -# @DESCRIPTION: -# Create proper dependency for kde-base/ dependencies. -# This takes 1 to 3 arguments. The first being the package name, the optional -# second is additional USE flags to append, and the optional third is the -# version to use instead of the automatic version (use sparingly). -# The output of this should be added directly to DEPEND/RDEPEND, and may be -# wrapped in a USE conditional (but not an || conditional without an extra set -# of parentheses). -add_kdebase_dep() { - debug-print-function ${FUNCNAME} "$@" - - local ver - - if [[ -n ${2} ]] ; then - local use="[${2}]" - fi - - if [[ -n ${3} ]]; then - ver=${3} - elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then - ver=${KDE_OVERRIDE_MINIMAL} - elif [[ ${KDEBASE} != kde-base ]]; then - ver=${KDE_MINIMAL} - # if building live master or kde-apps, use the final SC version - # since there are no further general releases. - elif [[ ${CATEGORY} == kde-apps || ${PV} == 9999 ]]; then - ver=4.14.3 - # if building a live version branch (eg. 4.11.49.9999) use the major version - elif [[ ${PV} == *.9999 ]]; then - ver=$(get_kde_version) - else - ver=${PV} - fi - - [[ -z ${1} ]] && die "Missing parameter" - - echo " >=kde-base/${1}-${ver}:4${use}" -} - -# local function to enable specified translations for specified directory -# used from kde4-functions_enable_selected_linguas function -_enable_selected_linguas_dir() { - local lingua linguas sr_mess wp - local dir=${1} - - [[ -d ${dir} ]] || die "linguas dir \"${dir}\" does not exist" - comment_all_add_subdirectory "${dir}" - pushd "${dir}" > /dev/null || die - - # fix all various crazy sr@Latn variations - # this part is only ease for ebuilds, so there wont be any die when this - # fail at any point - sr_mess="sr@latn sr@latin sr@Latin" - for wp in ${sr_mess}; do - [[ -e ${wp}.po ]] && mv "${wp}.po" "s...@latn.po" - if [[ -d ${wp} ]]; then - # move dir and fix cmakelists - mv "${wp}" "sr@Latn" - sed -i \ - -e "s:${wp}:sr@Latn:g" \ - CMakeLists.txt - fi - done - - for lingua in ${KDE_LINGUAS}; do - if [[ -e ${lingua}.po ]]; then - mv "${lingua}.po" "${lingua}.po.old" - fi - done - - for lingua in ${KDE_LINGUAS}; do - if use "l10n_$(kde4_lingua_to_l10n ${lingua})" ; then - if [[ -d ${lingua} ]]; then - linguas="${linguas} ${lingua}" - sed -e "/add_subdirectory([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \ - -e "/ADD_SUBDIRECTORY([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \ - -i CMakeLists.txt || die "Sed to uncomment linguas_${lingua} failed." - fi - if [[ -e ${lingua}.po.old ]]; then - linguas="${linguas} ${lingua}" - mv "${lingua}.po.old" "${lingua}.po" - fi - fi - done - [[ -n ${linguas} ]] && echo ">>> Enabling languages: ${linguas}" - - popd > /dev/null || die -} - -# @FUNCTION: get_kde_version -# @DESCRIPTION: -# Translates an ebuild version into a major.minor KDE SC -# release version. If no version is specified, ${PV} is used. -get_kde_version() { - local ver=${1:-${PV}} - local major=$(get_major_version ${ver}) - local minor=$(get_version_component_range 2 ${ver}) - local micro=$(get_version_component_range 3 ${ver}) - if [[ ${ver} == 9999 ]]; then - echo live - else - (( micro < 50 )) && echo ${major}.${minor} || echo ${major}.$((minor + 1)) - fi -} - -fi