2015-02-11 08:49:41 +03:00
|
|
|
# Copyright 1999-2015 Gentoo Foundation
|
2014-10-15 23:19:41 +04:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
2015-08-11 00:17:55 +03:00
|
|
|
# $Id$
|
2014-10-15 23:19:41 +04:00
|
|
|
|
|
|
|
# @ECLASS: kde5.eclass
|
|
|
|
# @MAINTAINER:
|
|
|
|
# kde@gentoo.org
|
|
|
|
# @BLURB: Support eclass for KDE 5-related packages.
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# The kde5.eclass provides support for building KDE 5-related packages.
|
|
|
|
|
|
|
|
if [[ -z ${_KDE5_ECLASS} ]]; then
|
|
|
|
_KDE5_ECLASS=1
|
|
|
|
|
|
|
|
# @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 kde5-functions fdo-mime flag-o-matic gnome2-utils versionator virtualx eutils cmake-utils
|
|
|
|
|
|
|
|
if [[ ${KDE_BUILD_TYPE} = live ]]; then
|
|
|
|
case ${KDE_SCM} in
|
|
|
|
svn) inherit subversion ;;
|
|
|
|
git) inherit git-r3 ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2015-05-31 21:32:57 +03:00
|
|
|
EXPORT_FUNCTIONS pkg_pretend pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm
|
2014-10-15 23:19:41 +04:00
|
|
|
|
|
|
|
# @ECLASS-VARIABLE: QT_MINIMAL
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# Minimal Qt version to require for the package.
|
2015-03-19 17:52:45 +03:00
|
|
|
: ${QT_MINIMAL:=5.4.1}
|
2014-10-15 23:19:41 +04:00
|
|
|
|
|
|
|
# @ECLASS-VARIABLE: KDE_AUTODEPS
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# If set to "false", do nothing.
|
2015-04-12 08:44:26 +03:00
|
|
|
# For any other value, add a dependency on dev-qt/qtcore:5 and kde-frameworks/extra-cmake-modules:5.
|
2014-10-15 23:19:41 +04:00
|
|
|
: ${KDE_AUTODEPS:=true}
|
|
|
|
|
2015-05-31 21:32:57 +03:00
|
|
|
# @ECLASS-VARIABLE: KDE_BLOCK_SLOT4
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# This variable is used when KDE_AUTODEPS is set.
|
|
|
|
# If set to "true", add RDEPEND block on kde-{base,apps}/${PN}:4
|
|
|
|
: ${KDE_BLOCK_SLOT4:=true}
|
|
|
|
|
2014-10-15 23:19:41 +04:00
|
|
|
# @ECLASS-VARIABLE: KDE_DEBUG
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# If set to "false", unconditionally build with -DNDEBUG.
|
|
|
|
# Otherwise, add debug to IUSE to control building with that flag.
|
|
|
|
: ${KDE_DEBUG:=true}
|
|
|
|
|
|
|
|
# @ECLASS-VARIABLE: KDE_DOXYGEN
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# If set to "false", do nothing.
|
|
|
|
# Otherwise, add "doc" to IUSE, add appropriate dependencies, and generate and
|
|
|
|
# install API documentation.
|
|
|
|
if [[ ${CATEGORY} = kde-frameworks ]]; then
|
|
|
|
: ${KDE_DOXYGEN:=true}
|
|
|
|
else
|
|
|
|
: ${KDE_DOXYGEN:=false}
|
|
|
|
fi
|
|
|
|
|
|
|
|
# @ECLASS-VARIABLE: KDE_EXAMPLES
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# If set to "false", unconditionally ignore a top-level examples subdirectory.
|
|
|
|
# Otherwise, add "examples" to IUSE to toggle adding that subdirectory.
|
|
|
|
: ${KDE_EXAMPLES:=false}
|
|
|
|
|
|
|
|
# @ECLASS-VARIABLE: KDE_HANDBOOK
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# If set to "false", do nothing.
|
|
|
|
# Otherwise, add "+handbook" to IUSE, add the appropriate dependency, and
|
|
|
|
# generate and install KDE handbook.
|
|
|
|
: ${KDE_HANDBOOK:=false}
|
|
|
|
|
2015-08-14 09:50:09 +03:00
|
|
|
# @ECLASS-VARIABLE: KDE_DOC_DIR
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# Defaults to "doc". Otherwise, use alternative KDE handbook path.
|
|
|
|
: ${KDE_DOC_DIR:=doc}
|
|
|
|
|
2014-10-15 23:19:41 +04:00
|
|
|
# @ECLASS-VARIABLE: KDE_TEST
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# If set to "false", do nothing.
|
|
|
|
# For any other value, add test to IUSE and add a dependency on dev-qt/qttest:5.
|
|
|
|
if [[ ${CATEGORY} = kde-frameworks ]]; then
|
|
|
|
: ${KDE_TEST:=true}
|
|
|
|
else
|
|
|
|
: ${KDE_TEST:=false}
|
|
|
|
fi
|
|
|
|
|
2015-05-09 19:07:54 +03:00
|
|
|
# @ECLASS-VARIABLE: KDE_PUNT_BOGUS_DEPS
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# If set to "false", do nothing.
|
|
|
|
# For any other value, do black magic to make hardcoded-but-optional dependencies
|
|
|
|
# optional again. An upstream solution is preferable and this is a last resort.
|
|
|
|
: ${KDE_PUNT_BOGUS_DEPS:=false}
|
|
|
|
|
2015-03-19 17:52:45 +03:00
|
|
|
# @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
|
2015-05-09 19:07:54 +03:00
|
|
|
# add a dependency on sec-policy/selinux-${KDE_SELINUX_MODULE} to (R)DEPEND.
|
2015-03-19 17:52:45 +03:00
|
|
|
: ${KDE_SELINUX_MODULE:=none}
|
|
|
|
|
2014-10-15 23:19:41 +04:00
|
|
|
if [[ ${KDEBASE} = kdevelop ]]; then
|
2015-09-10 23:41:16 +03:00
|
|
|
HOMEPAGE="https://www.kdevelop.org/"
|
2014-10-15 23:19:41 +04:00
|
|
|
else
|
2015-09-10 23:41:16 +03:00
|
|
|
HOMEPAGE="https://www.kde.org/"
|
2014-10-15 23:19:41 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
|
|
|
|
if [[ ${CATEGORY} = kde-frameworks ]]; then
|
|
|
|
SLOT=5/$(get_version_component_range 1-2)
|
|
|
|
else
|
|
|
|
SLOT=5
|
|
|
|
fi
|
|
|
|
|
|
|
|
case ${KDE_AUTODEPS} in
|
|
|
|
false) ;;
|
|
|
|
*)
|
|
|
|
if [[ ${KDE_BUILD_TYPE} = live ]]; then
|
2015-03-19 17:52:45 +03:00
|
|
|
case ${CATEGORY} in
|
|
|
|
kde-frameworks)
|
|
|
|
FRAMEWORKS_MINIMAL=9999
|
|
|
|
;;
|
|
|
|
kde-plasma)
|
|
|
|
FRAMEWORKS_MINIMAL=9999
|
|
|
|
;;
|
|
|
|
*) ;;
|
|
|
|
esac
|
2014-10-15 23:19:41 +04:00
|
|
|
fi
|
|
|
|
|
2015-04-12 08:44:26 +03:00
|
|
|
DEPEND+=" $(add_frameworks_dep extra-cmake-modules)"
|
2014-11-13 16:20:16 +03:00
|
|
|
RDEPEND+=" >=kde-frameworks/kf-env-3"
|
2014-10-15 23:19:41 +04:00
|
|
|
COMMONDEPEND+=" >=dev-qt/qtcore-${QT_MINIMAL}:5"
|
|
|
|
|
2015-09-10 23:41:16 +03:00
|
|
|
if [[ ${CATEGORY} = kde-frameworks || ${CATEGORY} = kde-plasma && ${PN} != polkit-kde-agent ]]; then
|
2015-03-19 17:52:45 +03:00
|
|
|
RDEPEND+="
|
2015-07-06 21:47:12 +03:00
|
|
|
!kde-apps/kde4-l10n[-minimal(-)]
|
2015-09-10 23:41:16 +03:00
|
|
|
!<kde-apps/kde4-l10n-15.08.0-r1
|
2015-03-19 17:52:45 +03:00
|
|
|
"
|
|
|
|
fi
|
|
|
|
|
2015-05-31 21:32:57 +03:00
|
|
|
if [[ ${KDE_BLOCK_SLOT4} = true && ${CATEGORY} = kde-apps ]]; then
|
2015-06-28 15:57:33 +03:00
|
|
|
RDEPEND+=" !kde-apps/${PN}:4"
|
2014-10-15 23:19:41 +04:00
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case ${KDE_DOXYGEN} in
|
|
|
|
false) ;;
|
|
|
|
*)
|
|
|
|
IUSE+=" doc"
|
|
|
|
DEPEND+=" doc? (
|
|
|
|
$(add_frameworks_dep kapidox)
|
|
|
|
app-doc/doxygen
|
|
|
|
)"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case ${KDE_DEBUG} in
|
|
|
|
false) ;;
|
|
|
|
*)
|
|
|
|
IUSE+=" debug"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case ${KDE_EXAMPLES} in
|
|
|
|
false) ;;
|
|
|
|
*)
|
|
|
|
IUSE+=" examples"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case ${KDE_HANDBOOK} in
|
|
|
|
false) ;;
|
|
|
|
*)
|
|
|
|
IUSE+=" +handbook"
|
|
|
|
DEPEND+=" handbook? ( $(add_frameworks_dep kdoctools) )"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
case ${KDE_TEST} in
|
|
|
|
false) ;;
|
|
|
|
*)
|
|
|
|
IUSE+=" test"
|
|
|
|
DEPEND+=" test? ( >=dev-qt/qttest-${QT_MINIMAL}:5 )"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2015-03-19 17:52:45 +03:00
|
|
|
case ${KDE_SELINUX_MODULE} in
|
|
|
|
none) ;;
|
|
|
|
*)
|
|
|
|
IUSE+=" selinux"
|
2015-05-31 21:32:57 +03:00
|
|
|
RDEPEND+=" selinux? ( sec-policy/selinux-${KDE_SELINUX_MODULE} )"
|
2015-03-19 17:52:45 +03:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2014-10-15 23:19:41 +04:00
|
|
|
DEPEND+=" ${COMMONDEPEND} dev-util/desktop-file-utils"
|
|
|
|
RDEPEND+=" ${COMMONDEPEND}"
|
|
|
|
unset COMMONDEPEND
|
|
|
|
|
|
|
|
if [[ -n ${KMNAME} && ${KMNAME} != ${PN} && ${KDE_BUILD_TYPE} = release ]]; then
|
|
|
|
S=${WORKDIR}/${KMNAME}-${PV}
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Determine fetch location for released tarballs
|
|
|
|
_calculate_src_uri() {
|
|
|
|
debug-print-function ${FUNCNAME} "$@"
|
|
|
|
|
|
|
|
local _kmname
|
|
|
|
|
|
|
|
if [[ -n ${KMNAME} ]]; then
|
|
|
|
_kmname=${KMNAME}
|
|
|
|
else
|
|
|
|
_kmname=${PN}
|
|
|
|
fi
|
|
|
|
|
|
|
|
case ${PN} in
|
|
|
|
kdelibs4support | \
|
|
|
|
khtml | \
|
|
|
|
kjs | \
|
|
|
|
kjsembed | \
|
|
|
|
kmediaplayer | \
|
|
|
|
kross | \
|
|
|
|
krunner)
|
|
|
|
_kmname="portingAids/${_kmname}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
DEPEND+=" app-arch/xz-utils"
|
|
|
|
|
|
|
|
case ${CATEGORY} in
|
2015-02-11 08:49:41 +03:00
|
|
|
kde-apps)
|
|
|
|
case ${PV} in
|
|
|
|
??.?.[6-9]? | ??.??.[6-9]? )
|
|
|
|
SRC_URI="mirror://kde/unstable/applications/${PV}/src/${_kmname}-${PV}.tar.xz"
|
|
|
|
RESTRICT+=" mirror"
|
|
|
|
;;
|
2014-11-13 16:20:16 +03:00
|
|
|
*)
|
2015-02-11 08:49:41 +03:00
|
|
|
SRC_URI="mirror://kde/stable/applications/${PV}/src/${_kmname}-${PV}.tar.xz" ;;
|
2014-11-13 16:20:16 +03:00
|
|
|
esac
|
2014-10-15 23:19:41 +04:00
|
|
|
;;
|
2015-02-11 08:49:41 +03:00
|
|
|
kde-frameworks)
|
|
|
|
SRC_URI="mirror://kde/stable/frameworks/${PV%.*}/${_kmname}-${PV}.tar.xz" ;;
|
|
|
|
kde-plasma)
|
2014-10-15 23:19:41 +04:00
|
|
|
case ${PV} in
|
|
|
|
5.?.[6-9]? )
|
|
|
|
# Plasma 5 beta releases
|
|
|
|
SRC_URI="mirror://kde/unstable/plasma/${PV}/${_kmname}-${PV}.tar.xz"
|
|
|
|
RESTRICT+=" mirror"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# Plasma 5 stable releases
|
|
|
|
SRC_URI="mirror://kde/stable/plasma/${PV}/${_kmname}-${PV}.tar.xz" ;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
# Determine fetch location for live sources
|
|
|
|
_calculate_live_repo() {
|
|
|
|
debug-print-function ${FUNCNAME} "$@"
|
|
|
|
|
|
|
|
SRC_URI=""
|
|
|
|
|
|
|
|
case ${KDE_SCM} in
|
|
|
|
svn)
|
|
|
|
# @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}
|
2015-03-19 17:52:45 +03:00
|
|
|
|
2015-08-14 09:50:09 +03:00
|
|
|
local branch_prefix="trunk/KDE"
|
|
|
|
|
|
|
|
if [[ ${PV} == ??.??.49.9999 && ${CATEGORY} = kde-apps ]]; then
|
|
|
|
branch_prefix="branches/Applications/$(get_version_component_range 1-2)"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ ${PV} != 9999 && ${CATEGORY} = kde-plasma ]]; then
|
|
|
|
branch_prefix="branches/plasma/$(get_version_component_range 1-2)"
|
|
|
|
fi
|
|
|
|
|
|
|
|
local _kmname
|
2015-03-19 17:52:45 +03:00
|
|
|
|
|
|
|
if [[ -n ${KMNAME} ]]; then
|
2015-08-14 09:50:09 +03:00
|
|
|
_kmname=${KMNAME}
|
|
|
|
else
|
|
|
|
_kmname=${PN}
|
2015-03-19 17:52:45 +03:00
|
|
|
fi
|
|
|
|
|
2015-08-14 09:50:09 +03:00
|
|
|
ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/${_kmname}"
|
2014-10-15 23:19:41 +04:00
|
|
|
;;
|
|
|
|
git)
|
|
|
|
# @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:=git://anongit.kde.org}
|
|
|
|
|
|
|
|
local _kmname
|
|
|
|
|
|
|
|
# @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
|
|
|
|
|
2015-03-19 17:52:45 +03:00
|
|
|
if [[ ${PV} != 9999 && ${CATEGORY} = kde-plasma ]]; then
|
2014-10-15 23:19:41 +04:00
|
|
|
EGIT_BRANCH="Plasma/$(get_version_component_range 1-2)"
|
|
|
|
fi
|
|
|
|
|
|
|
|
EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
case ${KDE_BUILD_TYPE} in
|
|
|
|
live) _calculate_live_repo ;;
|
2015-05-31 21:32:57 +03:00
|
|
|
*) _calculate_src_uri ;;
|
2014-10-15 23:19:41 +04:00
|
|
|
esac
|
|
|
|
|
|
|
|
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
|
|
|
|
|
|
|
|
# @FUNCTION: kde5_pkg_pretend
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# Do some basic settings
|
|
|
|
kde5_pkg_pretend() {
|
|
|
|
debug-print-function ${FUNCNAME} "$@"
|
2015-09-25 17:28:08 +03:00
|
|
|
if [[ ${MERGE_TYPE} != binary ]]; then
|
|
|
|
_check_gcc_version
|
|
|
|
fi
|
2014-10-15 23:19:41 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# @FUNCTION: kde5_pkg_setup
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# Do some basic settings
|
|
|
|
kde5_pkg_setup() {
|
|
|
|
debug-print-function ${FUNCNAME} "$@"
|
2015-09-25 17:28:08 +03:00
|
|
|
if [[ ${MERGE_TYPE} != binary ]]; then
|
|
|
|
_check_gcc_version
|
|
|
|
fi
|
2014-10-15 23:19:41 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# @FUNCTION: kde5_src_unpack
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# Function for unpacking KDE 5.
|
|
|
|
kde5_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
|
|
|
|
default
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# @FUNCTION: kde5_src_prepare
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# Function for preparing the KDE 5 sources.
|
|
|
|
kde5_src_prepare() {
|
|
|
|
debug-print-function ${FUNCNAME} "$@"
|
|
|
|
|
|
|
|
# only build examples when required
|
|
|
|
if ! use_if_iuse examples || ! use examples ; then
|
|
|
|
comment_add_subdirectory examples
|
|
|
|
fi
|
|
|
|
|
|
|
|
# only enable handbook when required
|
|
|
|
if ! use_if_iuse handbook ; then
|
2015-08-14 09:50:09 +03:00
|
|
|
comment_add_subdirectory ${KDE_DOC_DIR}
|
2014-10-15 23:19:41 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# enable only the requested translations
|
|
|
|
# when required
|
|
|
|
if [[ ${KDE_BUILD_TYPE} = release ]] ; then
|
2015-06-28 15:57:33 +03:00
|
|
|
if [[ -d po ]] ; then
|
|
|
|
pushd po > /dev/null
|
2015-06-29 10:20:46 +03:00
|
|
|
for lang in *; do
|
2015-06-28 15:57:33 +03:00
|
|
|
if ! has ${lang} ${LINGUAS} ; then
|
|
|
|
if [[ ${lang} != CMakeLists.txt ]] ; then
|
|
|
|
rm -rf ${lang}
|
|
|
|
fi
|
|
|
|
if [[ -e CMakeLists.txt ]] ; then
|
|
|
|
comment_add_subdirectory ${lang}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
popd > /dev/null
|
|
|
|
fi
|
2015-04-12 08:44:26 +03:00
|
|
|
|
2015-09-02 17:45:23 +03:00
|
|
|
if [[ ${KDE_HANDBOOK} = true && -d ${KDE_DOC_DIR} && ${CATEGORY} != kde-apps ]] ; then
|
2015-08-14 09:50:09 +03:00
|
|
|
pushd ${KDE_DOC_DIR} > /dev/null
|
2015-06-29 10:20:46 +03:00
|
|
|
for lang in *; do
|
2015-04-12 08:44:26 +03:00
|
|
|
if ! has ${lang} ${LINGUAS} ; then
|
|
|
|
comment_add_subdirectory ${lang}
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
popd > /dev/null
|
|
|
|
fi
|
2014-10-15 23:19:41 +04:00
|
|
|
else
|
|
|
|
rm -rf po
|
|
|
|
fi
|
|
|
|
|
|
|
|
# in frameworks, tests = manual tests so never
|
|
|
|
# build them
|
|
|
|
if [[ ${CATEGORY} = kde-frameworks ]]; then
|
|
|
|
comment_add_subdirectory tests
|
|
|
|
fi
|
|
|
|
|
2015-05-09 19:07:54 +03:00
|
|
|
if [[ ${CATEGORY} = kde-frameworks || ${CATEGORY} = kde-plasma || ${CATEGORY} = kde-apps ]] ; then
|
|
|
|
# only build unit tests when required
|
|
|
|
if ! use_if_iuse test ; then
|
|
|
|
comment_add_subdirectory autotests
|
2015-08-27 15:41:21 +03:00
|
|
|
comment_add_subdirectory test
|
2015-05-09 19:07:54 +03:00
|
|
|
comment_add_subdirectory tests
|
|
|
|
fi
|
2014-10-15 23:19:41 +04:00
|
|
|
fi
|
|
|
|
|
2015-05-09 19:07:54 +03:00
|
|
|
case ${KDE_PUNT_BOGUS_DEPS} in
|
|
|
|
false) ;;
|
|
|
|
*)
|
|
|
|
if ! use_if_iuse test ; then
|
|
|
|
punt_bogus_dep Qt5 Test
|
|
|
|
fi
|
|
|
|
if ! use_if_iuse handbook ; then
|
|
|
|
punt_bogus_dep KF5 DocTools
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2014-10-15 23:19:41 +04:00
|
|
|
|
|
|
|
cmake-utils_src_prepare
|
|
|
|
}
|
|
|
|
|
|
|
|
# @FUNCTION: kde5_src_configure
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# Function for configuring the build of KDE 5.
|
|
|
|
kde5_src_configure() {
|
|
|
|
debug-print-function ${FUNCNAME} "$@"
|
|
|
|
|
|
|
|
# we rely on cmake-utils.eclass to append -DNDEBUG too
|
|
|
|
if ! use_if_iuse debug; then
|
|
|
|
append-cppflags -DQT_NO_DEBUG
|
|
|
|
fi
|
|
|
|
|
|
|
|
local cmakeargs
|
|
|
|
|
|
|
|
if ! use_if_iuse test ; then
|
|
|
|
cmakeargs+=( -DBUILD_TESTING=OFF )
|
|
|
|
fi
|
|
|
|
|
|
|
|
# install mkspecs in the same directory as qt stuff
|
|
|
|
cmakeargs+=(-DKDE_INSTALL_USE_QT_SYS_PATHS=ON)
|
|
|
|
|
|
|
|
# allow the ebuild to override what we set here
|
|
|
|
mycmakeargs=("${cmakeargs[@]}" "${mycmakeargs[@]}")
|
|
|
|
|
|
|
|
cmake-utils_src_configure
|
|
|
|
}
|
|
|
|
|
|
|
|
# @FUNCTION: kde5_src_compile
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# Function for compiling KDE 5.
|
|
|
|
kde5_src_compile() {
|
|
|
|
debug-print-function ${FUNCNAME} "$@"
|
|
|
|
|
|
|
|
cmake-utils_src_compile "$@"
|
|
|
|
|
|
|
|
# Build doxygen documentation if applicable
|
|
|
|
if use_if_iuse doc ; then
|
|
|
|
kgenapidox . || die
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# @FUNCTION: kde5_src_test
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# Function for testing KDE 5.
|
|
|
|
kde5_src_test() {
|
|
|
|
debug-print-function ${FUNCNAME} "$@"
|
|
|
|
|
|
|
|
_test_runner() {
|
|
|
|
if [[ -n "${VIRTUALDBUS_TEST}" ]]; then
|
|
|
|
export $(dbus-launch)
|
|
|
|
fi
|
|
|
|
|
|
|
|
cmake-utils_src_test
|
2015-04-12 08:44:26 +03:00
|
|
|
}
|
2014-10-15 23:19:41 +04:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
if [[ ${VIRTUALX_REQUIRED} = always || ${VIRTUALX_REQUIRED} = test ]]; then
|
|
|
|
VIRTUALX_COMMAND="_test_runner" virtualmake
|
|
|
|
else
|
|
|
|
_test_runner
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -n "${DBUS_SESSION_BUS_PID}" ]] ; then
|
|
|
|
kill ${DBUS_SESSION_BUS_PID}
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# @FUNCTION: kde5_src_install
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# Function for installing KDE 5.
|
|
|
|
kde5_src_install() {
|
|
|
|
debug-print-function ${FUNCNAME} "$@"
|
|
|
|
|
|
|
|
# Install doxygen documentation if applicable
|
|
|
|
if use_if_iuse doc ; then
|
|
|
|
dodoc -r apidocs/html
|
|
|
|
fi
|
|
|
|
|
|
|
|
cmake-utils_src_install
|
2015-08-04 09:00:07 +03:00
|
|
|
|
|
|
|
# We don't want ${PREFIX}/share/doc/HTML to be compressed,
|
|
|
|
# because then khelpcenter can't find the docs
|
|
|
|
if [[ -d ${ED}/${PREFIX}/share/doc/HTML ]]; then
|
|
|
|
docompress -x ${PREFIX}/share/doc/HTML
|
|
|
|
fi
|
2014-10-15 23:19:41 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# @FUNCTION: kde5_pkg_preinst
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# Function storing icon caches
|
|
|
|
kde5_pkg_preinst() {
|
|
|
|
debug-print-function ${FUNCNAME} "$@"
|
|
|
|
|
|
|
|
gnome2_icon_savelist
|
|
|
|
}
|
|
|
|
|
|
|
|
# @FUNCTION: kde5_pkg_postinst
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# Function to rebuild the KDE System Configuration Cache after an application has been installed.
|
|
|
|
kde5_pkg_postinst() {
|
|
|
|
debug-print-function ${FUNCNAME} "$@"
|
|
|
|
|
|
|
|
gnome2_icon_cache_update
|
|
|
|
fdo-mime_desktop_database_update
|
|
|
|
}
|
|
|
|
|
|
|
|
# @FUNCTION: kde5_pkg_postrm
|
|
|
|
# @DESCRIPTION:
|
|
|
|
# Function to rebuild the KDE System Configuration Cache after an application has been removed.
|
|
|
|
kde5_pkg_postrm() {
|
|
|
|
debug-print-function ${FUNCNAME} "$@"
|
|
|
|
|
|
|
|
gnome2_icon_cache_update
|
|
|
|
fdo-mime_desktop_database_update
|
|
|
|
}
|
|
|
|
|
|
|
|
fi
|