summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass')
-rw-r--r--eclass/kde4-base.eclass104
-rw-r--r--eclass/kde4-functions.eclass116
-rw-r--r--eclass/kde4-meta.eclass72
3 files changed, 161 insertions, 131 deletions
diff --git a/eclass/kde4-base.eclass b/eclass/kde4-base.eclass
index 1e64bac94e8..ef25558f8b8 100644
--- a/eclass/kde4-base.eclass
+++ b/eclass/kde4-base.eclass
@@ -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:
@@ -30,11 +30,17 @@ inherit kde4-functions base virtualx 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
+ ;;
+ *)
+ die "unsupported scm: ${KDE_SCM}"
+ ;;
+ esac
fi
# @ECLASS-VARIABLE: CMAKE_REQUIRED
@@ -369,6 +375,7 @@ if [[ ${PN} != kdelibs ]]; then
fi
fi
fi
+
kdedepend="
dev-util/automoc
dev-util/pkgconfig
@@ -377,6 +384,7 @@ kdedepend="
x11-proto/xf86vidmodeproto
)
"
+
kderdepend=""
if [[ ${PN} != oxygen-icons ]]; then
@@ -439,7 +447,7 @@ IUSE+=" kdeenablefinal"
case ${BUILD_TYPE} in
live)
SRC_URI=""
- if has subversion ${INHERITED}; then
+ if [[ "${KDE_SCM}" == "svn" ]]; then
# Determine branch URL based on live type
local branch_prefix
case ${PV} in
@@ -510,14 +518,45 @@ case ${BUILD_TYPE} in
# 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
+ elif [[ "${KDE_SCM}" == "git" ]]; then
+ case ${PV} in
+ 9999*)
+ # master
+ # @ECLASS-VARIABLE: EGIT_PROJECT_SUFFIX
+ # @DESCRIPTION
+ # Suffix appended to EGIT_PROJECT depending on fetched branch.
+ # Defaults is empty (for -9999 = master), and "-${PV}" otherwise.
+ EGIT_PROJECT_SUFFIX=""
+ ;;
+ 4.6.9999)
+ # keep this as long as 4.6 does not have its own branch in
+ # kde git tree
+ EGIT_PROJECT_SUFFIX=""
+ EGIT_BRANCH="master"
+ ;;
+ *)
+ # branch
+ EGIT_PROJECT_SUFFIX="-${PV}"
+
+ # set EGIT_BRANCH to ${SLOT}
+ EGIT_BRANCH="${SLOT}"
+ ;;
+ esac
if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then
KMMODULE="${PN}"
fi
+ if [[ -n ${KMNAME} ]]; then
+ EGIT_PROJECT="${KMNAME}${EGIT_PROJECT_SUFFIX}"
+ if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then
+ KMMODULE="${PN}"
+ fi
+ fi
case ${KDEBASE} in
kdevelop)
- EGIT_REPO_URI="git://git.kde.org/${KMMODULE}"
+ EGIT_REPO_URI="git://anongit.kde.org/${KMMODULE}"
;;
+ *)
+ EGIT_REPO_URI="git://anongit.kde.org/${PN}"
esac
fi
;;
@@ -585,15 +624,6 @@ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
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})."
@@ -651,28 +681,15 @@ kde4-base_src_unpack() {
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}
@@ -869,11 +886,6 @@ kde4-base_src_test() {
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
diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass
index 106eb50d398..365cf46d93e 100644
--- a/eclass/kde4-functions.eclass
+++ b/eclass/kde4-functions.eclass
@@ -14,10 +14,10 @@ inherit versionator
# @ECLASS-VARIABLE: EAPI
# @DESCRIPTION:
-# By default kde4 eclasses want EAPI 2 which might be redefinable to newer
-# versions.
+# Currently kde4 eclasses support EAPI 3. Over time newer versions
+# will be supported.
case ${EAPI:-0} in
- 2|3) : ;;
+ 3) : ;;
*) die "EAPI=${EAPI} is not supported" ;;
esac
@@ -36,6 +36,11 @@ elif [[ ${KMNAME} = kdevelop ]]; then
KDEBASE="kdevelop"
fi
+# @ECLASS-VARIABLE: KDE_SCM
+# @DESCRIPTION:
+# If this is a live package which scm does it use - default to svn
+KDE_SCM="${KDE_SCM:-svn}"
+
# @ECLASS-VARIABLE: KDE_SLOTS
# @DESCRIPTION:
# The slots used by all KDE versions later than 4.0. The live KDE releases use
@@ -64,24 +69,6 @@ slot_is_at_least() {
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
@@ -228,7 +215,12 @@ get_build_type() {
# * 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}"
@@ -249,22 +241,22 @@ migrate_store_dir() {
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
@@ -359,50 +351,48 @@ add_blocker() {
# @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 [[ ${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* ]] && [[ ${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.94* ]] && [[ ${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
}
diff --git a/eclass/kde4-meta.eclass b/eclass/kde4-meta.eclass
index 0b8897f49c5..8e26ead1bdd 100644
--- a/eclass/kde4-meta.eclass
+++ b/eclass/kde4-meta.eclass
@@ -70,12 +70,21 @@ debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-sp
# 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
+ elif [[ "${KDE_SCM}" == "git" ]]; then
+ case ${KMNAME} in
+ kdepim)
+ EGIT_REPO_URI="git://anongit.kde.org/${KMNAME}"
+ ;;
+ esac
+
+ fi
;;
esac
@@ -145,12 +154,19 @@ 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
+ if [[ "$KDE_SCM" == "svn" ]]; then
+ migrate_store_dir
+ S="${WORKDIR}/${P}"
+ mkdir -p "${S}"
+ ESVN_RESTRICT="export" subversion_src_unpack
+ subversion_wc_info
+ subversion_bootstrap
+ elif [[ "${KDE_SCM}" == "git" ]]; then
+ S="${WORKDIR}/${P}"
+ mkdir -p "${S}"
+ EGIT_HAS_SUBMODULES=1
+ git_src_unpack
+ fi
kde4-meta_src_extract
else
kde4-meta_src_extract
@@ -168,31 +184,43 @@ kde4-meta_src_extract() {
debug-print-function ${FUNCNAME} "$@"
if [[ ${BUILD_TYPE} = live ]]; then
- local rsync_options subdir kmnamedir targetdir
+ local rsync_options subdir kmnamedir targetdir wc_path escm
# 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/ --exclude=.git/"
- rsync_options="--group --links --owner --perms --quiet --exclude=.svn/"
+ case "${KDE_SCM}" in
+ svn)
+ wc_path="${ESVN_WC_PATH}"
+ escm="{ESVN}"
+ ;;
+ git)
+ wc_path="${EGIT_STORE_DIR}/${EGIT_PROJECT}"
+ escm="{EGIT}"
+ ;;
+ *)
+ die "Unknown value for KDE_SCM in kde4-meta_src_extract(): ${KDE_SCM}"
+ esac
# Copy ${KMNAME} non-recursively (toplevel files)
- rsync ${rsync_options} "${ESVN_WC_PATH}"/${kmnamedir}* "${S}" \
- || die "${ESVN}: can't export toplevel files to '${S}'."
+ rsync ${rsync_options} "${wc_path}"/${kmnamedir}* "${S}" \
+ || die "${escm}: 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}'."
+ 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 "$ESVN_WC_PATH/$kmnamedir$subdir" ]]; then
+ if [[ $subdir = doc/* && ! -e "$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}'."
+ rsync --recursive ${rsync_options} "${wc_path}/${kmnamedir}${subdir%/}" "${S}/${targetdir}" \
+ || die "${escm}: can't export subdirectory '${subdir}' to '${S}/${targetdir}'."
done
if [[ ${KMNAME} = kdebase-runtime && ${PN} != kdebase-data ]]; then