summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorTomáš Chvátal <scarabeus@gentoo.org>2009-06-12 17:07:19 +0200
committerTomáš Chvátal <scarabeus@gentoo.org>2009-06-12 17:08:15 +0200
commit2a53a0d4d0a1c5c827e79d1a6dc5204b5ac0abfe (patch)
tree68e7c3132132167a2db8fa24c296083b85dab8d3 /eclass
parent542240b1a7491dc2be02b9c213882bef45ce8119 (diff)
downloadkde-2a53a0d4d0a1c5c827e79d1a6dc5204b5ac0abfe.tar.gz
kde-2a53a0d4d0a1c5c827e79d1a6dc5204b5ac0abfe.tar.bz2
kde-2a53a0d4d0a1c5c827e79d1a6dc5204b5ac0abfe.zip
[eclasses] Be more prefix friendly.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/kde4-base.eclass20
-rw-r--r--eclass/kde4-functions.eclass17
2 files changed, 20 insertions, 17 deletions
diff --git a/eclass/kde4-base.eclass b/eclass/kde4-base.eclass
index 29bfc79ebe1..7714c0110f3 100644
--- a/eclass/kde4-base.eclass
+++ b/eclass/kde4-base.eclass
@@ -405,9 +405,9 @@ kde4-base_pkg_setup() {
if [[ ${KDEBASE} = kde-base ]]; then
if use kdeprefix; then
- KDEDIR="${ROOT}usr/kde/${_kdedir}"
+ KDEDIR="${EROOT}usr/kde/${_kdedir}"
else
- KDEDIR="${ROOT}usr"
+ KDEDIR="${EROOT}usr"
fi
PREFIX="${PREFIX:-${KDEDIR}}"
else
@@ -418,9 +418,9 @@ kde4-base_pkg_setup() {
[[ -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="${ROOT}usr/kde/${slot}"
+ KDEDIR="${EROOT}usr/kde/${slot}"
else
- KDEDIR="${ROOT}usr"
+ KDEDIR="${EROOT}usr"
fi
break;
fi
@@ -431,10 +431,10 @@ kde4-base_pkg_setup() {
if [[ ${KDE_REQUIRED} = always ]] || { [[ ${KDE_REQUIRED} = optional ]] && use kde; }; then
[[ -z ${KDEDIR} ]] && die "Failed to determine KDEDIR!"
else
- [[ -z ${KDEDIR} ]] && KDEDIR="${ROOT}usr"
+ [[ -z ${KDEDIR} ]] && KDEDIR="${EROOT}usr"
fi
- PREFIX="${PREFIX:-${ROOT}usr}"
+ PREFIX="${PREFIX:-${EROOT}usr}"
fi
# Not needed anymore
@@ -523,7 +523,7 @@ kde4-base_src_configure() {
# Shadow existing /usr installations
unset KDEDIRS
- if [[ ${KDEDIR} != "${ROOT}usr" ]]; then
+ if [[ ${KDEDIR} != "${EROOT}usr" ]]; then
# Override some environment variables - only when kdeprefix is different,
# to not break ccache/distcc
PATH="${KDEDIR}/bin:${PATH}"
@@ -539,7 +539,7 @@ kde4-base_src_configure() {
cmakeargs="${cmakeargs} -DCMAKE_SYSTEM_PREFIX_PATH=${KDEDIR}"
else
# If prefix is /usr, sysconf needs to be /etc, not /usr/etc
- cmakeargs="${cmakeargs} -DSYSCONF_INSTALL_DIR=${ROOT}etc"
+ cmakeargs="${cmakeargs} -DSYSCONF_INSTALL_DIR=${EROOT}etc"
fi
mycmakeargs="${cmakeargs} ${mycmakeargs}"
@@ -605,10 +605,10 @@ kde4-base_src_make_doc() {
done
fi
- if [[ -n ${KDEBASE} ]] && [[ -d "${D}${ROOT}usr/share/doc/${PF}" ]]; then
+ if [[ -n ${KDEBASE} ]] && [[ -d "${D}${EROOT}usr/share/doc/${PF}" ]]; then
# work around bug #97196
dodir /usr/share/doc/KDE4 && \
- mv "${D}${ROOT}usr/share/doc/${PF}" "${D}${ROOT}usr/share/doc/KDE4/" || \
+ mv "${D}${EROOT}usr/share/doc/${PF}" "${D}${EROOT}usr/share/doc/KDE4/" || \
die "Failed to move docs to KDE4/."
fi
}
diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass
index f45f355d789..a757b8b1d2f 100644
--- a/eclass/kde4-functions.eclass
+++ b/eclass/kde4-functions.eclass
@@ -2,6 +2,9 @@
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.18 2009/05/09 13:23:15 scarabeus Exp $
+# Prefix compat:
+: ${EROOT:=${ROOT}}
+
# @ECLASS: kde4-functions.eclass
# @MAINTAINER:
# kde@gentoo.org
@@ -53,7 +56,7 @@ KDE_LIVE_SLOTS=( "live" )
buildsycoca() {
debug-print-function ${FUNCNAME} "$@"
- if [[ -z ${ROOT%%/} && -x ${KDEDIR}/bin/kbuildsycoca4 ]]; then
+ if [[ -z ${EROOT%%/} && -x ${KDEDIR}/bin/kbuildsycoca4 ]]; then
# Make sure tha cache file exists, writable by root and readable by
# others. Otherwise kbuildsycoca4 will fail.
touch "${KDEDIR}/share/kde4/services/ksycoca4"
@@ -66,9 +69,9 @@ buildsycoca() {
ebegin "Running kbuildsycoca4 to build global database"
# This is needed because we support multiple kde versions installed together.
# Lookup in order - local, KDEDIR, /usr, do not duplicate entries btw.
- local KDEDIRS="${ROOT}usr/share"
- [[ ${KDEDIR} != "${ROOT}usr" ]] && KDEDIRS="${KDEDIR}/share:${KDEDIRS}"
- XDG_DATA_DIRS="${ROOT}usr/local/share:${KDEDIRS}" \
+ local KDEDIRS="${EROOT}usr/share"
+ [[ ${KDEDIR} != "${EROOT}usr" ]] && KDEDIRS="${KDEDIR}/share:${KDEDIRS}"
+ XDG_DATA_DIRS="${EROOT}usr/local/share:${KDEDIRS}" \
DISPLAY="" DBUS_SESSION_BUS_ADDRESS="" \
${KDEDIR}/bin/kbuildsycoca4 --global --noincremental &> /dev/null
eend $?
@@ -76,7 +79,7 @@ buildsycoca() {
# fix permission for some directories
for x in share/config share/kde4; do
- [[ ${KDEDIR} = ${ROOT}usr ]] && DIRS=${ROOT}usr || DIRS="${ROOT}usr ${KDEDIR}"
+ [[ ${KDEDIR} = ${EROOT}usr ]] && DIRS=${EROOT}usr || DIRS="${EROOT}usr ${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
@@ -313,7 +316,7 @@ install_library_dependencies() {
local depsfile="${T}/${PN}:${SLOT}"
ebegin "Installing library dependencies as ${depsfile##*/}"
- insinto ${ROOT}var/lib/kde
+ insinto ${EROOT}var/lib/kde
doins "${depsfile}" || die "Failed to install library dependencies."
eend $?
}
@@ -328,7 +331,7 @@ load_library_dependencies() {
i=0
for pn in ${KMLOADLIBS} ; do
((i++))
- depsfile="${ROOT}var/lib/kde/${pn}:${SLOT}"
+ depsfile="${EROOT}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}"