* [gentoo-dev] KDE4 eclasses review
@ 2011-04-04 17:00 Tomáš Chvátal
2011-04-05 15:38 ` Marc Schiffbauer
0 siblings, 1 reply; 2+ messages in thread
From: Tomáš Chvátal @ 2011-04-04 17:00 UTC (permalink / raw
To: Gentoo Development
[-- Attachment #1.1: Type: text/plain, Size: 721 bytes --]
Hi guys,
since we didn't do this for quite long time I would like kde4 eclasses
reviewed as whole rather than on patch basis (altho i attach the patches
for convenience too).
It is 2 years since we reviewed them last time fully on -dev so lets see
how much weird/useless logic we can find (more heads know more).
Remember: nitpick on everything cause this thing is used in quite a lot
ebuilds so we need it in top-notch shape :)
This update brings support for git since upstream is slowly moving to
git repos from SVN. Dropped support for eapi2. Usage of fdo/gnome
classes to update mime stuff. Most of the koffice code removed as being
obsoleted and various loads of whitespace stuff.
Cheers
Tom
[-- Attachment #1.2: kde4-base.eclass --]
[-- Type: text/plain, Size: 31700 bytes --]
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# @ECLASS: kde4-base.eclass
# @MAINTAINER:
# kde@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 "3". This will be reviewed
# over time as new EAPI versions are approved.
# @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 fdo-mime gnome2-utils base virtualx versionator eutils
if [[ ${BUILD_TYPE} = live ]]; then
case ${KDE_SCM} in
svn) inherit subversion ;;
git) inherit git ;;
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
# Verify KDE_MINIMAL (display QA notice in pkg_setup, still we need to fix it here)
if [[ -n ${KDE_MINIMAL} ]]; then
for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
[[ ${KDE_MINIMAL} = ${slot} ]] && KDE_MINIMAL_VALID=1 && break
done
unset slot
[[ -z ${KDE_MINIMAL_VALID} ]] && unset KDE_MINIMAL
else
KDE_MINIMAL_VALID=1
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.
# For possible values look at KDE_SLOTS and KDE_LIVE_SLOTS variables.
# Note that it is fixed to ${SLOT} for kde-base packages.
KDE_MINIMAL="${KDE_MINIMAL:-4.4}"
# Set slot for KDEBASE known packages
case ${KDEBASE} in
kde-base)
major=$(get_major_version)
minor=$(get_version_component_range 2)
micro=$(get_version_component_range 3)
# Determine SLOT from PVs
[[ ${PV} == 9999* ]] && SLOT=live # regular live
[[ ${major} -eq 4 && ${micro} == 9999 ]] && SLOT=${major}.${minor} # stable live
if [[ ${major} -eq 4 && ${micro} != 9999 ]]; then
[[ ${micro} -lt 60 ]] && \
SLOT=${major}.${minor}
[[ ${micro} -ge 60 ]] &&
SLOT=${major}.$(($minor + 1))
fi
[[ -z ${SLOT} ]] && die "Unsupported ${PV}"
KDE_MINIMAL="${SLOT}"
;;
koffice)
SLOT="2"
;;
kdevelop)
if [[ ${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:-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:-9999}"
else
case ${PN} in
kdevelop|quanta)
KDEVELOP_VERSION=${PV}
KDEVPLATFORM_VERSION="$(($(get_major_version)-3)).$(get_after_major_version)"
;;
kdevplatform)
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 src_unpack src_prepare ${export_fns} pkg_preinst pkg_postinst pkg_postrm
unset buildsystem_eclass
unset export_fns
# @ECLASS-VARIABLE: DECLARATIVE_REQUIRED
# @DESCRIPTION:
# Is qt-declarative 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: QTHELP_REQUIRED
# @DESCRIPTION:
# Is qt-assistant 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 qt-opengl 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 qt-multimedia 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: WEBKIT_REQUIRED
# @DESCRIPTION:
# Is qt-webkit requred? 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 [[ ${BUILD_TYPE} == live && -z ${KDE_LINGUAS_LIVE_OVERRIDE} && ${KDEBASE} != "kde-base" ]]; then
KDE_HANDBOOK=never
KDE_LINGUAS=""
fi
# Setup packages inheriting this eclass
case ${KDEBASE} in
kde-base)
HOMEPAGE="http://www.kde.org/"
LICENSE="GPL-2"
if [[ $BUILD_TYPE = live ]]; then
# Disable tests for live ebuilds
RESTRICT+=" test"
# Live ebuilds in kde-base default to kdeprefix by default
IUSE+=" +kdeprefix"
else
# All other ebuild types default to -kdeprefix as before
IUSE+=" kdeprefix"
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]?)
RESTRICT+=" mirror"
;;
esac
# Block installation of other SLOTS unless kdeprefix
RDEPEND+=" $(block_other_slots)"
;;
koffice)
HOMEPAGE="http://www.koffice.org/"
LICENSE="GPL-2"
;;
kdevelop)
HOMEPAGE="http://www.kdevelop.org/"
LICENSE="GPL-2"
;;
esac
# @ECLASS-VARIABLE: QT_MINIMAL
# @DESCRIPTION:
# Determine version of qt we enforce as minimal for the package.
if slot_is_at_least 4.6 "${KDE_MINIMAL}"; then
QT_MINIMAL="${QT_MINIMAL:-4.7.0}"
else
QT_MINIMAL="${QT_MINIMAL:-4.6.3}"
fi
# Declarative dependencies
qtdeclarativedepend="
>=x11-libs/qt-declarative-${QT_MINIMAL}:4
"
case ${DECLARATIVE_REQUIRED} in
always)
COMMONDEPEND+=" ${qtdeclarativedepend}"
;;
optional)
IUSE+=" declarative"
COMMONDEPEND+=" declarative? ( ${qtdeclarativedepend} )"
;;
*) ;;
esac
unset qtdeclarativedepend
# QtHelp dependencies
qthelpdepend="
>=x11-libs/qt-assistant-${QT_MINIMAL}:4
"
case ${QTHELP_REQUIRED} in
always)
COMMONDEPEND+=" ${qthelpdepend}"
;;
optional)
IUSE+=" qthelp"
COMMONDEPEND+=" qthelp? ( ${qthelpdepend} )"
;;
esac
unset qthelpdepend
# OpenGL dependencies
qtopengldepend="
>=x11-libs/qt-opengl-${QT_MINIMAL}:4
"
case ${OPENGL_REQUIRED} in
always)
COMMONDEPEND+=" ${qtopengldepend}"
;;
optional)
IUSE+=" opengl"
COMMONDEPEND+=" opengl? ( ${qtopengldepend} )"
;;
*) ;;
esac
unset qtopengldepend
# MultiMedia dependencies
qtmultimediadepend="
>=x11-libs/qt-multimedia-${QT_MINIMAL}:4
"
case ${MULTIMEDIA_REQUIRED} in
always)
COMMONDEPEND+=" ${qtmultimediadepend}"
;;
optional)
IUSE+=" multimedia"
COMMONDEPEND+=" multimedia? ( ${qtmultimediadepend} )"
;;
*) ;;
esac
unset qtmultimediadepend
# WebKit dependencies
case ${KDE_REQUIRED} in
always)
qtwebkitusedeps="[kde]"
;;
optional)
qtwebkitusedeps="[kde?]"
;;
*) ;;
esac
qtwebkitdepend="
>=x11-libs/qt-webkit-${QT_MINIMAL}:4${qtwebkitusedeps}
"
unset qtwebkitusedeps
case ${WEBKIT_REQUIRED} in
always)
COMMONDEPEND+=" ${qtwebkitdepend}"
;;
optional)
IUSE+=" webkit"
COMMONDEPEND+=" webkit? ( ${qtwebkitdepend} )"
;;
*) ;;
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
kdecommondepend="
dev-lang/perl
>=x11-libs/qt-core-${QT_MINIMAL}:4[qt3support,ssl]
>=x11-libs/qt-gui-${QT_MINIMAL}:4[accessibility,dbus]
>=x11-libs/qt-qt3support-${QT_MINIMAL}:4[accessibility,kde]
>=x11-libs/qt-script-${QT_MINIMAL}:4
>=x11-libs/qt-sql-${QT_MINIMAL}:4[qt3support]
>=x11-libs/qt-svg-${QT_MINIMAL}:4
>=x11-libs/qt-test-${QT_MINIMAL}:4
!aqua? (
x11-libs/libXext
x11-libs/libXt
x11-libs/libXxf86vm
)
"
if [[ ${PN} != kdelibs ]]; then
kdecommondepend+=" $(add_kdebase_dep kdelibs)"
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}
"
;;
*) ;;
esac
fi
fi
fi
kdedepend="
dev-util/automoc
dev-util/pkgconfig
!aqua? (
>=x11-libs/libXtst-1.1.0
x11-proto/xf86vidmodeproto
)
"
kderdepend=""
# all packages needs oxygen icons for basic iconset
if [[ ${PN} != oxygen-icons ]]; then
kderdepend+=" $(add_kdebase_dep oxygen-icons)"
fi
# add a dependency over kde-l10n if EAPI4 is around
if [[ ${KDEBASE} != "kde-base" ]] && [[ -n ${KDE_LINGUAS} ]] && has "${EAPI:-0}" 4; then
usedep=''
for _lingua in ${KDE_LINGUAS}; do
[[ -n ${usedep} ]] && usedep+=","
usedep+="linguas_${_lingua}(+)?"
done
# if our package has lignuas pull in kde-l10n with selected lingua
kderdepend+=" $(add_kdebase_dep kde-l10n ${usedep})"
unset usedep _lingua
fi
kdehandbookdepend="
app-text/docbook-xml-dtd:4.2
app-text/docbook-xsl-stylesheets
"
kdehandbookrdepend="
$(add_kdebase_dep kdelibs '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_REQUIRED} in
always)
IUSE+=" aqua"
[[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" ${kdecommondepend}"
[[ -n ${kdedepend} ]] && DEPEND+=" ${kdedepend}"
[[ -n ${kderdepend} ]] && RDEPEND+=" ${kderdepend}"
;;
optional)
IUSE+=" aqua 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
# Add experimental kdeenablefinal, masked by default
IUSE+=" kdeenablefinal"
# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a
# koffice 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
# fixup kdebase-apps name
case ${KMNAME} in
kdebase-apps)
_kmname="kdebase" ;;
*)
_kmname="${KMNAME}" ;;
esac
else
_kmname=${PN}
fi
_kmname_pv="${_kmname}-${PV}"
case ${KDEBASE} in
kde-base)
case ${PV} in
4.[456].8[05] | 4.[456].9[023568] | 4.5.94.1)
# Unstable KDE SC releases
SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2"
# KDEPIM IS SPECIAL
[[ ${KMNAME} == "kdepim" || ${KMNAME} == "kdepim-runtime" ]] && SRC_URI="mirror://kde/unstable/kdepim/${PV}/src/${_kmname_pv}.tar.bz2"
;;
4.4.[6789] | 4.4.1?)
# Stable kdepim releases
SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2"
;;
*)
# Stable KDE SC releases
SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2"
;;
esac
;;
koffice)
case ${PV} in
2.[1234].[6-9]*) SRC_URI="mirror://kde/unstable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
*) SRC_URI="mirror://kde/stable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
esac
;;
kdevelop)
SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2"
;;
esac
}
_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/${SLOT}"
# @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}"
;;
koffice)
ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
;;
*)
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 and koffice modules. Does not affect misc apps.
# Default value is 1 hour.
[[ ${KDEBASE} = kde-base || ${KDEBASE} = koffice ]] && 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:=git://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
case ${PV} in
9999*) ;;
*)
# set EGIT_BRANCH and EGIT_COMMIT to ${SLOT}
case ${_kmname} in
kdeplasma-addons | kdepim | kdepim-runtime | kdepimlibs)
EGIT_BRANCH="${SLOT}"
;;
*) EGIT_BRANCH="KDE/${SLOT}" ;;
esac
;;
esac
case $_kmname in
kdepim|kdepim-runtime)
case ${PV} in
# kdepim still did not branch
4.6.9999)
EGIT_BRANCH="master"
;;
esac
;;
esac
EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}"
EGIT_PROJECT="${_kmname}"
debug-print "${FUNCNAME}: Repository: ${EGIT_REPO_URI}"
debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}"
;;
esac
}
case ${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 (KDEDIR) by default.
# No matter the PREFIX, package will be built against KDE installed in KDEDIR.
# @FUNCTION: kde4-base_pkg_setup
# @DESCRIPTION:
# Do the basic kdeprefix KDEDIR settings and determine with which kde should
# optional applications link
kde4-base_pkg_setup() {
debug-print-function ${FUNCNAME} "$@"
# QA ebuilds
[[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})."
# Don't set KDEHOME during compilation, it will cause access violations
unset KDEHOME
if [[ ${KDEBASE} = kde-base ]]; then
if use kdeprefix; then
KDEDIR=/usr/kde/${SLOT}
else
KDEDIR=/usr
fi
: ${PREFIX:=${KDEDIR}}
else
# Determine KDEDIR by loooking for the closest match with KDE_MINIMAL
KDEDIR=
local kde_minimal_met
for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
[[ -z ${kde_minimal_met} ]] && [[ ${slot} = ${KDE_MINIMAL} ]] && kde_minimal_met=1
if [[ -n ${kde_minimal_met} ]] && has_version "kde-base/kdelibs:${slot}"; then
if has_version "kde-base/kdelibs:${slot}[kdeprefix]"; then
KDEDIR=/usr/kde/${slot}
else
KDEDIR=/usr
fi
break;
fi
done
unset slot
# Bail out if kdelibs required but not found
if [[ ${KDE_REQUIRED} = always ]] || { [[ ${KDE_REQUIRED} = optional ]] && use kde; }; then
[[ -z ${KDEDIR} ]] && die "Failed to determine KDEDIR!"
else
[[ -z ${KDEDIR} ]] && KDEDIR=/usr
fi
: ${PREFIX:=/usr}
fi
EKDEDIR=${EPREFIX}${KDEDIR}
# Point pkg-config path to KDE *.pc files
export PKG_CONFIG_PATH="${EKDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
# Point to correct QT plugins path
QT_PLUGIN_PATH="${EKDEDIR}/$(get_libdir)/kde4/plugins/"
# Fix XDG collision with sandbox
export XDG_CONFIG_HOME="${T}"
}
# @FUNCTION: kde4-base_src_unpack
# @DESCRIPTION:
# This function unpacks the source tarballs for KDE4 applications.
kde4-base_src_unpack() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${BUILD_TYPE} = live ]]; then
case ${KDE_SCM} in
svn)
migrate_store_dir
subversion_src_unpack
;;
git)
git_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
# kde-l10n inherits kde4-base but is metpackage, so no check for doc
# kdelibs inherits kde4-base but handle installing the handbook itself
if ! has kde4-meta ${INHERITED} && has handbook ${IUSE//+}; then
if [[ ${KDEBASE} == kde-base ]]; then
if [[ ${PN} != kde-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 [[ ${BUILD_TYPE} = live ]]; then
case ${KDE_SCM} in
svn) subversion_src_prepare ;;
esac
fi
# Apply patches
base_src_prepare
# Save library dependencies
if [[ -n ${KMSAVELIBS} ]] ; then
save_library_dependencies
fi
# Inject library dependencies
if [[ -n ${KMLOADLIBS} ]] ; then
load_library_dependencies
fi
# Replace KDE4Workspace library targets
find "${S}" -name CMakeLists.txt \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_TASKMANAGER_(LIBRARY|LIBS)\}/taskmanager/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KWORKSPACE_(LIBRARY|LIBS)\}/kworkspace/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROLIFACES_(LIBRARY|LIBS)\}/solidcontrolifaces/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROL_(LIBRARY|LIBS)\}/solidcontrol/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_PROCESSUI_(LIBRARY|LIBS)\}/processui/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_LSOFUI_(LIBRARY|LIBS)\}/lsofui/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_PLASMACLOCK_(LIBRARY|LIBS)\}/plasmaclock/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERYCLIENT_(LIBRARY|LIBS)\}/nepomukqueryclient/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERY_(LIBRARY|LIBS)\}/nepomukquery/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSCREENSAVER_(LIBRARY|LIBS)\}/kscreensaver/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_WEATHERION_(LIBRARY|LIBS)\}/weather_ion/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KWINEFFECTS_(LIBRARY|LIBS)\}/kwineffects/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KDECORATIONS_(LIBRARY|LIBS)\}/kdecorations/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSGRD_(LIBRARY|LIBS)\}/ksgrd/g' {} + \
-exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KEPHAL_(LIBRARY|LIBS)\}/kephal/g' {} + \
|| die 'failed to replace KDE4Workspace library targets'
# Hack for manuals relying on outdated DTD, only outside kde-base/koffice/...
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 has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then
cmakeargs+=(-DKDE4_ENABLE_FINAL=ON)
fi
if has debug ${IUSE//+} && use debug; then
# Set "real" debug mode
CMAKE_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 /usr installations
unset KDEDIRS
# Handle kdeprefix-ed KDE
if [[ ${KDEDIR} != /usr ]]; then
# Override some environment variables - only when kdeprefix is different,
# to not break ccache/distcc
PATH="${EKDEDIR}/bin:${PATH}"
# Append library search path
append-ldflags -L"${EKDEDIR}/$(get_libdir)"
# Append full RPATH
cmakeargs+=(-DCMAKE_SKIP_RPATH=OFF)
# Set cmake prefixes to allow buildsystem to locate valid KDE installation
# when more are present
cmakeargs+=(-DCMAKE_SYSTEM_PREFIX_PATH="${EKDEDIR}")
fi
#qmake -query QT_INSTALL_LIBS unavailable when cross-compiling
tc-is-cross-compiler && cmakeargs+=(-DQT_LIBRARY_DIR=${ROOT}/usr/lib/qt4)
#kde-config -path data unavailable when cross-compiling
tc-is-cross-compiler && cmakeargs+=(-DKDE4_DATA_DIR=${ROOT}/usr/share/apps/)
# Handle kdeprefix in application itself
if ! has kdeprefix ${IUSE//+} || ! use kdeprefix; then
# If prefix is /usr, sysconf needs to be /etc, not /usr/etc
cmakeargs+=(-DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc)
fi
if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then
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} "$@"
# Override this value, set in kde4-base_src_configure()
mycmakeargs+=(-DKDE4_BUILD_TESTS=ON)
cmake-utils_src_configure
kde4-base_src_compile
# 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
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."
cmake-utils_src_test
else
VIRTUALX_COMMAND="cmake-utils_src_test" virtualmake
fi
else
cmake-utils_src_test
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
}
# @FUNCTION: kde4-base_pkg_preinst
# @DESCRIPTION:
# Function storing icon caches
kde4-base_pkg_preinst() {
debug-print-function ${FUNCNAME} "$@"
gnome2_icon_savelist
}
# @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} "$@"
gnome2_icon_cache_update
fdo-mime_desktop_database_update
fdo-mime_mime_database_update
buildsycoca
if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
if has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then
echo
ewarn "WARNING! you have kdeenable final useflag enabled."
ewarn "This useflag needs to be enabled on ALL kde using packages and"
ewarn "is known to cause issues."
ewarn "You are using this setup at your own risk and the kde team does not"
ewarn "take responsibilities for dead kittens."
echo
fi
if [[ ${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
elif [[ ${BUILD_TYPE} != live ]] && has kdeprefix ${IUSE//+} && use kdeprefix; then
# warning about kdeprefix for non-live users
echo
ewarn "WARNING! You have the kdeprefix useflag enabled."
ewarn "This setting is strongly discouraged and might lead to potential trouble"
ewarn "with KDE update strategies."
ewarn "You are using this setup at your own risk and the kde team does not"
ewarn "take responsibilities for dead kittens."
echo
fi
# for all 3rd party soft tell user that he SHOULD install kdebase-startkde or kdebase-runtime-meta
if [[ ${KDEBASE} != kde-base ]] && \
! has_version 'kde-base/kdebase-runtime-meta' && \
! has_version 'kde-base/kdebase-startkde'; then
if [[ ${KDE_REQUIRED} == always ]] || ( [[ ${KDE_REQUIRED} == optional ]] && use kde ); then
echo
ewarn "WARNING! Your system configuration contains neither \"kde-base/kdebase-runtime-meta\""
ewarn "nor \"kde-base/kdebase-startkde\". You need one of above."
ewarn "With this setting you are unsupported by KDE team."
ewarn "All missing features you report for misc packages will be probably ignored or closed as INVALID."
fi
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} "$@"
gnome2_icon_cache_update
fdo-mime_desktop_database_update
fdo-mime_mime_database_update
buildsycoca
}
[-- Attachment #1.3: kde4-functions.eclass --]
[-- Type: text/plain, Size: 20363 bytes --]
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.41 2010/12/29 17:56:34 tampakrap Exp $
inherit versionator
# @ECLASS: kde4-functions.eclass
# @MAINTAINER:
# kde@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.
# @ECLASS-VARIABLE: EAPI
# @DESCRIPTION:
# Currently kde4 eclasses support EAPI 3 and 4.
case ${EAPI:-0} in
4|3) : ;;
*) die "EAPI=${EAPI} 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
# koffice ebuild.
if [[ ${CATEGORY} = kde-base ]]; then
debug-print "${ECLASS}: KDEBASE ebuild recognized"
KDEBASE=kde-base
elif [[ ${KMNAME-${PN}} = koffice ]]; then
debug-print "${ECLASS}: KOFFICE ebuild recognized"
KDEBASE=koffice
elif [[ ${KMNAME-${PN}} = kdevelop ]]; then
debug-print "${ECLASS}: KDEVELOP ebuild recognized"
KDEBASE=kdevelop
fi
# @ECLASS-VARIABLE: KDE_SLOTS
# @DESCRIPTION:
# The slots used by all KDE versions later than 4.0. The live KDE releases use
# KDE_LIVE_SLOTS instead. Values should be ordered.
KDE_SLOTS=( "4.1" "4.2" "4.3" "4.4" "4.5" "4.6" )
# @ECLASS-VARIABLE: KDE_LIVE_SLOTS
# @DESCRIPTION:
# The slots used by KDE live versions. Values should be ordered.
KDE_LIVE_SLOTS=( "live" )
# determine the build type
if [[ ${SLOT} = live || ${PV} = *9999* ]]; then
BUILD_TYPE="live"
else
BUILD_TYPE="release"
fi
export BUILD_TYPE
# Set reponame and SCM for moduleses that have fully migrated to git
# (hack - it's here because it needs to be before SCM inherits from kde4-base)
if [[ ${BUILD_TYPE} == live ]]; then
case "${KMNAME}" in
kdebase-workspace)
KDE_SCM="git"
EGIT_REPONAME=${EGIT_REPONAME:=kde-workspace}
;;
kdebase-runtime)
KDE_SCM="git"
EGIT_REPONAME=${EGIT_REPONAME:=kde-runtime}
;;
kdebase-apps)
KDE_SCM="git"
EGIT_REPONAME=${EGIT_REPONAME:=kde-baseapps}
;;
esac
fi
# @ECLASS-VARIABLE: KDE_SCM
# @DESCRIPTION:
# If this is a live package which scm does it use
# Everything else uses svn by default
KDE_SCM="${KDE_SCM:-svn}"
case ${KDE_SCM} in
svn|git) ;;
*) die "KDE_SCM: ${KDE_SCM} is not supported" ;;
esac
# @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="en_GB de nl"
if [[ ${BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
for _lingua in ${KDE_LINGUAS}; do
IUSE="${IUSE} linguas_${_lingua}"
done
fi
# @FUNCTION: slot_is_at_least
# @USAGE: <want> <have>
# @DESCRIPTION:
# Version aware slot comparator.
# Current implementation relies on the fact, that slots can be compared like
# string literals (and let's keep it this way).
slot_is_at_least() {
[[ "${2}" > "${1}" || "${2}" = "${1}" ]]
}
# @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 share/{config,kde4}; do
[[ ${KDEDIR} == /usr ]] && DIRS=${EROOT}usr || DIRS="${EROOT}usr ${EROOT}${KDEDIR}"
for y in ${DIRS}; do
[[ -d "${y}/${x}" ]] || break # nothing to do if directory does not exist
if [[ $(stat --format=%a "${y}/${x}") != 755 ]]; then
ewarn "QA Notice:"
ewarn "Package ${PN} is breaking ${y}/${x} permissions."
ewarn "Please report this issue to gentoo bugzilla."
einfo "Permissions will get adjusted automatically now."
find "${y}/${x}" -type d -print0 | xargs -0 chmod 755
fi
done
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 LINGUAS 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
# if there is no linguas defined we enable everything
if ! $(env | grep -q "^LINGUAS="); then
return 0
fi
# @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 linguas enabled doc folders.
enable_selected_doc_linguas() {
debug-print-function ${FUNCNAME} "$@"
# if there is no linguas defined we enable everything
if ! $(env | grep -q "^LINGUAS="); then
return 0
fi
# @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}"
# Add requested translations
local lingua
for lingua in en ${KDE_LINGUAS}; do
if [[ ${lingua} = en ]] || use linguas_${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}"
}
# @FUNCTION: migrate_store_dir
# @DESCRIPTION:
# Universal store dir migration
# * performs split of kdebase to kdebase-apps when needed
# * moves playground/extragear kde4-base-style to toplevel dir
migrate_store_dir() {
if [[ ${KDE_SCM} != svn ]]; then
die "migrate_store_dir() only makes sense for subversion"
fi
local cleandir="${ESVN_STORE_DIR}/KDE"
if [[ -d ${cleandir} ]]; then
ewarn "'${cleandir}' has been found. Moving contents to new location."
addwrite "${ESVN_STORE_DIR}"
# Split kdebase
local module
if pushd "${cleandir}"/kdebase/kdebase > /dev/null; then
for module in `find . -maxdepth 1 -type d -name [a-z0-9]\*`; do
module="${module#./}"
mkdir -p "${ESVN_STORE_DIR}/kdebase-${module}" && mv -f "${module}" "${ESVN_STORE_DIR}/kdebase-${module}" || \
die "Failed to move to '${ESVN_STORE_DIR}/kdebase-${module}'."
done
popd > /dev/null
rm -fr "${cleandir}/kdebase" || \
die "Failed to remove ${cleandir}/kdebase. You need to remove it manually."
fi
# Move the rest
local pkg
for pkg in "${cleandir}"/*; do
mv -f "${pkg}" "${ESVN_STORE_DIR}"/ || eerror "Failed to move '${pkg}'"
done
rmdir "${cleandir}" || die "Could not move obsolete KDE store dir. Please move '${cleandir}' contents to appropriate location (possibly ${ESVN_STORE_DIR}) and manually remove '${cleandir}' in order to continue."
fi
if ! hasq kde4-meta ${INHERITED}; then
case ${KMNAME} in
extragear*|playground*)
local scmlocalpath="${ESVN_STORE_DIR}"/"${KMNAME}"/"${PN}"
if [[ -d "${scmlocalpath}" ]]; then
local destdir="${ESVN_STORE_DIR}"/"${ESVN_PROJECT}"/"`basename "${ESVN_REPO_URI}"`"
ewarn "'${scmlocalpath}' has been found."
ewarn "Moving contents to new location: ${destdir}"
addwrite "${ESVN_STORE_DIR}"
mkdir -p "${ESVN_STORE_DIR}"/"${ESVN_PROJECT}" && mv -f "${scmlocalpath}" "${destdir}" \
|| die "Failed to move to '${scmlocalpath}'"
# Try cleaning empty directories
rmdir "`dirname "${scmlocalpath}"`" 2> /dev/null
fi
;;
esac
fi
}
# Functions handling KMLOADLIBS and KMSAVELIBS
# @FUNCTION: save_library_dependencies
# @DESCRIPTION:
# Add exporting CMake dependencies for current package
save_library_dependencies() {
local depsfile="${T}/${PN}:${SLOT}"
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}:${SLOT}"
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}:${SLOT}"
[[ -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: block_other_slots
# @DESCRIPTION:
# Create blocks for the current package in other slots when
# installed with USE=-kdeprefix
block_other_slots() {
debug-print-function ${FUNCNAME} "$@"
_do_blocker ${PN} 0:${SLOT}
}
# @FUNCTION: add_blocker
# @DESCRIPTION:
# Create correct RDEPEND value for blocking correct package.
# Useful for file-collision blocks.
# Parameters are package and version(s) to block.
# add_blocker kdelibs 4.2.4
# If no version is specified, then all versions will be blocked
# If any arguments (from 2 on) contain a ":", then different versions
# are blocked in different slots. (Unlisted slots get the version without
# a ":", if none, then all versions are blocked). The parameter is then of
# the form VERSION:SLOT. Any VERSION of 0 means that no blocker will be
# added for that slot (or, if no slot, then for any unlisted slot).
# A parameter of the form :SLOT means to block all versions from that slot.
# If VERSION begins with "<", then "!<foo" will be used instead of "!<=foo".
# As a special case, if a parameter with slot "3.5" is passed, then that slot
# may also be blocked.
#
# Versions that match "4.x.50" are equivalent to all slots up to (and including)
# "4.x", but nothing following slot "4.x"
#
# As an example, if SLOT=live, then
# add_blocker kdelibs 0 :4.3 '<4.3.96:4.4' 9999:live
# will add the following to RDEPEND:
# !kdeprefix? ( !kde-base/kdelibs:4.3[-kdeprefix] )
# !kdeprefix? ( !<kde-base/kdelibs-4.3.96:4.4[-kdeprefix] )
# !<=kde-base/kdelibs-9999:live
add_blocker() {
debug-print-function ${FUNCNAME} "$@"
RDEPEND+=" $(_do_blocker "$@")"
}
# @FUNCTION: add_kdebase_dep
# @DESCRIPTION:
# Create proper dependency for kde-base/ dependencies, adding SLOT when needed
# (and *only* when needed).
# 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 ${3} ]]; then
ver=${3}
elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then
ver=${KDE_OVERRIDE_MINIMAL}
elif [[ ${KDEBASE} != kde-base ]]; then
ver=${KDE_MINIMAL}
# FIXME remove hack when kdepim-4.4.* is gone
elif [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && ${PV} == 4.4.[6-8] && ${1} =~ ^kde(pim)?libs$ ]]; then
ver=4.4.5
# FIXME remove hack when kdepim-4.6beta is gone
elif [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && ${PV} == 4.5.98 && ${1} =~ ^(kde(pim)?libs|oxygen-icons)$ ]]; then
ver=4.5.90
# if building stable-live version depend just on slot
# to allow merging packages against more stable basic stuff
elif [[ ${PV} == *.9999 ]]; then
ver=${SLOT}
else
ver=${PV}
fi
[[ -z ${1} ]] && die "Missing parameter"
local use=${2:+,${2}}
if [[ ${KDEBASE} = kde-base ]]; then
echo " !kdeprefix? ( >=kde-base/${1}-${ver}[aqua=,-kdeprefix${use}] )"
echo " kdeprefix? ( >=kde-base/${1}-${ver}:${SLOT}[aqua=,kdeprefix${use}] )"
elif [[ ${ver} == live ]]; then
echo " kde-base/${1}:live[aqua=${use}]"
else
echo " >=kde-base/${1}-${ver}[aqua=${use}]"
fi
}
# _greater_max_in_slot ver slot
# slot must be 4.x or live
# returns true if ver is >= the maximum possibile version in slot
_greater_max_in_slot() {
local ver=$1
local slot=$2
# If slot is live, then return false
# (nothing is greater than the maximum live version)
[[ $slot == live ]] && return 1
# Otherwise, for slot X.Y, test against X.Y.50
local test=${slot}.50
version_compare $1 ${test}
# 1 = '<', 2 = '=', 3 = '>'
(( $? != 1 ))
}
# _less_min_in_slot ver slot
# slot must be 4.x or live
# returns true if ver is <= the minimum possibile version in slot
_less_min_in_slot() {
local ver=$1
local slot=$2
# If slot == live, then test with "9999_pre", so that 9999 tests false
local test=9999_pre
# If slot == X.Y, then test with X.(Y-1).50
[[ $slot != live ]] && test=${slot%.*}.$((${slot#*.} - 1)).50
version_compare $1 ${test}
# 1 = '<', 2 = '=', 3 = '>'
(( $? != 3 ))
}
# Internal function used for add_blocker and block_other_slots
# This takes the same parameters as add_blocker, but echos to
# stdout instead of updating a variable.
_do_blocker() {
debug-print-function ${FUNCNAME} "$@"
[[ -z ${1} ]] && die "Missing parameter"
local pkg=kde-base/$1 use
shift
if [[ $pkg == *\[*\] ]]; then
use=${pkg#*\[}
use=${use%\]}
pkg=${pkg%\[*\]}
fi
local param slot def="unset" var atom
# The following variables will hold parameters that contain ":"
# - block_3_5
# - block_4_1
# - block_4_2
# - block_4_3
# - block_4_4
# - block_live
for slot in 3.5 ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
local block_${slot//./_}="unset"
done
# This construct goes through each parameter passed, and sets
# either def or block_* to the version passed
for param; do
# If the parameter does not have a ":" in it...
if [[ ${param/:} == ${param} ]]; then
def=${param}
else # the parameter *does* have a ":" in it
# so everything after the : is the slot...
slot=${param#*:}
# ...and everything before the : is the version
local block_${slot//./_}=${param%:*}
fi
done
for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
# ${var} contains the name of the variable we care about for this slot
# ${!var} is it's value
var=block_${slot//./_}
# if we didn't pass *:${slot}, then use the unsloted value
[[ ${!var} == "unset" ]] && var=def
# If no version was passed, or the version is greater than the maximum
# possible version in this slot, block all versions in this slot
if [[ ${!var} == "unset" ]] || [[ -z ${!var} ]] || _greater_max_in_slot ${!var#<} ${slot}; then
atom=${pkg}
# If the version is "0" or less than the minimum possible version in
# this slot, do nothing
elif [[ ${!var} == "0" ]] || _less_min_in_slot ${!var#<} ${slot}; then
continue
# If the version passed begins with a "<", then use "<" instead of "<="
elif [[ ${!var:0:1} == "<" ]]; then
# this also removes the first character of the version, which is a "<"
atom="<${pkg}-${!var:1}"
else
atom="<=${pkg}-${!var}"
fi
# we always block our own slot, ignoring kdeprefix
if [[ ${SLOT} == ${slot} ]]; then
echo " !${atom}:${slot}${use:+[${use}]}"
else
# we only block other slots on -kdeprefix
echo " !kdeprefix? ( !${atom}:${slot}[-kdeprefix${use:+,${use}}] )"
fi
done
# This is a special case block for :3.5; it does not use the
# default version passed, and no blocker is output *unless* a version
# is passed, or ":3.5" is passed to explicitly request a block on all
# 3.5 versions.
if [[ ${block_3_5} != "unset" && ${block_3_5} != "0" ]]; then
if [[ -z ${block_3_5} ]]; then
atom=${pkg}
elif [[ ${block_3_5:0:1} == "<" ]]; then
atom="<${pkg}-${block_3_5:1}"
else
atom="<=${pkg}-${block_3_5}"
fi
echo " !${atom}:3.5${use:+[${use}]}"
fi
}
# 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
# 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" "sr@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 linguas_${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
}
[-- Attachment #1.4: kde4-meta.eclass --]
[-- Type: text/plain, Size: 24285 bytes --]
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.47 2010/12/29 17:56:34 tampakrap Exp $
#
# @ECLASS: kde4-meta.eclass
# @MAINTAINER:
# kde@gentoo.org
# @BLURB: Eclass for writing "split" KDE packages.
# @DESCRIPTION:
# This eclass provides all necessary functions for writing split KDE ebuilds.
#
# You must define KMNAME to use this eclass, and do so before inheriting it. All other variables are optional.
# Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY.
[[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
inherit kde4-base toolchain-funcs versionator
case ${EAPI:-0} in
3)
KDEMETA_EXPF="pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm"
;;
*)
KDEMETA_EXPF="pkg_pretend pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm"
;;
esac
EXPORT_FUNCTIONS ${KDEMETA_EXPF}
# Add dependencies that all packages in a certain module share.
case ${KMNAME} in
kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
COMMONDEPEND+=" >=media-libs/qimageblitz-0.0.4"
;;
kdepim|kdepim-runtime)
case ${PN} in
akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker)
IUSE+=" +kontact"
RDEPEND+=" kontact? ( $(add_kdebase_dep kontact) )"
;;
esac
;;
kdegames)
if [[ ${PN} != libkdegames ]]; then
COMMONDEPEND+=" $(add_kdebase_dep libkdegames)"
fi
;;
koffice)
[[ ${PN} != koffice-data ]] && IUSE+=" debug"
RDEPEND+="
!app-office/${PN}:0
!app-office/koffice:0
!app-office/koffice-meta:0
"
if has openexr ${IUSE//+}; then
COMMONDEPEND+=" media-gfx/imagemagick[openexr?]"
else
COMMONDEPEND+=" media-gfx/imagemagick"
fi
COMMONDEPEND+="
dev-cpp/eigen:2
media-libs/fontconfig
media-libs/freetype:2
"
if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then
COMMONDEPEND+=" >=app-office/koffice-libs-${PV}:${SLOT}"
fi
;;
esac
DEPEND+=" ${COMMONDEPEND}"
RDEPEND+=" ${COMMONDEPEND}"
unset COMMONDEPEND
debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies"
debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies"
# Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
case ${BUILD_TYPE} in
live)
if [[ ${KDE_SCM} == svn ]]; then
case ${KMNAME} in
extragear*|playground*)
ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
;;
esac
fi
;;
esac
# @ECLASS-VARIABLE: KMNAME
# @DESCRIPTION:
# Name of the parent-module (e.g. kdebase, kdepim, ...). You _must_ set it
# _before_ inheriting this eclass, (unlike the other parameters), since it's
# used to set $SRC_URI.
# @ECLASS-VARIABLE: KMMODULE
# @DESCRIPTION:
# Specify exactly one subdirectory of $KMNAME here. Defaults to $PN.
# The subdirectory listed here is treated exactly like items in $KMEXTRA.
#
# Example: The ebuild name of "kdebase/l10n" is kde-base/kdebase-l10n, because
# just 'l10n' would be too confusing. Hence it sets KMMODULE="l10n".
# @ECLASS-VARIABLE: KMNOMODULE
# @DESCRIPTION:
# If set to "true", $KMMODULE doesn't have to be defined.
#
# Example usage: If you're installing subdirectories of a package, like plugins,
# you mark the top subdirectory (containing the package) as $KMEXTRACTONLY, and
# set KMNOMODULE="true".
if [[ -z ${KMMODULE} ]] && [[ ${KMNOMODULE} != true ]]; then
KMMODULE=${PN}
fi
# @ECLASS-VARIABLE: KMEXTRA
# @DESCRIPTION:
# All subdirectories listed here will be extracted, compiled & installed.
# $KMMODULE is always added to $KMEXTRA.
# If KDE_HANDBOOK is 'always' or 'optional' and handbook USE-flag is set, and if this
# directory exists, then "doc/$KMMODULE" is added to $KMEXTRA. If there's additional
# documentation in different subdirectories, it should be added to KMEXTRA manually..
# @ECLASS-VARIABLE: KMCOMPILEONLY
# @DESCRIPTION:
# All subdirectories listed here will be extracted & compiled, but not installed.
# TODO: better formulation may be needed
# @ECLASS-VARIABLE: KMEXTRACTONLY
# @DESCRIPTION:
# All subdirectories listed here will be extracted, but neither compiled nor installed.
# This can be used to avoid compilation in a subdirectory of a directory in $KMMODULE or $KMEXTRA
# @ECLASS-VARIABLE: KMTARPARAMS
# @DESCRIPTION:
# Specify extra parameters to pass to tar, in kde4-meta_src_extract.
# '-xpf -j' are passed to tar by default.
# @FUNCTION: kde4-meta_pkg_pretend
# @DESCRIPTION:
# Currently only checks the gcc version.
kde4-meta_pkg_pretend() {
debug-print-function ${FUNCNAME} "$@"
slot_is_at_least 4.6 ${SLOT} && ( [[ $(gcc-major-version) -lt 4 ]] || \
( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 3 ]] ) ) \
&& die "Sorry, but gcc-4.3 and earlier wont work for KDE SC 4.6 (see bug 354837)."
}
# @FUNCTION: kde4-meta_pkg_setup
# @DESCRIPTION:
# Currently calls its equivalent in kde4-base.eclass(5) and checks the gcc version.
# Use this one in split ebuilds.
kde4-meta_pkg_setup() {
debug-print-function ${FUNCNAME} "$@"
has pkg_pretend ${KDEMETA_EXPF} || kde4-meta_pkg_pretend
kde4-base_pkg_setup
}
# @FUNCTION: kde4-meta_src_unpack
# @DESCRIPTION:
# This function unpacks the source for split ebuilds.
# Further more is processed in kde4-meta_src_extract
kde4-meta_src_unpack() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${BUILD_TYPE} = live ]]; then
case "${KDE_SCM}" in
svn)
migrate_store_dir
S="${WORKDIR}/${P}"
mkdir -p "${S}"
ESVN_RESTRICT="export" subversion_src_unpack
subversion_wc_info
subversion_bootstrap
;;
git)
git_src_unpack
;;
esac
fi
kde4-meta_src_extract
}
# @FUNCTION: kde4-meta_src_extract
# @DESCRIPTION:
# A function to extract the source for a split KDE ebuild.
# Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and
# KMTARPARAMS.
kde4-meta_src_extract() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${BUILD_TYPE} = live ]]; then
# Export working copy to ${S}
einfo "Exporting parts of working copy to ${S}"
kde4-meta_create_extractlists
case ${KDE_SCM} in
svn)
local rsync_options subdir kmnamedir targetdir wc_path escm
rsync_options="--group --links --owner --perms --quiet --exclude=.svn/ --exclude=.git/"
wc_path="${ESVN_WC_PATH}"
escm="{ESVN}"
# Copy ${KMNAME} non-recursively (toplevel files)
rsync ${rsync_options} "${wc_path}"/${kmnamedir}* "${S}" \
|| die "${escm}: can't export toplevel files to '${S}'."
# Copy cmake directory
if [[ -d "${wc_path}/${kmnamedir}cmake" ]]; then
rsync --recursive ${rsync_options} "${wc_path}/${kmnamedir}cmake" "${S}" \
|| die "${escm}: can't export cmake files to '${S}'."
fi
# Copy all subdirectories
for subdir in $(__list_needed_subdirectories); do
targetdir=""
if [[ $subdir = doc/* && ! -e "$wc_path/$kmnamedir$subdir" ]]; then
continue
fi
[[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
rsync --recursive ${rsync_options} "${wc_path}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \
|| die "${escm}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
done
;;
esac
else
local abort tarball tarfile f extractlist moduleprefix postfix
KMTARPARAMS+=" --bzip2"
postfix="bz2"
case ${KMNAME} in
kdebase-apps)
# kdebase/apps -> kdebase-apps
tarball="kdebase-${PV}.tar.${postfix}"
if ! slot_is_at_least 4.6 ${SLOT} || [[ ${PV} == "4.6.0" ]]; then
moduleprefix=apps/
KMTARPARAMS+=" --transform=s|apps/||"
fi
;;
*)
# Create tarball name from module name (this is the default)
tarball="${KMNAME}-${PV}.tar.${postfix}"
;;
esac
# Full path to source tarball
tarfile="${DISTDIR}/${tarball}"
# Detect real toplevel dir from tarball name - it will be used upon extraction
# and in __list_needed_subdirectories
topdir="${tarball%.tar.*}/"
ebegin "Unpacking parts of ${tarball} to ${WORKDIR}"
kde4-meta_create_extractlists
for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \
AUTHORS COPYING INSTALL README NEWS ChangeLog
do
extractlist+=" ${topdir}${moduleprefix}${f}"
done
extractlist+=" $(__list_needed_subdirectories)"
pushd "${WORKDIR}" > /dev/null
# @ECLASS-VARIABLE: KDE4_STRICTER
# @DESCRIPTION:
# Print out all issues found executing tar / kmextract files
# Set on if you want to find issues in kde-base ebuild unpack sequences
[[ -n ${KDE4_STRICTER} ]] && echo 'tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist}'
if [[ ${I_KNOW_WHAT_I_AM_DOING} ]]; then
# to make the devs happy - bug 338397
tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} || ewarn "tar extract command failed at least partially - continuing anyway"
else
tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} 2> /dev/null || echo "tar extract command failed at least partially - continuing anyway"
fi
# Default $S is based on $P; rename the extracted directory to match $S if necessary
mv ${topdir} ${P} || die "Died while moving \"${topdir}\" to \"${P}\""
popd > /dev/null
eend $?
# We need to clear it here to make verification below work
unset moduleprefix
if [[ -n ${KDE4_STRICTER} ]]; then
for f in $(__list_needed_subdirectories fatal); do
if [[ ! -e ${S}/${f#*/} ]]; then
eerror "'${f#*/}' is missing"
abort=true
fi
done
[[ -n ${abort} ]] && die "There were missing files."
fi
# We don't need it anymore
unset topdir
fi
}
# @FUNCTION: kde4-meta_create_extractlists
# @DESCRIPTION:
# Create lists of files and subdirectories to extract.
# Also see descriptions of KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY,
# KMEXTRACTONLY and KMTARPARAMS.
kde4-meta_create_extractlists() {
debug-print-function ${FUNCNAME} "$@"
# Add default handbook locations
# FIXME - legacy code - remove when 4.4.5 is gone or preferrably port 4.4.5.
if ! slot_is_at_least 4.5 ${SLOT} && has handbook ${IUSE//+} && use handbook && [[ -z ${KMNOMODULE} ]]; then
# We use the basename of $KMMODULE because $KMMODULE can contain
# the path to the module subdirectory.
KMEXTRA_NONFATAL+="
doc/${KMMODULE##*/}"
fi
# Add default handbook locations
if [[ -z ${KMNOMODULE} ]] && ( [[ ${KDE_HANDBOOK} == always ]] || ( [[ ${KDE_HANDBOOK} == optional ]] && use handbook ) ); then
KMEXTRA_NONFATAL+=" doc/${KMMODULE##*/}"
fi
# Add some CMake-files to KMEXTRACTONLY.
# Note that this actually doesn't include KMEXTRA handling.
# In those cases you should care to add the relevant files to KMEXTRACTONLY
case ${KMNAME} in
kdebase)
if ! slot_is_at_least 4.6 ${SLOT} || [[ ${PV} == "4.6.0" ]]; then
KMEXTRACTONLY+="
apps/config-apps.h.cmake
apps/ConfigureChecks.cmake"
else
KMEXTRACTONLY+="
config-apps.h.cmake
ConfigureChecks.cmake"
fi
;;
kdebase-apps)
KMEXTRACTONLY+="
config-apps.h.cmake
ConfigureChecks.cmake"
;;
kdebase-runtime)
KMEXTRACTONLY+="
config-runtime.h.cmake"
;;
kdebase-workspace)
KMEXTRACTONLY+="
config-unix.h.cmake
ConfigureChecks.cmake
config-workspace.h.cmake
config-X11.h.cmake
startkde.cmake
KDE4WorkspaceConfig.cmake.in"
;;
kdegames)
if [[ ${PN} != libkdegames ]]; then
KMEXTRACTONLY+="
libkdegames/"
KMLOADLIBS="${KMLOADLIBS} libkdegames"
fi
;;
kdepim)
if [[ ${PN} != libkdepim ]]; then
KMEXTRACTONLY+="
libkdepim/"
fi
KMEXTRACTONLY+="
config-enterprise.h.cmake
kleopatra/ConfigureChecks.cmake"
if slot_is_at_least 4.5 ${SLOT}; then
KMEXTRACTONLY+="
CTestCustom.cmake
kdepim-version.h.cmake"
else
KMEXTRACTONLY+="
kdepim-version.h"
fi
if has kontact ${IUSE//+} && use kontact; then
KMEXTRA+="
kontact/plugins/${PLUGINNAME:-${PN}}/"
fi
;;
kdeutils)
KMEXTRACTONLY+="
kdeutils-version.h"
;;
koffice)
KMEXTRACTONLY+="
filters/config-filters.h.cmake
"
case ${PV} in
2.[12].*)
KMEXTRACTONLY+="
config-endian.h.cmake
config-openexr.h.cmake
config-opengl.h.cmake
config-prefix.h.cmake"
;;
esac
;;
esac
# Don't install cmake modules for split ebuilds, to avoid collisions.
# note: kdegraphics >= 4.6.2 does not even have code to do that, so we
# should not try in that case
if [[ ${KMNAME} != kdegraphics ]] || { [[ ${SLOT} != 4.6 || ${PV} < 4.6.2 ]] && ! slot_is_at_least 4.7 ${SLOT}; }; then
case ${KMNAME} in
kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
case ${PN} in
libkdegames|libkdeedu|libkworkspace)
KMEXTRA+="
cmake/modules/"
;;
*)
KMCOMPILEONLY+="
cmake/modules/"
;;
esac
;;
esac
fi
debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
}
__list_needed_subdirectories() {
local i j kmextra kmextra_expanded kmmodule_expanded kmcompileonly_expanded extractlist
# We expand KMEXTRA by adding CMakeLists.txt files
kmextra="${KMEXTRA}"
[[ ${1} != fatal ]] && kmextra+=" ${KMEXTRA_NONFATAL}"
for i in ${kmextra}; do
kmextra_expanded+=" ${i}"
j=$(dirname ${i})
while [[ ${j} != "." ]]; do
kmextra_expanded+=" ${j}/CMakeLists.txt";
j=$(dirname ${j})
done
done
# Expand KMMODULE
if [[ -n ${KMMODULE} ]]; then
kmmodule_expanded="${KMMODULE}"
j=$(dirname ${KMMODULE})
while [[ ${j} != "." ]]; do
kmmodule_expanded+=" ${j}/CMakeLists.txt";
j=$(dirname ${j})
done
fi
# Expand KMCOMPILEONLY
for i in ${KMCOMPILEONLY}; do
kmcompileonly_expanded+=" ${i}"
j=$(dirname ${i})
while [[ ${j} != "." ]]; do
kmcompileonly_expanded+=" ${j}/CMakeLists.txt";
j=$(dirname ${j})
done
done
debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmextra_expanded: ${kmextra_expanded}"
debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmmodule_expanded: ${kmmodule_expanded}"
debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME} - kmcompileonly_expanded: ${kmcompileonly_expanded}"
# Create final list of stuff to extract
# We append topdir only when specified (usually for tarballs)
for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \
${KMEXTRACTONLY}
do
extractlist+=" ${topdir}${moduleprefix}${i}"
done
echo ${extractlist}
}
# @FUNCTION: kde4-meta_src_prepare
# @DESCRIPTION:
# Meta-package build system configuration handling - commenting out targets, etc..
kde4-meta_src_prepare() {
debug-print-function ${FUNCNAME} "$@"
kde4-meta_change_cmakelists
kde4-base_src_prepare
}
# @FUNCTION: _change_cmakelists_parent_dirs
# @DESCRIPTION:
# Adjust CMakeLists.txt to shadow subdirectories
# that are not required for the build.
_change_cmakelists_parent_dirs() {
debug-print-function ${FUNCNAME} "$@"
local _olddir _dir
_dir="${S}"/${1}
until [[ ${_dir} == ${S} ]]; do
_olddir=$(basename "${_dir}")
_dir=$(dirname "${_dir}")
debug-print "${LINENO}: processing ${_dir} CMakeLists.txt searching for ${_olddir}"
if [[ -f ${_dir}/CMakeLists.txt ]]; then
sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
-e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${_olddir}[[:space:]]*)/s/#DONOTCOMPILE //g" \
-i ${_dir}/CMakeLists.txt || die "${LINENO}: died in ${FUNCNAME} while processing ${_dir}"
fi
done
}
# @FUNCTION: kde4-meta_change_cmakelists
# @DESCRIPTION:
# Adjust CMakeLists.txt to comply to our splitting.
kde4-meta_change_cmakelists() {
debug-print-function ${FUNCNAME} "$@"
pushd "${S}" > /dev/null
comment_all_add_subdirectory ./
# Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt
if [[ -f CMakeLists.txt ]]; then
sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
-e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \
-i CMakeLists.txt || die "${LINENO}: cmake sed died"
fi
if [[ -z ${KMNOMODULE} ]]; then
# Restore "add_subdirectory" in $KMMODULE subdirectories
find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | \
xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
die "${LINENO}: died in KMMODULE section"
_change_cmakelists_parent_dirs ${KMMODULE}
fi
local i
# KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY
for i in ${KMEXTRACTONLY}; do
if [[ -d ${i} && -f ${i}/../CMakeLists.txt ]]; then
sed -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" \
-i ${i}/../CMakeLists.txt || \
die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}"
fi
done
# KMCOMPILEONLY
for i in ${KMCOMPILEONLY}; do
debug-print "${LINENO}: KMCOMPILEONLY, processing ${i}"
# Uncomment "add_subdirectory" instructions inside $KMCOMPILEONLY, then comment "install" instructions.
find "${S}"/${i} -name CMakeLists.txt -print0 | \
xargs -0 sed -i \
-e 's/^#DONOTCOMPILE //g' \
-e '/install(.*)/{s/^/#DONOTINSTALL /;}' \
-e '/^install(/,/)/{s/^/#DONOTINSTALL /;}' \
-e '/kde4_install_icons(.*)/{s/^/#DONOTINSTALL /;}' || \
die "${LINENO}: sed died in the KMCOMPILEONLY section while processing ${i}"
_change_cmakelists_parent_dirs ${i}
done
# KMEXTRA section
for i in ${KMEXTRA}; do
debug-print "${LINENO}: KMEXTRA section, processing ${i}"
find "${S}"/${i} -name CMakeLists.txt -print0 | \
xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
_change_cmakelists_parent_dirs ${i}
done
# KMEXTRA_NONFATAL section
for i in ${KMEXTRA_NONFATAL}; do
if [[ -d "${S}"/${i} ]]; then
find "${S}"/${i} -name CMakeLists.txt -print0 | \
xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \
die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}"
_change_cmakelists_parent_dirs ${i}
fi
done
case ${KMNAME} in
kdebase-workspace)
# COLLISION PROTECT section
# Install the startkde script just once, as a part of kde-base/kdebase-startkde,
# not as a part of every package.
if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then
# The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0.
sed -e '/startkde/s/^/#DONOTINSTALL /' \
-i CMakeLists.txt || die "${LINENO}: sed died in the kdebase-startkde collision prevention section"
fi
# Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82
if [[ ${PN} != libkworkspace ]]; then
sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \
-i CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section"
fi
;;
kdebase-runtime)
# COLLISION PROTECT section
# Only install the kde4 script as part of kde-base/kdebase-data
if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then
sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
-i CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
fi
;;
kdenetwork)
# Disable hardcoded kdepimlibs check
sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
-i CMakeLists.txt || die "failed to disable hardcoded checks"
;;
kdepim)
# Disable hardcoded checks
sed -r -e '/find_package\(KdepimLibs/s/REQUIRED//' \
-e '/find_package\((KdepimLibs|Boost|QGpgme|Akonadi|ZLIB|Strigi|SharedDesktopOntologies|Soprano|Nepomuk)/{/macro_optional_/!s/find/macro_optional_&/}' \
-e '/macro_log_feature\((Boost|QGPGME|Akonadi|ZLIB|STRIGI|SHAREDDESKTOPONTOLOGIES|Soprano|Nepomuk)_FOUND/s/ TRUE / FALSE /' \
-e '/if[[:space:]]*([[:space:]]*BUILD_.*)/s/^/#OVERRIDE /' \
-e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)/s/^/#OVERRIDE /' \
-i CMakeLists.txt || die "failed to disable hardcoded checks"
# Disable broken or redundant build logic
if ( has kontact ${IUSE//+} && use kontact ) || [[ ${PN} = kontact ]]; then
sed -e '/if[[:space:]]*([[:space:]]*BUILD_.*)/s/^/#OVERRIDE /' \
-e '/if[[:space:]]*([[:space:]]*[[:alnum:]]*_FOUND[[:space:]]*)/s/^/#OVERRIDE /' \
-i kontact/plugins/CMakeLists.txt || die 'failed to override build logic'
fi
if ! slot_is_at_least 4.5 ${SLOT}; then
case ${PN} in
kalarm|kmailcvt|kontact|korganizer|korn)
sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \
-e '/add_custom_target(kmail_xml /,/)/p' \
-i kmail/CMakeLists.txt || die "uncommenting xml failed"
_change_cmakelists_parent_dirs kmail
;;
esac
fi
;;
kdewebdev)
# Disable hardcoded checks
sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \
-e 's/find_package(LibXml2 REQUIRED)/macro_optional_find_package(LibXml2)/' \
-e 's/find_package(LibXslt REQUIRED)/macro_optional_find_package(LibXslt)/' \
-e 's/find_package(Boost REQUIRED)/macro_optional_find_package(Boost)/' \
-i CMakeLists.txt || die "failed to disable hardcoded checks"
;;
koffice)
# Prevent collisions
if [[ ${PN} != koffice-data ]]; then
sed -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \
-i cmake/modules/CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
sed -e '/install(.\+config-openexr\.h.\+)/d' \
-i CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
fi
esac
popd > /dev/null
}
# @FUNCTION: kde4-meta_src_configure
# @DESCRIPTION:
# Currently just calls its equivalent in kde4-base.eclass(5). Use this one in split
# ebuilds.
kde4-meta_src_configure() {
debug-print-function ${FUNCNAME} "$@"
# backwards-compatibility: make mycmakeargs an array, if it isn't already
if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then
mycmakeargs=(${mycmakeargs})
fi
# Set some cmake default values here (usually workarounds for automagic deps)
case ${KMNAME} in
kdewebdev)
mycmakeargs=(
-DWITH_KdepimLibs=OFF
-DWITH_LibXml2=OFF
-DWITH_LibXslt=OFF
-DWITH_Boost=OFF
-DWITH_LibTidy=OFF
"${mycmakeargs[@]}"
)
;;
esac
kde4-base_src_configure
}
# @FUNCTION: kde4-meta_src_compile
# @DESCRIPTION:
# General function for compiling split KDE4 applications.
# Overrides kde4-base_src_compile.
kde4-meta_src_compile() {
debug-print-function ${FUNCNAME} "$@"
kde4-base_src_compile "$@"
}
# @FUNCTION: kde4-meta_src_test
# @DESCRIPTION:
# Currently just calls its equivalent in kde4-base.eclass(5) if
# I_KNOW_WHAT_I_AM_DOING is set. Use this in split ebuilds.
kde4-meta_src_test() {
debug-print-function $FUNCNAME "$@"
if [[ $I_KNOW_WHAT_I_AM_DOING ]]; then
kde4-base_src_test
else
einfo "Tests disabled"
fi
}
# @FUNCTION: kde4-meta_src_install
# @DESCRIPTION:
# Function for installing KDE4 split applications.
kde4-meta_src_install() {
debug-print-function $FUNCNAME "$@"
# Search ${S}/${KMMODULE} and install common documentation files found
local doc
for doc in "${S}/${KMMODULE}"/{AUTHORS,CHANGELOG,ChangeLog*,README*,NEWS,TODO,HACKING}; do
[[ -f "${doc}" ]] && [[ -s "${doc}" ]] && dodoc "${doc}"
done
kde4-base_src_install
}
# @FUNCTION: kde4-meta_pkg_preinst
# @DESCRIPTION:
# Invoke its equivalent in kde4-base.eclass.
kde4-meta_pkg_preinst() {
debug-print-function ${FUNCNAME} "$@"
kde4-base_pkg_preinst
}
# @FUNCTION: kde4-meta_pkg_postinst
# @DESCRIPTION:
# Invoke kbuildsycoca4.
kde4-meta_pkg_postinst() {
debug-print-function ${FUNCNAME} "$@"
kde4-base_pkg_postinst
}
# @FUNCTION: kde4-meta_pkg_postrm
# @DESCRIPTION:
# Currently just calls its equivalent in kde4-base.eclass(5). Use this in split
# ebuilds.
kde4-meta_pkg_postrm() {
debug-print-function ${FUNCNAME} "$@"
kde4-base_pkg_postrm
}
[-- Attachment #1.5: kde4-functions.diff --]
[-- Type: text/plain, Size: 15882 bytes --]
--- gentoo/gentoo-x86/eclass/kde4-functions.eclass 2011-01-29 19:05:42.000000000 +0100
+++ /usr/local/portage/kde/eclass/kde4-functions.eclass 2011-04-03 21:36:56.000000000 +0200
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.44 2011/01/29 18:05:42 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.41 2010/12/29 17:56:34 tampakrap Exp $
inherit versionator
@@ -14,13 +14,21 @@
# @ECLASS-VARIABLE: EAPI
# @DESCRIPTION:
-# By default kde4 eclasses want EAPI 2 which might be redefinable to newer
-# versions.
+# Currently kde4 eclasses support EAPI 3 and 4.
case ${EAPI:-0} in
- 2|3|4) : ;;
+ 4|3) : ;;
*) die "EAPI=${EAPI} 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
@@ -28,12 +36,12 @@
if [[ ${CATEGORY} = kde-base ]]; then
debug-print "${ECLASS}: KDEBASE ebuild recognized"
KDEBASE=kde-base
-elif [[ ${KMNAME} = koffice || ${PN} = koffice ]]; then
+elif [[ ${KMNAME-${PN}} = koffice ]]; then
debug-print "${ECLASS}: KOFFICE ebuild recognized"
KDEBASE=koffice
-elif [[ ${KMNAME} = kdevelop ]]; then
+elif [[ ${KMNAME-${PN}} = kdevelop ]]; then
debug-print "${ECLASS}: KDEVELOP ebuild recognized"
- KDEBASE="kdevelop"
+ KDEBASE=kdevelop
fi
# @ECLASS-VARIABLE: KDE_SLOTS
@@ -47,6 +55,58 @@
# The slots used by KDE live versions. Values should be ordered.
KDE_LIVE_SLOTS=( "live" )
+# determine the build type
+if [[ ${SLOT} = live || ${PV} = *9999* ]]; then
+ BUILD_TYPE="live"
+else
+ BUILD_TYPE="release"
+fi
+export BUILD_TYPE
+
+# Set reponame and SCM for moduleses that have fully migrated to git
+# (hack - it's here because it needs to be before SCM inherits from kde4-base)
+if [[ ${BUILD_TYPE} == live ]]; then
+ case "${KMNAME}" in
+ kdebase-workspace)
+ KDE_SCM="git"
+ EGIT_REPONAME=${EGIT_REPONAME:=kde-workspace}
+ ;;
+ kdebase-runtime)
+ KDE_SCM="git"
+ EGIT_REPONAME=${EGIT_REPONAME:=kde-runtime}
+ ;;
+ kdebase-apps)
+ KDE_SCM="git"
+ EGIT_REPONAME=${EGIT_REPONAME:=kde-baseapps}
+ ;;
+ esac
+fi
+
+# @ECLASS-VARIABLE: KDE_SCM
+# @DESCRIPTION:
+# If this is a live package which scm does it use
+# Everything else uses svn by default
+KDE_SCM="${KDE_SCM:-svn}"
+case ${KDE_SCM} in
+ svn|git) ;;
+ *) die "KDE_SCM: ${KDE_SCM} is not supported" ;;
+esac
+
+# @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="en_GB de nl"
+if [[ ${BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
+ for _lingua in ${KDE_LINGUAS}; do
+ IUSE="${IUSE} linguas_${_lingua}"
+ done
+fi
+
# @FUNCTION: slot_is_at_least
# @USAGE: <want> <have>
# @DESCRIPTION:
@@ -64,24 +124,6 @@
buildsycoca() {
debug-print-function ${FUNCNAME} "$@"
- if [[ ${EAPI} == 2 ]] && ! use prefix; then
- EROOT=${ROOT}
- fi
-
- local KDE3DIR="${EROOT}usr/kde/3.5"
- if [[ -z ${EROOT%%/} && -x "${KDE3DIR}"/bin/kbuildsycoca ]]; then
- # Since KDE3 is aware of shortcuts in /usr, rebuild database
- # for KDE3 as well.
- touch "${KDE3DIR}"/share/services/ksycoca
- chmod 644 "${KDE3DIR}"/share/services/ksycoca
-
- ebegin "Running kbuildsycoca to build global database"
- XDG_DATA_DIRS="${EROOT}usr/local/share:${KDE3DIR}/share:${EROOT}usr/share" \
- DISPLAY="" \
- "${KDE3DIR}"/bin/kbuildsycoca --global --noincremental &> /dev/null
- eend $?
- fi
-
# We no longer need to run kbuildsycoca4, as kded does that automatically, as needed
# fix permission for some directories
@@ -115,19 +157,6 @@
|| die "${LINENO}: Initial sed died"
}
-# @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="en_GB de nl"
-for _lingua in ${KDE_LINGUAS}; do
- IUSE="${IUSE} linguas_${_lingua}"
-done
-
# @FUNCTION: enable_selected_linguas
# @DESCRIPTION:
# Enable translations based on LINGUAS settings and translations supported by
@@ -151,7 +180,7 @@
# 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
+ for x in ${KDE_LINGUAS_DIR[@]}; do
_enable_selected_linguas_dir ${x}
done
else
@@ -182,8 +211,8 @@
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'
+ [[ ${handbookdir} = '.' ]] && handbookdir=${translationdir} && translationdir=
+ [[ -d ${handbookdir} ]] || die 'wrong doc dir specified'
if ! use handbook; then
# Disable whole directory
@@ -196,8 +225,8 @@
# Add requested translations
local lingua
for lingua in en ${KDE_LINGUAS}; do
- if [[ ${lingua} = 'en' ]] || use linguas_${lingua}; then
- if [[ -d "${handbookdir}/${translationdir//%lingua/${lingua}}" ]]; then
+ if [[ ${lingua} = en ]] || use linguas_${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}"
@@ -210,26 +239,19 @@
[[ -n "${linguas}" ]] && einfo "Enabling handbook translations:${linguas}"
}
-# @FUNCTION: get_build_type
-# @DESCRIPTION:
-# Determine whether we are using live ebuild or tbzs.
-get_build_type() {
- if [[ ${SLOT} = live || ${PV} = *9999* ]]; then
- BUILD_TYPE="live"
- else
- BUILD_TYPE="release"
- fi
- export BUILD_TYPE
-}
-
# @FUNCTION: migrate_store_dir
# @DESCRIPTION:
# Universal store dir migration
# * performs split of kdebase to kdebase-apps when needed
# * moves playground/extragear kde4-base-style to toplevel dir
migrate_store_dir() {
+ if [[ ${KDE_SCM} != svn ]]; then
+ die "migrate_store_dir() only makes sense for subversion"
+ fi
+
local cleandir="${ESVN_STORE_DIR}/KDE"
- if [[ -d "${cleandir}" ]]; then
+
+ if [[ -d ${cleandir} ]]; then
ewarn "'${cleandir}' has been found. Moving contents to new location."
addwrite "${ESVN_STORE_DIR}"
# Split kdebase
@@ -249,22 +271,22 @@
for pkg in "${cleandir}"/*; do
mv -f "${pkg}" "${ESVN_STORE_DIR}"/ || eerror "Failed to move '${pkg}'"
done
- rmdir "${cleandir}" || die "Could not move obsolete KDE store dir. Please move '${cleandir}' contents to appropriate location (possibly ${ESVN_STORE_DIR}) and manually remove '${cleandir}' in order to continue."
+ rmdir "${cleandir}" || die "Could not move obsolete KDE store dir. Please move '${cleandir}' contents to appropriate location (possibly ${ESVN_STORE_DIR}) and manually remove '${cleandir}' in order to continue."
fi
if ! hasq kde4-meta ${INHERITED}; then
case ${KMNAME} in
extragear*|playground*)
- local svnlocalpath="${ESVN_STORE_DIR}"/"${KMNAME}"/"${PN}"
- if [[ -d "${svnlocalpath}" ]]; then
+ local scmlocalpath="${ESVN_STORE_DIR}"/"${KMNAME}"/"${PN}"
+ if [[ -d "${scmlocalpath}" ]]; then
local destdir="${ESVN_STORE_DIR}"/"${ESVN_PROJECT}"/"`basename "${ESVN_REPO_URI}"`"
- ewarn "'${svnlocalpath}' has been found."
+ ewarn "'${scmlocalpath}' has been found."
ewarn "Moving contents to new location: ${destdir}"
addwrite "${ESVN_STORE_DIR}"
- mkdir -p "${ESVN_STORE_DIR}"/"${ESVN_PROJECT}" && mv -f "${svnlocalpath}" "${destdir}" \
- || die "Failed to move to '${svnlocalpath}'"
+ mkdir -p "${ESVN_STORE_DIR}"/"${ESVN_PROJECT}" && mv -f "${scmlocalpath}" "${destdir}" \
+ || die "Failed to move to '${scmlocalpath}'"
# Try cleaning empty directories
- rmdir "`dirname "${svnlocalpath}"`" 2> /dev/null
+ rmdir "`dirname "${scmlocalpath}"`" 2> /dev/null
fi
;;
esac
@@ -308,7 +330,7 @@
for pn in ${KMLOADLIBS} ; do
((i++))
depsfile="${EPREFIX}/var/lib/kde/${pn}:${SLOT}"
- [[ -r "${depsfile}" ]] || die "Depsfile '${depsfile}' not accessible. You probably need to reinstall ${pn}."
+ [[ -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
@@ -359,50 +381,50 @@
# @FUNCTION: add_kdebase_dep
# @DESCRIPTION:
-# Create proper dependency for kde-base/ dependencies,
-# adding SLOT when needed (and *only* when needed).
-# This takes 1 or 2 arguments. The first being the package
-# name, the optional second, is additional USE flags to append.
-# 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).
+# Create proper dependency for kde-base/ dependencies, adding SLOT when needed
+# (and *only* when needed).
+# 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 ${3} ]]; then
+ ver=${3}
+ elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then
+ ver=${KDE_OVERRIDE_MINIMAL}
+ elif [[ ${KDEBASE} != kde-base ]]; then
+ ver=${KDE_MINIMAL}
+ # FIXME remove hack when kdepim-4.4.* is gone
+ elif [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && ${PV} == 4.4.[6-8] && ${1} =~ ^kde(pim)?libs$ ]]; then
+ ver=4.4.5
+ # FIXME remove hack when kdepim-4.6beta is gone
+ elif [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && ${PV} == 4.5.98 && ${1} =~ ^(kde(pim)?libs|oxygen-icons)$ ]]; then
+ ver=4.5.90
+ # if building stable-live version depend just on slot
+ # to allow merging packages against more stable basic stuff
+ elif [[ ${PV} == *.9999 ]]; then
+ ver=${SLOT}
+ else
+ ver=${PV}
+ fi
+
[[ -z ${1} ]] && die "Missing parameter"
local use=${2:+,${2}}
if [[ ${KDEBASE} = kde-base ]]; then
- # FIXME remove hack when >kdepim-4.4.5 is gone
- local FIXME_PV
- if [[ ${KMNAME} = kdepim || ${PN} = kdepim-runtime ]] && [[ ${PV} = 4.4.6* || ${PV} = 4.4.7* || ${PV} = 4.4.8* || ${PV} = 4.4.9* || ${PV} = 4.4.10* ]] && [[ ${1} = kdelibs || ${1} = kdepimlibs || ${1} = oxygen-icons ]]; then
- FIXME_PV=4.4.5
- # FIXME remove hack when kdepim-4.6beta is gone
- elif [[ ${KMNAME} = kdepim || ${PN} = kdepim-runtime ]] && [[ ${PV} = 4.5.93* ]] && [[ ${1} = kdelibs || ${1} = kdepimlibs || ${1} = oxygen-icons ]]; then
- FIXME_PV=4.5.90
- else
- FIXME_PV=${PV}
- fi
-
- # if building stable-live version depend just on slot
- # to allow merging packages against more stable basic stuff
- case ${PV} in
- *.9999*)
- echo " !kdeprefix? ( >=kde-base/${1}-${SLOT}[aqua=,-kdeprefix${use}] )"
- echo " kdeprefix? ( >=kde-base/${1}-${SLOT}:${SLOT}[aqua=,kdeprefix${use}] )"
- ;;
- *)
- echo " !kdeprefix? ( >=kde-base/${1}-${FIXME_PV}[aqua=,-kdeprefix${use}] )"
- echo " kdeprefix? ( >=kde-base/${1}-${FIXME_PV}:${SLOT}[aqua=,kdeprefix${use}] )"
- ;;
- esac
+ echo " !kdeprefix? ( >=kde-base/${1}-${ver}[aqua=,-kdeprefix${use}] )"
+ echo " kdeprefix? ( >=kde-base/${1}-${ver}:${SLOT}[aqua=,kdeprefix${use}] )"
+ elif [[ ${ver} == live ]]; then
+ echo " kde-base/${1}:live[aqua=${use}]"
else
- if [[ ${KDE_MINIMAL} = live ]]; then
- echo " kde-base/${1}:${KDE_MINIMAL}[aqua=${use}]"
- else
- echo " >=kde-base/${1}-${KDE_MINIMAL}[aqua=${use}]"
- fi
+ echo " >=kde-base/${1}-${ver}[aqua=${use}]"
fi
}
@@ -444,8 +466,14 @@
debug-print-function ${FUNCNAME} "$@"
[[ -z ${1} ]] && die "Missing parameter"
- local pkg=kde-base/$1
+ local pkg=kde-base/$1 use
shift
+ if [[ $pkg == *\[*\] ]]; then
+ use=${pkg#*\[}
+ use=${use%\]}
+ pkg=${pkg%\[*\]}
+ fi
+
local param slot def="unset" var atom
# The following variables will hold parameters that contain ":"
# - block_3_5
@@ -496,10 +524,10 @@
fi
# we always block our own slot, ignoring kdeprefix
if [[ ${SLOT} == ${slot} ]]; then
- echo " !${atom}:${slot}"
+ echo " !${atom}:${slot}${use:+[${use}]}"
else
# we only block other slots on -kdeprefix
- echo " !kdeprefix? ( !${atom}:${slot}[-kdeprefix] )"
+ echo " !kdeprefix? ( !${atom}:${slot}[-kdeprefix${use:+,${use}}] )"
fi
done
@@ -515,7 +543,7 @@
else
atom="<=${pkg}-${block_3_5}"
fi
- echo " !${atom}:3.5"
+ echo " !${atom}:3.5${use:+[${use}]}"
fi
}
@@ -525,7 +553,7 @@
local lingua linguas sr_mess wp
local dir=${1}
- [[ -d "${dir}" ]] || die "linguas dir \"${dir}\" does not exist"
+ [[ -d ${dir} ]] || die "linguas dir \"${dir}\" does not exist"
comment_all_add_subdirectory "${dir}"
pushd "${dir}" > /dev/null
@@ -534,37 +562,37 @@
# fail at any point
sr_mess="sr@latn sr@latin sr@Latin"
for wp in ${sr_mess}; do
- [[ -e "${wp}.po" ]] && mv "${wp}.po" "sr@Latn.po"
- if [[ -d "${wp}" ]]; then
+ [[ -e ${wp}.po ]] && mv "${wp}.po" "sr@Latn.po"
+ if [[ -d ${wp} ]]; then
# move dir and fix cmakelists
mv "${wp}" "sr@Latn"
sed -i \
- -e "s:${wp}:sr@Latin:g" \
+ -e "s:${wp}:sr@Latn:g" \
CMakeLists.txt
fi
done
for lingua in ${KDE_LINGUAS}; do
- if [[ -e "${lingua}.po" ]]; then
+ if [[ -e ${lingua}.po ]]; then
mv "${lingua}.po" "${lingua}.po.old"
fi
done
for lingua in ${KDE_LINGUAS}; do
if use linguas_${lingua} ; then
- if [[ -d "${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
+ if [[ -e ${lingua}.po.old ]]; then
linguas="${linguas} ${lingua}"
mv "${lingua}.po.old" "${lingua}.po"
fi
fi
done
- [[ -n "${linguas}" ]] && echo ">>> Enabling languages: ${linguas}"
+ [[ -n ${linguas} ]] && echo ">>> Enabling languages: ${linguas}"
popd > /dev/null
}
[-- Attachment #1.6: kde4-base.diff --]
[-- Type: text/plain, Size: 18621 bytes --]
--- gentoo/gentoo-x86/eclass/kde4-base.eclass 2011-03-17 10:40:49.000000000 +0100
+++ /usr/local/portage/kde/eclass/kde4-base.eclass 2011-04-03 21:31:31.000000000 +0200
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.85 2011/03/16 22:45:30 dilfridge Exp $
+# $Header: $
# @ECLASS: kde4-base.eclass
# @MAINTAINER:
@@ -10,8 +10,8 @@
# The kde4-base.eclass provides support for building KDE4 based ebuilds
# and KDE4 applications.
#
-# NOTE: KDE 4 ebuilds by default define EAPI="2", this can be redefined but
-# eclass will fail with version older than 2.
+# NOTE: KDE 4 ebuilds currently support EAPI "3". This will be reviewed
+# over time as new EAPI versions are approved.
# @ECLASS-VARIABLE: VIRTUALX_REQUIRED
# @DESCRIPTION:
@@ -20,15 +20,13 @@
# for tests you should proceed with setting VIRTUALX_REQUIRED=test.
: ${VIRTUALX_REQUIRED:=manual}
-inherit kde4-functions base virtualx eutils
+inherit kde4-functions fdo-mime gnome2-utils base virtualx versionator eutils
-get_build_type
if [[ ${BUILD_TYPE} = live ]]; then
- if [[ ${KDEBASE} = kdevelop ]]; then
- inherit git
- else
- inherit subversion
- fi
+ case ${KDE_SCM} in
+ svn) inherit subversion ;;
+ git) inherit git ;;
+ esac
fi
# @ECLASS-VARIABLE: CMAKE_REQUIRED
@@ -63,18 +61,22 @@
# Note that it is fixed to ${SLOT} for kde-base packages.
KDE_MINIMAL="${KDE_MINIMAL:-4.4}"
-# Set slot for packages in kde-base, koffice and kdevelop
+# Set slot for KDEBASE known packages
case ${KDEBASE} in
kde-base)
+ major=$(get_major_version)
+ minor=$(get_version_component_range 2)
+ micro=$(get_version_component_range 3)
# Determine SLOT from PVs
- case ${PV} in
- *.9999*) SLOT="${PV/.9999*/}" ;; # stable live
- 4.6* | 4.5.[6-9][0-9]*) SLOT="4.6" ;;
- 4.5* | 4.4.[6-9][0-9]*) SLOT="4.5" ;;
- 4.4* | 4.3.[6-9][0-9]*) SLOT="4.4" ;;
- 9999*) SLOT="live" ;; # regular live
- *) die "Unsupported ${PV}" ;;
- esac
+ [[ ${PV} == 9999* ]] && SLOT=live # regular live
+ [[ ${major} -eq 4 && ${micro} == 9999 ]] && SLOT=${major}.${minor} # stable live
+ if [[ ${major} -eq 4 && ${micro} != 9999 ]]; then
+ [[ ${micro} -lt 60 ]] && \
+ SLOT=${major}.${minor}
+ [[ ${micro} -ge 60 ]] &&
+ SLOT=${major}.$(($minor + 1))
+ fi
+ [[ -z ${SLOT} ]] && die "Unsupported ${PV}"
KDE_MINIMAL="${SLOT}"
;;
koffice)
@@ -111,11 +113,9 @@
;;
esac
-slot_is_at_least 4.5 ${KDE_MINIMAL} && CMAKE_MIN_VERSION="2.8.1"
-
inherit ${buildsystem_eclass}
-EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg_postrm
+EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_preinst pkg_postinst pkg_postrm
unset buildsystem_eclass
unset export_fns
@@ -173,6 +173,16 @@
# 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 [[ ${BUILD_TYPE} == live && -z ${KDE_LINGUAS_LIVE_OVERRIDE} && ${KDEBASE} != "kde-base" ]]; then
+ KDE_HANDBOOK=never
+ KDE_LINGUAS=""
+fi
+
# Setup packages inheriting this eclass
case ${KDEBASE} in
kde-base)
@@ -210,14 +220,11 @@
# @ECLASS-VARIABLE: QT_MINIMAL
# @DESCRIPTION:
-# Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1...
-# 4.6.0 for 4.4, 4.6.3 for 4.5, and 4.7.0 for 4.6 and later
+# Determine version of qt we enforce as minimal for the package.
if slot_is_at_least 4.6 "${KDE_MINIMAL}"; then
QT_MINIMAL="${QT_MINIMAL:-4.7.0}"
-elif slot_is_at_least 4.5 "${KDE_MINIMAL}"; then
- QT_MINIMAL="${QT_MINIMAL:-4.6.3}"
else
- QT_MINIMAL="${QT_MINIMAL:-4.6.0}"
+ QT_MINIMAL="${QT_MINIMAL:-4.6.3}"
fi
# Declarative dependencies
@@ -363,6 +370,7 @@
fi
fi
fi
+
kdedepend="
dev-util/automoc
dev-util/pkgconfig
@@ -371,12 +379,26 @@
x11-proto/xf86vidmodeproto
)
"
+
kderdepend=""
+# all packages needs oxygen icons for basic iconset
if [[ ${PN} != oxygen-icons ]]; then
kderdepend+=" $(add_kdebase_dep oxygen-icons)"
fi
+# add a dependency over kde-l10n if EAPI4 is around
+if [[ ${KDEBASE} != "kde-base" ]] && [[ -n ${KDE_LINGUAS} ]] && has "${EAPI:-0}" 4; then
+ usedep=''
+ for _lingua in ${KDE_LINGUAS}; do
+ [[ -n ${usedep} ]] && usedep+=","
+ usedep+="linguas_${_lingua}(+)?"
+ done
+ # if our package has lignuas pull in kde-l10n with selected lingua
+ kderdepend+=" $(add_kdebase_dep kde-l10n ${usedep})"
+ unset usedep _lingua
+fi
+
kdehandbookdepend="
app-text/docbook-xml-dtd:4.2
app-text/docbook-xsl-stylesheets
@@ -425,15 +447,69 @@
RDEPEND+=" ${COMMONDEPEND}"
unset COMMONDEPEND
-# Add experimental kdeenablefinal, disabled by default
+# Add experimental kdeenablefinal, masked by default
IUSE+=" kdeenablefinal"
# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a
# koffice ebuild, the URI should be set in the ebuild itself
-case ${BUILD_TYPE} in
- live)
- SRC_URI=""
- if has subversion ${INHERITED}; then
+_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
+ # fixup kdebase-apps name
+ case ${KMNAME} in
+ kdebase-apps)
+ _kmname="kdebase" ;;
+ *)
+ _kmname="${KMNAME}" ;;
+ esac
+ else
+ _kmname=${PN}
+ fi
+ _kmname_pv="${_kmname}-${PV}"
+ case ${KDEBASE} in
+ kde-base)
+ case ${PV} in
+ 4.[456].8[05] | 4.[456].9[023568] | 4.5.94.1)
+ # Unstable KDE SC releases
+ SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2"
+ # KDEPIM IS SPECIAL
+ [[ ${KMNAME} == "kdepim" || ${KMNAME} == "kdepim-runtime" ]] && SRC_URI="mirror://kde/unstable/kdepim/${PV}/src/${_kmname_pv}.tar.bz2"
+ ;;
+ 4.4.[6789] | 4.4.1?)
+ # Stable kdepim releases
+ SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2"
+ ;;
+ *)
+ # Stable KDE SC releases
+ SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2"
+ ;;
+ esac
+ ;;
+ koffice)
+ case ${PV} in
+ 2.[1234].[6-9]*) SRC_URI="mirror://kde/unstable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
+ *) SRC_URI="mirror://kde/stable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
+ esac
+ ;;
+ kdevelop)
+ SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2"
+ ;;
+ esac
+}
+
+_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
@@ -504,64 +580,64 @@
# for kde-base and koffice modules. Does not affect misc apps.
# Default value is 1 hour.
[[ ${KDEBASE} = kde-base || ${KDEBASE} = koffice ]] && ESVN_UP_FREQ=${ESVN_UP_FREQ:-1}
- elif has git ${INHERITED}; then
- if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then
- KMMODULE="${PN}"
- fi
- case ${KDEBASE} in
- kdevelop)
- EGIT_REPO_URI="git://git.kde.org/${KMMODULE}"
- ;;
- esac
- fi
- ;;
- *)
- if [[ -n ${KDEBASE} ]]; then
- if [[ -n ${KMNAME} ]]; then
- case ${KMNAME} in
- kdebase-apps)
- _kmname="kdebase" ;;
- *)
- _kmname="${KMNAME}" ;;
- esac
+ ;;
+ 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:=git://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
- _kmname_pv="${_kmname}-${PV}"
- case ${KDEBASE} in
- kde-base)
- case ${PV} in
- 4.5.93)
- # Only kdepim and kdepim-runtime 4.6beta here
- SRC_URI="mirror://kde/unstable/kdepim/${PV}/${_kmname}-4.6beta3.tar.bz2"
- ;;
- 4.[456].8[05] | 4.[456].9[023568])
- # Unstable KDE SC releases
- SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2"
- ;;
- 4.4.6 | 4.4.7 | 4.4.8 | 4.4.9 | 4.4.10)
- # Only kdepim here
- SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2"
- ;;
- *)
- # Stable KDE SC releases
- SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2"
+
+ # default branching
+ case ${PV} in
+ 9999*) ;;
+ *)
+ # set EGIT_BRANCH and EGIT_COMMIT to ${SLOT}
+ case ${_kmname} in
+ kdeplasma-addons | kdepim | kdepim-runtime | kdepimlibs)
+ EGIT_BRANCH="${SLOT}"
;;
+ *) EGIT_BRANCH="KDE/${SLOT}" ;;
esac
;;
- koffice)
+ esac
+
+ case $_kmname in
+ kdepim|kdepim-runtime)
case ${PV} in
- 2.1.[6-9]*) SRC_URI="mirror://kde/unstable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
- *) SRC_URI="mirror://kde/stable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
+ # kdepim still did not branch
+ 4.6.9999)
+ EGIT_BRANCH="master"
+ ;;
esac
;;
- kdevelop)
- SRC_URI="mirror://kde/stable/kdevelop/${KDEVELOP_VERSION}/src/${P}.tar.bz2"
- ;;
esac
- unset _kmname _kmname_pv
- fi
- ;;
+ EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}"
+ EGIT_PROJECT="${_kmname}"
+
+ debug-print "${FUNCNAME}: Repository: ${EGIT_REPO_URI}"
+ debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}"
+ ;;
+ esac
+}
+
+case ${BUILD_TYPE} in
+ live) _calculate_live_repo ;;
+ *) _calculate_src_uri ;;
esac
debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
@@ -579,15 +655,6 @@
kde4-base_pkg_setup() {
debug-print-function ${FUNCNAME} "$@"
- # Prefix compat:
- if [[ ${EAPI} == 2 ]] && ! use prefix; then
- EPREFIX=
- EROOT=${ROOT}
- fi
-
- # Append missing trailing slash character
- [[ ${EROOT} = */ ]] || EROOT+="/"
-
# QA ebuilds
[[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})."
@@ -645,30 +712,16 @@
debug-print-function ${FUNCNAME} "$@"
if [[ ${BUILD_TYPE} = live ]]; then
- if has subversion ${INHERITED}; then
- migrate_store_dir
- subversion_src_unpack
- elif has git ${INHERITED}; then
- git_src_unpack
- fi
- elif [[ ${EAPI} == 2 ]]; then
- local file
- for file in ${A}; do
- # This setup is because EAPI <= 2 cannot unpack *.tar.xz files
- # directly, so we do it ourselves (using the exact same code as portage)
- case ${file} in
- *.tar.xz)
- echo ">>> Unpacking ${file} to ${PWD}"
- xz -dc "${DISTDIR}"/${file} | tar xof -
- assert "failed unpacking ${file}"
- ;;
- *)
- unpack ${file}
- ;;
- esac
- done
+ case ${KDE_SCM} in
+ svn)
+ migrate_store_dir
+ subversion_src_unpack
+ ;;
+ git)
+ git_src_unpack
+ ;;
+ esac
else
- # For EAPI >= 3, we can just use unpack() directly
unpack ${A}
fi
}
@@ -682,6 +735,8 @@
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
@@ -690,17 +745,30 @@
# Enable/disable handbooks for kde4-base packages
# kde-l10n inherits kde4-base but is metpackage, so no check for doc
# kdelibs inherits kde4-base but handle installing the handbook itself
- if ! has kde4-meta ${INHERITED}; then
- has handbook ${IUSE//+} && [[ ${PN} != kde-l10n ]] && [[ ${PN} != kdelibs ]] && enable_selected_doc_linguas
+ if ! has kde4-meta ${INHERITED} && has handbook ${IUSE//+}; then
+ if [[ ${KDEBASE} == kde-base ]]; then
+ if [[ ${PN} != kde-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 [[ ${BUILD_TYPE} = live ]]; then
- if has subversion ${INHERITED}; then
- subversion_src_prepare
- elif has git ${INHERITED}; then
- git_src_prepare
- fi
+ case ${KDE_SCM} in
+ svn) subversion_src_prepare ;;
+ esac
fi
# Apply patches
@@ -842,7 +910,7 @@
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
+ 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."
@@ -863,11 +931,6 @@
kde4-base_src_install() {
debug-print-function ${FUNCNAME} "$@"
- # Prefix support, for usage in ebuilds
- if [[ ${EAPI} == 2 ]] && ! use prefix; then
- ED=${D}
- fi
-
if [[ -n ${KMSAVELIBS} ]] ; then
install_library_dependencies
fi
@@ -876,48 +939,73 @@
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}"
+ [[ -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})"
+ [[ -f ${doc} && -s ${doc} ]] && newdoc "${doc}" "$(basename $(dirname ${doc})).$(basename ${doc})"
done
fi
cmake-utils_src_install
}
+# @FUNCTION: kde4-base_pkg_preinst
+# @DESCRIPTION:
+# Function storing icon caches
+kde4-base_pkg_preinst() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ gnome2_icon_savelist
+}
+
# @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} "$@"
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
buildsycoca
- if [[ ${BUILD_TYPE} = live ]] && [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; 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
- elif [[ ${BUILD_TYPE} != live ]] && [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]] && has kdeprefix ${IUSE//+} && use kdeprefix; then
- # warning about kdeprefix for non-live users
- echo
- ewarn "WARNING! You have the kdeprefix useflag enabled."
- ewarn "This setting is strongly discouraged and might lead to potential trouble"
- ewarn "with KDE update strategies."
- ewarn "You are using this setup at your own risk and the kde team does not"
- ewarn "take responsibilities for dead kittens."
- echo
- fi
- if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]] && ! has_version 'kde-base/kdebase-runtime-meta' && ! has_version 'kde-base/kdebase-startkde'; then
- # warn about not supported approach
- if [[ ${KDE_REQUIRED} == always ]] || ( [[ ${KDE_REQUIRED} == optional ]] && use kde ); then
+ if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
+ if has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then
+ echo
+ ewarn "WARNING! you have kdeenable final useflag enabled."
+ ewarn "This useflag needs to be enabled on ALL kde using packages and"
+ ewarn "is known to cause issues."
+ ewarn "You are using this setup at your own risk and the kde team does not"
+ ewarn "take responsibilities for dead kittens."
+ echo
+ fi
+ if [[ ${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
+ elif [[ ${BUILD_TYPE} != live ]] && has kdeprefix ${IUSE//+} && use kdeprefix; then
+ # warning about kdeprefix for non-live users
echo
- ewarn "WARNING! Your system configuration contains neither \"kde-base/kdebase-runtime-meta\""
- ewarn "nor \"kde-base/kdebase-startkde\". You need one of above."
- ewarn "With this setting you are unsupported by KDE team."
- ewarn "All missing features you report for misc packages will be probably ignored or closed as INVALID."
+ ewarn "WARNING! You have the kdeprefix useflag enabled."
+ ewarn "This setting is strongly discouraged and might lead to potential trouble"
+ ewarn "with KDE update strategies."
+ ewarn "You are using this setup at your own risk and the kde team does not"
+ ewarn "take responsibilities for dead kittens."
+ echo
+ fi
+ # for all 3rd party soft tell user that he SHOULD install kdebase-startkde or kdebase-runtime-meta
+ if [[ ${KDEBASE} != kde-base ]] && \
+ ! has_version 'kde-base/kdebase-runtime-meta' && \
+ ! has_version 'kde-base/kdebase-startkde'; then
+ if [[ ${KDE_REQUIRED} == always ]] || ( [[ ${KDE_REQUIRED} == optional ]] && use kde ); then
+ echo
+ ewarn "WARNING! Your system configuration contains neither \"kde-base/kdebase-runtime-meta\""
+ ewarn "nor \"kde-base/kdebase-startkde\". You need one of above."
+ ewarn "With this setting you are unsupported by KDE team."
+ ewarn "All missing features you report for misc packages will be probably ignored or closed as INVALID."
+ fi
fi
fi
}
@@ -928,5 +1016,8 @@
kde4-base_pkg_postrm() {
debug-print-function ${FUNCNAME} "$@"
+ gnome2_icon_cache_update
+ fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
buildsycoca
}
[-- Attachment #1.7: kde4-meta.diff --]
[-- Type: text/plain, Size: 13356 bytes --]
--- gentoo/gentoo-x86/eclass/kde4-meta.eclass 2011-03-13 09:19:15.000000000 +0100
+++ /usr/local/portage/kde/eclass/kde4-meta.eclass 2011-04-04 11:59:08.000000000 +0200
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.50 2011/03/11 19:50:52 dilfridge Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.47 2010/12/29 17:56:34 tampakrap Exp $
#
# @ECLASS: kde4-meta.eclass
# @MAINTAINER:
@@ -12,20 +12,20 @@
# You must define KMNAME to use this eclass, and do so before inheriting it. All other variables are optional.
# Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY.
+[[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
+
inherit kde4-base toolchain-funcs versionator
case ${EAPI:-0} in
3)
- KDEMETA_EXPF="pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm"
+ KDEMETA_EXPF="pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm"
;;
*)
- KDEMETA_EXPF="pkg_pretend pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm"
+ KDEMETA_EXPF="pkg_pretend pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_preinst pkg_postinst pkg_postrm"
;;
esac
EXPORT_FUNCTIONS ${KDEMETA_EXPF}
-[[ -z ${KMNAME} ]] && die "kde4-meta.eclass inherited but KMNAME not defined - broken ebuild"
-
# Add dependencies that all packages in a certain module share.
case ${KMNAME} in
kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics)
@@ -78,12 +78,14 @@
# Useful to build kde4-meta style stuff from extragear/playground (plasmoids etc)
case ${BUILD_TYPE} in
live)
- case ${KMNAME} in
- extragear*|playground*)
- ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
- ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
- ;;
- esac
+ if [[ ${KDE_SCM} == svn ]]; then
+ case ${KMNAME} in
+ extragear*|playground*)
+ ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
+ ESVN_PROJECT="${KMNAME}${ESVN_PROJECT_SUFFIX}"
+ ;;
+ esac
+ fi
;;
esac
@@ -142,7 +144,7 @@
debug-print-function ${FUNCNAME} "$@"
slot_is_at_least 4.6 ${SLOT} && ( [[ $(gcc-major-version) -lt 4 ]] || \
- ( [[ $(gcc-major-version) -eq 4 ]] && [[ $(gcc-minor-version) -le 3 ]] ) ) \
+ ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 3 ]] ) ) \
&& die "Sorry, but gcc-4.3 and earlier wont work for KDE SC 4.6 (see bug 354837)."
}
@@ -160,98 +162,84 @@
# @FUNCTION: kde4-meta_src_unpack
# @DESCRIPTION:
-# This function unpacks the source for split ebuilds. See also
-# kde4-meta-src_extract.
+# This function unpacks the source for split ebuilds.
+# Further more is processed in kde4-meta_src_extract
kde4-meta_src_unpack() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${BUILD_TYPE} = live ]]; then
- migrate_store_dir
- S="${WORKDIR}/${P}"
- mkdir -p "${S}"
- ESVN_RESTRICT="export" subversion_src_unpack
- subversion_wc_info
- subversion_bootstrap
- kde4-meta_src_extract
- else
- kde4-meta_src_extract
+ case "${KDE_SCM}" in
+ svn)
+ migrate_store_dir
+ S="${WORKDIR}/${P}"
+ mkdir -p "${S}"
+ ESVN_RESTRICT="export" subversion_src_unpack
+ subversion_wc_info
+ subversion_bootstrap
+ ;;
+ git)
+ git_src_unpack
+ ;;
+ esac
fi
+ kde4-meta_src_extract
}
-# FIXME: the difference between kde4-meta_src_extract and kde4-meta_src_unpack?
-
# @FUNCTION: kde4-meta_src_extract
# @DESCRIPTION:
-# A function to unpack the source for a split KDE ebuild.
+# A function to extract the source for a split KDE ebuild.
# Also see KMMODULE, KMNOMODULE, KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY and
# KMTARPARAMS.
kde4-meta_src_extract() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${BUILD_TYPE} = live ]]; then
- local rsync_options subdir kmnamedir targetdir
# Export working copy to ${S}
einfo "Exporting parts of working copy to ${S}"
kde4-meta_create_extractlists
- rsync_options="--group --links --owner --perms --quiet --exclude=.svn/"
-
- # Copy ${KMNAME} non-recursively (toplevel files)
- rsync ${rsync_options} "${ESVN_WC_PATH}"/${kmnamedir}* "${S}" \
- || die "${ESVN}: can't export toplevel files to '${S}'."
- # Copy cmake directory
- if [[ -d "${ESVN_WC_PATH}/${kmnamedir}cmake" ]]; then
- rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}cmake" "${S}" \
- || die "${ESVN}: can't export cmake files to '${S}'."
- fi
- # Copy all subdirectories
- for subdir in $(__list_needed_subdirectories); do
- targetdir=""
- if [[ $subdir = doc/* && ! -e "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then
- continue
- fi
-
- [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
- rsync --recursive ${rsync_options} "${ESVN_WC_PATH}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \
- || die "${ESVN}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
- done
+ case ${KDE_SCM} in
+ svn)
+ local rsync_options subdir kmnamedir targetdir wc_path escm
+
+ rsync_options="--group --links --owner --perms --quiet --exclude=.svn/ --exclude=.git/"
+ wc_path="${ESVN_WC_PATH}"
+ escm="{ESVN}"
+
+ # Copy ${KMNAME} non-recursively (toplevel files)
+ rsync ${rsync_options} "${wc_path}"/${kmnamedir}* "${S}" \
+ || die "${escm}: can't export toplevel files to '${S}'."
+ # Copy cmake directory
+ if [[ -d "${wc_path}/${kmnamedir}cmake" ]]; then
+ rsync --recursive ${rsync_options} "${wc_path}/${kmnamedir}cmake" "${S}" \
+ || die "${escm}: can't export cmake files to '${S}'."
+ fi
+ # Copy all subdirectories
+ for subdir in $(__list_needed_subdirectories); do
+ targetdir=""
+ if [[ $subdir = doc/* && ! -e "$wc_path/$kmnamedir$subdir" ]]; then
+ continue
+ fi
- if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then
- sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \
- "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed"
- fi
- else
- local abort tarball tarfile f extractlist moduleprefix postfix
- case ${PV} in
- 4.[45].8[05] | 4.[45].9[023568])
- # Block for normally packed upstream unstable snapshots
- KMTARPARAMS+=" --bzip2" # bz2
- postfix="bz2"
- ;;
- *)
- KMTARPARAMS+=" --bzip2" # bz2
- postfix="bz2"
+ [[ ${subdir%/} = */* ]] && targetdir=${subdir%/} && targetdir=${targetdir%/*} && mkdir -p "${S}/${targetdir}"
+ rsync --recursive ${rsync_options} "${wc_path}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \
+ || die "${escm}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
+ done
;;
esac
+ else
+ local abort tarball tarfile f extractlist moduleprefix postfix
+
+ KMTARPARAMS+=" --bzip2"
+ postfix="bz2"
+
case ${KMNAME} in
kdebase-apps)
# kdebase/apps -> kdebase-apps
tarball="kdebase-${PV}.tar.${postfix}"
- case ${PV} in
- 4.6.1)
- ;;
- *)
- # Go one level deeper for kdebase-apps in tarballs
- moduleprefix=apps/
- KMTARPARAMS+=" --transform=s|apps/||"
- ;;
- esac
- ;;
- kdepim)
- if [[ ${PV} == 4.5.93 ]] ; then
- tarball="kdepim-4.6beta3.tar.${postfix}"
- else
- tarball="${KMNAME}-${PV}.tar.${postfix}"
+ if ! slot_is_at_least 4.6 ${SLOT} || [[ ${PV} == "4.6.0" ]]; then
+ moduleprefix=apps/
+ KMTARPARAMS+=" --transform=s|apps/||"
fi
;;
*)
@@ -279,7 +267,12 @@
extractlist+=" $(__list_needed_subdirectories)"
pushd "${WORKDIR}" > /dev/null
- [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist}
+
+ # @ECLASS-VARIABLE: KDE4_STRICTER
+ # @DESCRIPTION:
+ # Print out all issues found executing tar / kmextract files
+ # Set on if you want to find issues in kde-base ebuild unpack sequences
+ [[ -n ${KDE4_STRICTER} ]] && echo 'tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist}'
if [[ ${I_KNOW_WHAT_I_AM_DOING} ]]; then
# to make the devs happy - bug 338397
tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} || ewarn "tar extract command failed at least partially - continuing anyway"
@@ -299,7 +292,7 @@
if [[ -n ${KDE4_STRICTER} ]]; then
for f in $(__list_needed_subdirectories fatal); do
- if [[ ! -e "${S}/${f#*/}" ]]; then
+ if [[ ! -e ${S}/${f#*/} ]]; then
eerror "'${f#*/}' is missing"
abort=true
fi
@@ -330,7 +323,7 @@
fi
# Add default handbook locations
- if [[ -z ${KMNOMODULE} ]] && { [[ ${KDE_HANDBOOK} = always ]] || { [[ ${KDE_HANDBOOK} = optional ]] && use handbook; }; }; then
+ if [[ -z ${KMNOMODULE} ]] && ( [[ ${KDE_HANDBOOK} == always ]] || ( [[ ${KDE_HANDBOOK} == optional ]] && use handbook ) ); then
KMEXTRA_NONFATAL+=" doc/${KMMODULE##*/}"
fi
@@ -339,18 +332,15 @@
# In those cases you should care to add the relevant files to KMEXTRACTONLY
case ${KMNAME} in
kdebase)
- case ${PV} in
- 4.6.1)
- KMEXTRACTONLY+="
- config-apps.h.cmake
- ConfigureChecks.cmake"
- ;;
- *)
- KMEXTRACTONLY+="
- apps/config-apps.h.cmake
- apps/ConfigureChecks.cmake"
- ;;
- esac
+ if ! slot_is_at_least 4.6 ${SLOT} || [[ ${PV} == "4.6.0" ]]; then
+ KMEXTRACTONLY+="
+ apps/config-apps.h.cmake
+ apps/ConfigureChecks.cmake"
+ else
+ KMEXTRACTONLY+="
+ config-apps.h.cmake
+ ConfigureChecks.cmake"
+ fi
;;
kdebase-apps)
KMEXTRACTONLY+="
@@ -407,14 +397,6 @@
filters/config-filters.h.cmake
"
case ${PV} in
- 2.0.*)
- KMEXTRACTONLY+="
- config-openctl.h.cmake
- config-endian.h.cmake
- config-openexr.h.cmake
- config-opengl.h.cmake
- config-prefix.h.cmake"
- ;;
2.[12].*)
KMEXTRACTONLY+="
config-endian.h.cmake
@@ -426,20 +408,24 @@
;;
esac
# Don't install cmake modules for split ebuilds, to avoid collisions.
- case ${KMNAME} in
- kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
- case ${PN} in
- libkdegames|libkdeedu|libkworkspace)
- KMEXTRA+="
- cmake/modules/"
- ;;
- *)
- KMCOMPILEONLY+="
- cmake/modules/"
- ;;
- esac
- ;;
- esac
+ # note: kdegraphics >= 4.6.2 does not even have code to do that, so we
+ # should not try in that case
+ if [[ ${KMNAME} != kdegraphics ]] || { [[ ${SLOT} != 4.6 || ${PV} < 4.6.2 ]] && ! slot_is_at_least 4.7 ${SLOT}; }; then
+ case ${KMNAME} in
+ kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics)
+ case ${PN} in
+ libkdegames|libkdeedu|libkworkspace)
+ KMEXTRA+="
+ cmake/modules/"
+ ;;
+ *)
+ KMCOMPILEONLY+="
+ cmake/modules/"
+ ;;
+ esac
+ ;;
+ esac
+ fi
debug-print "line ${LINENO} ${ECLASS} ${FUNCNAME}: KMEXTRACTONLY ${KMEXTRACTONLY}"
}
@@ -504,13 +490,16 @@
kde4-base_src_prepare
}
-# FIXME: no comment here?
+# @FUNCTION: _change_cmakelists_parent_dirs
+# @DESCRIPTION:
+# Adjust CMakeLists.txt to shadow subdirectories
+# that are not required for the build.
_change_cmakelists_parent_dirs() {
debug-print-function ${FUNCNAME} "$@"
local _olddir _dir
_dir="${S}"/${1}
- until [[ ${_dir} == "${S}" ]]; do
+ until [[ ${_dir} == ${S} ]]; do
_olddir=$(basename "${_dir}")
_dir=$(dirname "${_dir}")
debug-print "${LINENO}: processing ${_dir} CMakeLists.txt searching for ${_olddir}"
@@ -660,31 +649,6 @@
sed -e '/install(.\+config-openexr\.h.\+)/d' \
-i CMakeLists.txt || die "${LINENO}: sed died in collision prevention section"
fi
- # koffice 2.0
- case ${PV} in
- 2.0.[1-9])
- sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \
- "${S}"/CMakeLists.txt || \
- die "${LINENO}: sed died in collision prevention section"
- ;;
- *) ;;
- esac
- # koffice 2.1.[8-9][0-9] and 9999
- case ${PV} in
- 2.1.8[0-9]|2.1.9[0-9]|9999)
- sed -e '/^option(BUILD/s/ON/OFF/' \
- -e '/^if(NOT BUILD_kchart/,/^endif(NOT BUILD_kchart/d' \
- -e '/^if(BUILD_koreport/,/^endif(BUILD_koreport/d' \
- -e 's/set(SHOULD_BUILD_F_OFFICE TRUE)/set(SHOULD_BUILD_F_OFFICE FALSE)/' \
- -i "${S}"/CMakeLists.txt || die "sed died while fixing cmakelists"
- if [[ ${PN} != koffice-data ]] && [[ ${PV} == 9999 ]]; then
- sed -e '/config-opengl.h/d' \
- -i "${S}"/CMakeLists.txt || die "sed died while fixing cmakelists"
-
- fi
- ;;
- *) ;;
- esac
esac
popd > /dev/null
@@ -714,18 +678,6 @@
"${mycmakeargs[@]}"
)
;;
- koffice)
- case ${PV} in
- 2.1.8[0-9]|2.1.9[0-9]|9999)
- if [[ ${PN} != "kchart" ]]; then
- mycmakeargs=(
- -DBUILD_koreport=OFF
- "${mycmakeargs[@]}"
- )
- fi
- ;;
- esac
- ;;
esac
kde4-base_src_configure
@@ -770,6 +722,15 @@
kde4-base_src_install
}
+# @FUNCTION: kde4-meta_pkg_preinst
+# @DESCRIPTION:
+# Invoke its equivalent in kde4-base.eclass.
+kde4-meta_pkg_preinst() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ kde4-base_pkg_preinst
+}
+
# @FUNCTION: kde4-meta_pkg_postinst
# @DESCRIPTION:
# Invoke kbuildsycoca4.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [gentoo-dev] KDE4 eclasses review
2011-04-04 17:00 [gentoo-dev] KDE4 eclasses review Tomáš Chvátal
@ 2011-04-05 15:38 ` Marc Schiffbauer
0 siblings, 0 replies; 2+ messages in thread
From: Marc Schiffbauer @ 2011-04-05 15:38 UTC (permalink / raw
To: gentoo-dev
* Tomáš Chvátal schrieb am 04.04.11 um 19:00 Uhr:
> Hi guys,
> since we didn't do this for quite long time I would like kde4 eclasses
> reviewed as whole rather than on patch basis (altho i attach the patches
> for convenience too).
>
> It is 2 years since we reviewed them last time fully on -dev so lets see
> how much weird/useless logic we can find (more heads know more).
>
> Remember: nitpick on everything cause this thing is used in quite a lot
> ebuilds so we need it in top-notch shape :)
>
> This update brings support for git since upstream is slowly moving to
> git repos from SVN. Dropped support for eapi2. Usage of fdo/gnome
> classes to update mime stuff. Most of the koffice code removed as being
> obsoleted and various loads of whitespace stuff.
>
> Cheers
>
> Tom
> # Copyright 1999-2010 Gentoo Foundation
> # Distributed under the terms of the GNU General Public License v2
> # $Header: $
>
> # @ECLASS: kde4-base.eclass
> # @MAINTAINER:
> # kde@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 "3". This will be reviewed
> # over time as new EAPI versions are approved.
>
> # @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}
[...]
>
> KDE_MINIMAL="${KDE_MINIMAL:-4.4}"
I'd suggest setting default for all variables the same way. I
personally like the : {X:="default"} approach best.
: ${KDE_MINIMAL:=4.4}
-Marc
--
8AAC 5F46 83B4 DB70 8317 3723 296C 6CCA 35A6 4134
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-04-05 15:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-04 17:00 [gentoo-dev] KDE4 eclasses review Tomáš Chvátal
2011-04-05 15:38 ` Marc Schiffbauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox