public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in eclass: kde-dist.eclass kde-functions.eclass kde-meta.eclass kde.eclass
@ 2008-02-20 20:59 Wulf Krueger (philantrop)
  0 siblings, 0 replies; only message in thread
From: Wulf Krueger (philantrop) @ 2008-02-20 20:59 UTC (permalink / raw
  To: gentoo-commits

philantrop    08/02/20 20:59:44

  Modified:             kde-dist.eclass kde-functions.eclass
                        kde-meta.eclass kde.eclass
  Log:
  EAPI-1 enhancements for KDE 3.5.9. Thanks, Ingmar, for preparing these.

Revision  Changes    Path
1.75                 eclass/kde-dist.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde-dist.eclass?rev=1.75&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde-dist.eclass?rev=1.75&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde-dist.eclass?r1=1.74&r2=1.75

Index: kde-dist.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/kde-dist.eclass,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- kde-dist.eclass	1 Jan 2006 01:14:59 -0000	1.74
+++ kde-dist.eclass	20 Feb 2008 20:59:43 -0000	1.75
@@ -1,9 +1,14 @@
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde-dist.eclass,v 1.74 2006/01/01 01:14:59 swegener Exp $
-#
-# Author Dan Armak <danarmak@gentoo.org>
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde-dist.eclass,v 1.75 2008/02/20 20:59:43 philantrop Exp $
+
+# @ECLASS: kde-dist.eclass
+# @MAINTAINER:
+# kde@gentoo.org
 #
+# original author Dan Armak <danarmak@gentoo.org>
+# @BLURB: This is the kde-dist eclass for >=2.2.1 kde base packages
+# @DESCRIPTION:
 # This is the kde-dist eclass for >=2.2.1 kde base packages.  Don't use for kdelibs though :-)
 # Don't use it for e.g. kdevelop, koffice because of their separate versioning schemes.
 
@@ -11,7 +16,7 @@
 
 # Upstream released 3.5.0_rc1 with tarballs labelled as just 3.5.0, so we have our own copies
 # on mirror://gentoo
-if [ "$PV" == "3.5.0_rc1" ]; then
+if [[ "$PV" == "3.5.0_rc1" ]]; then
 	SRC_URI="$SRC_URI mirror://gentoo/$P.tar.bz2"
 else
 
@@ -33,17 +38,17 @@
 					debug-print "${ECLASS}: cvs detected" ;;
 		*)			debug-print "${ECLASS}: Error: unrecognized version $PV, could not set SRC_URI" ;;
 	esac
-	[ -n "${SRC_PATH}" ] && SRC_URI="${SRC_URI} mirror://kde/${SRC_PATH}"
+	[[ -n "${SRC_PATH}" ]] && SRC_URI="${SRC_URI} mirror://kde/${SRC_PATH}"
 fi
 debug-print "${ECLASS}: finished, SRC_URI=${SRC_URI}"
 
 need-kde ${PV}
 
 # 3.5 prereleases
-[ "${PV}" == "3.5_alpha1" ] && S=${WORKDIR}/${PN}-3.4.90
-[ "${PV}" == "3.5_beta1" ] && S=${WORKDIR}/${PN}-3.4.91
-[ "${PV}" == "3.5.0_beta2" ] && S=${WORKDIR}/${PN}-3.4.92
-[ "${PV}" == "3.5.0_rc1" ] && S=${WORKDIR}/${PN}-3.5.0
+[[ "${PV}" == "3.5_alpha1" ]] && S=${WORKDIR}/${PN}-3.4.90
+[[ "${PV}" == "3.5_beta1" ]] && S=${WORKDIR}/${PN}-3.4.91
+[[ "${PV}" == "3.5.0_beta2" ]] && S=${WORKDIR}/${PN}-3.4.92
+[[ "${PV}" == "3.5.0_rc1" ]] && S=${WORKDIR}/${PN}-3.5.0
 
 DESCRIPTION="KDE ${PV} - "
 HOMEPAGE="http://www.kde.org/"
@@ -52,6 +57,14 @@
 
 # add blockers on split packages derived from this one
 for x in $(get-child-packages ${CATEGORY}/${PN}); do
-	DEPEND="${DEPEND} !=${x}-${SLOT}*"
-	RDEPEND="${RDEPEND} !=${x}-${SLOT}*"
+	case ${EAPI:-0} in
+		# Add EAPIs without SLOT dependencies.
+		0)  DEPEND="${DEPEND} !=${x}-${KDEMAJORVER}.${KDEMINORVER}*"
+			RDEPEND="${RDEPEND} !=${x}-${KDEMAJORVER}.${KDEMINORVER}*"
+			;;
+		# EAPIs with SLOT dependencies.
+		*)  DEPEND="${DEPEND} !${x}:${SLOT}"
+			RDEPEND="${RDEPEND} !${x}:${SLOT}"
+			;;
+	esac
 done



1.166                eclass/kde-functions.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde-functions.eclass?rev=1.166&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde-functions.eclass?rev=1.166&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde-functions.eclass?r1=1.165&r2=1.166

Index: kde-functions.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/kde-functions.eclass,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -r1.165 -r1.166
--- kde-functions.eclass	19 Feb 2008 00:31:12 -0000	1.165
+++ kde-functions.eclass	20 Feb 2008 20:59:43 -0000	1.166
@@ -1,9 +1,14 @@
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde-functions.eclass,v 1.165 2008/02/19 00:31:12 ingmar Exp $
-#
-# Author Dan Armak <danarmak@gentoo.org>
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde-functions.eclass,v 1.166 2008/02/20 20:59:43 philantrop Exp $
+
+# @ECLASS: kde-functions.eclass
+# @MAINTAINER:
+# kde@gentoo.org
+# Original author Dan Armak <danarmak@gentoo.org>
 #
+# @BLURB: This contains everything except things that modify ebuild variables and
+# @DESCRIPTION:
 # This contains everything except things that modify ebuild variables
 # and functions (e.g. $P, src_compile() etc.)
 
@@ -317,6 +322,9 @@
 app-office/koffice app-office/kword
 '
 
+# @FUNCTION: get-parent-package
+# @USAGE: < name of split-ebuild >
+# @DESCRIPTION:
 # accepts 1 parameter, the name of a split ebuild; echoes the name of its mother package
 get-parent-package() {
 	local parent child
@@ -331,6 +339,9 @@
 	die "Package $1 not found in KDE_DERIVATION_MAP, please report bug"
 }
 
+# @FUNCTION: get-child-packages
+# @USAGE: < name of monolithic package >
+# @DESCRIPTION:
 # accepts 1 parameter, the name of a monolithic package; echoes the names of all ebuilds derived from it
 get-child-packages() {
 	local parent child
@@ -341,6 +352,9 @@
 EOF
 }
 
+# @FUNCTION: is-parent-package
+# @USAGE: < name >
+# @RETURN: 0 if <name> is a parent package, otherwise 1
 is-parent-package() {
 	local parent child
 	while read parent child; do
@@ -351,9 +365,12 @@
 	return 1
 }
 
-# Usage: deprange minver maxver package [...]
+# @FUNCTION: deprange
+# @USAGE: < minver > < maxver > < package > [...]
+# @DESCRIPTION:
 # For minver, a -rN part is supported. For both minver and maxver, _alpha/beta/pre/rc suffixes
 # are supported, but not _p suffixes or teminating letters (eg 3.3.1a).
+#
 # This function echoes a string of the form (for package="kde-base/kdelibs")
 # || ( =kde-base/kdelibs-3.3.1-r1 ~kde-base/kdelibs-3.3.2 ~kde-base/kdelibs-3.3.3 )
 # This dep means versions of package from maxver through minver will be acceptable.
@@ -375,30 +392,30 @@
 
 	# Workaround for 3.5.0_beta1 ebuilds being mistakenly versioned as 3.5_beta1
 	# Ugly kludge, but will disappear once 3.5 prerelease ebuilds are removed from portage
-	if [ "$MINVER" == "3.5_beta1" ]; then
+	if [[ "$MINVER" == "3.5_beta1" ]]; then
 
 		MINVER="3.5.0_beta1"
 		FINALOPTIONVER="3.5_beta1"
 	fi
-	if [ "$MAXVER" == "3.5_beta1" ]; then
+	if [[ "$MAXVER" == "3.5_beta1" ]]; then
 		MAXVER="3.5.0_beta1"
 	fi
 
 	# Get base version - the major X.Y components
 	local BASEVER=${MINVER%.*}
-	if [ "${MAXVER%.*}" != "$BASEVER" ]; then
+	if [[ "${MAXVER%.*}" != "$BASEVER" ]]; then
 		die "deprange(): unsupported parameters $MINVER $MAXVER - BASEVER must be identical"
 	fi
 
 	# Get version suffixes
 	local MINSUFFIX MAXSUFFIX
-	if [ "$MINVER" != "${MINVER/_}" ]; then
+	if [[ "$MINVER" != "${MINVER/_}" ]]; then
 		MINSUFFIX=${MINVER##*_}
 		SUFFIXLESSMINVER=${MINVER%_*}
 	else
 		SUFFIXLESSMINVER=$MINVER
 	fi
-	if [ "$MAXVER" != "${MAXVER/_}" ]; then
+	if [[ "$MAXVER" != "${MAXVER/_}" ]]; then
 		MAXSUFFIX=${MAXVER##*_}
 		SUFFIXLESSMAXVER=${MAXVER%_*}
 	else
@@ -406,7 +423,7 @@
 	fi
 
 	# Separate out the optional lower bound revision number
-	if [ "$MINVER" != "${MINVER/-}" ]; then
+	if [[ "$MINVER" != "${MINVER/-}" ]]; then
 		local MINREV=${MINVER##*-}
 	fi
 
@@ -415,51 +432,50 @@
 	local MAXMINOR=${SUFFIXLESSMAXVER##*.}
 
 	# Iterate over packages
-	while [ -n "$1" ]; do
+	while [[ -n "$1" ]]; do
 		local PACKAGE=$1
 		shift
 
 		local NEWDEP=""
 
 		# If the two versions are identical, our job is simple
-		if [ "$MINVER" == "$MAXVER" ]; then
+		if [[ "$MINVER" == "$MAXVER" ]]; then
 			NEWDEP="~$PACKAGE-$MINVER"
 
 		# If the range bounds differ only by their suffixes
-		elif [ "$MINMINOR" == "$MAXMINOR" ]; then
+		elif [[ "$MINMINOR" == "$MAXMINOR" ]]; then
 			NEWDEP="$(deprange-iterate-suffixes "~$PACKAGE-$BASEVER.$MINMINOR" $MINSUFFIX $MAXSUFFIX)"
 
 			# Revision constraint on lower bound
-			if [ -n "$MINREV" ]; then
+			if [[ -n "$MINREV" ]]; then
 				NEWDEP="$NEWDEP
 						$(deprange-iterate-numbers "=$PACKAGE-$BASEVER.${MINMINOR}_$MINSUFFIX-r" $MINREV 50)"
 			fi
 
 		# If the minor version numbers are different too
 		else
-
 			# Max version's allowed suffixes
-			if [ -n "$MAXSUFFIX" ]; then
+			if [[ -n "$MAXSUFFIX" ]]; then
 				NEWDEP="$(deprange-iterate-suffixes "~$PACKAGE-$BASEVER.$MAXMINOR" alpha1 $MAXSUFFIX)"
 			fi
 
 			STARTMINOR="${MINMINOR}"
 
 			# regular versions in between
-			if [ -n "$MINREV" -a -z "$MINSUFFIX" ]; then
+			if [[ -n "$MINREV" ]] && [[ -z "$MINSUFFIX" ]]; then
 				let STARTMINOR++
 			fi
 			NEWDEP="$NEWDEP
 					$(deprange-iterate-numbers "~${PACKAGE}-${BASEVER}." $STARTMINOR $MAXMINOR)"
 
 			# Min version's allowed suffixes
-			if [ -n "$MINSUFFIX" ]; then
+			if [[ -n "$MINSUFFIX" ]]; then
 				NEWDEP="$NEWDEP
 						$(deprange-iterate-suffixes "~$PACKAGE-$BASEVER.$MINMINOR" $MINSUFFIX rc10)"
 			fi
-			if [ -n "$MINREV" ]; then
+			if [[ -n "$MINREV" ]]; then
 				local BASE
-				if [ -n "$MINSUFFIX" ]; then
+				if [[ -n "$MINSUFFIX" ]]; then
 					BASE="=$PACKAGE-$BASEVER.${MINMINOR}_${MINSUFFIX%-r*}-r"
 				else
 					BASE="=$PACKAGE-$BASEVER.${MINMINOR%-r*}-r"
@@ -470,7 +486,7 @@
 		fi
 
 		# second part of kludge
-		if [ -n "$FINALOPTIONVER" ]; then
+		if [[ -n "$FINALOPTIONVER" ]]; then
 			NEWDEP="$NEWDEP ~$PACKAGE-$FINALOPTIONVER"
 		fi
 
@@ -497,32 +513,32 @@
 	local NAME=$1 MINSUFFIX=$2 MAXSUFFIX=$3
 
 	# Separate out the optional lower bound revision number
-	if [ "$MINSUFFIX" != "${MINSUFFIX/-}" ]; then
+	if [[ "$MINSUFFIX" != "${MINSUFFIX/-}" ]]; then
 		local MINREV=${MINSUFFIX##*-}
 	fi
 	MINSUFFIX=${MINSUFFIX%-*}
 
 	# Separate out the version suffixes
 	local MINalpha MINbeta MINpre MINrc
-	if [ "$MINSUFFIX" != "${MINSUFFIX/alpha}" ]; then
+	if [[ "$MINSUFFIX" != "${MINSUFFIX/alpha}" ]]; then
 		MINalpha="${MINSUFFIX##alpha}"
-	elif [ "$MINSUFFIX" != "${MINSUFFIX/beta}" ]; then
+	elif [[ "$MINSUFFIX" != "${MINSUFFIX/beta}" ]]; then
 		MINbeta="${MINSUFFIX##beta}"
-	elif [ "$MINSUFFIX" != "${MINSUFFIX/pre}" ]; then
+	elif [[ "$MINSUFFIX" != "${MINSUFFIX/pre}" ]]; then
 		MINpre="${MINSUFFIX##pre}"
-	elif [ "$MINSUFFIX" != "${MINSUFFIX/rc}" ]; then
+	elif [[ "$MINSUFFIX" != "${MINSUFFIX/rc}" ]]; then
 		MINrc="${MINSUFFIX##rc}"
 	else
 		die "deprange(): version suffix $MINSUFFIX (probably _pN) not supported"
 	fi
 	local MAXalpha MAXbeta MAXpre MAXrc
-	if [ "$MAXSUFFIX" != "${MAXSUFFIX/alpha}" ]; then
+	if [[ "$MAXSUFFIX" != "${MAXSUFFIX/alpha}" ]]; then
 		MAXalpha="${MAXSUFFIX##alpha}"
-	elif [ "$MAXSUFFIX" != "${MAXSUFFIX/beta}" ]; then
+	elif [[ "$MAXSUFFIX" != "${MAXSUFFIX/beta}" ]]; then
 		MAXbeta="${MAXSUFFIX##beta}"
-	elif [ "$MAXSUFFIX" != "${MAXSUFFIX/pre}" ]; then
+	elif [[ "$MAXSUFFIX" != "${MAXSUFFIX/pre}" ]]; then
 		MAXpre="${MAXSUFFIX##pre}"
-	elif [ "$MAXSUFFIX" != "${MAXSUFFIX/rc}" ]; then
+	elif [[ "$MAXSUFFIX" != "${MAXSUFFIX/rc}" ]]; then
 		MAXrc="${MAXSUFFIX##rc}"
 	else
 		die "deprange(): version suffix $MAXSUFFIX (probably _pN) not supported"
@@ -536,29 +552,29 @@
 
 		# If -n $started, we've encountered the upper bound in a previous iteration
 		# and so we use the maximum allowed upper bound for this prefix
-		if [ -n "$started" ]; then
+		if [[ -n "$started" ]]; then
 			upper=10
 
 		else
 
 			# Test for the upper bound in the current iteration
 			var=MAX$suffix
-			if [ -n "${!var}" ]; then
+			if [[ -n "${!var}" ]]; then
 				upper=${!var}
 				started=yes
 			fi
 		fi
 
 		# If the upper bound has been found
-		if [ -n "$upper" ]; then
+		if [[ -n "$upper" ]]; then
 
 			# Test for the lower bound in the current iteration (of the loop over prefixes)
 			var=MIN$suffix
-			if [ -n "${!var}" ]; then
+			if [[ -n "${!var}" ]]; then
 				lower=${!var}
 
 				# If the lower bound has a revision number, don't touch that yet
-				if [ -n "$MINREV" ]; then
+				if [[ -n "$MINREV" ]]; then
 					let lower++
 				fi
 
@@ -572,7 +588,7 @@
 					$(deprange-iterate-numbers ${NAME}_${suffix} $lower $upper)"
 
 			# If we've encountered the lower bound on this iteration, don't consider additional prefixes
-			if [ -n "${!var}" ]; then
+			if [[ -n "${!var}" ]]; then
 				break
 			fi
 		fi
@@ -580,15 +596,19 @@
 	echo -n $NEWDEP
 }
 
+# @FUNCTION: deprange-dual
+# @USAGE: < minver > < maxver > < package >
+# @DESCRIPTION:
 # Wrapper around deprange() used for deps between split ebuilds.
 # It adds the parent monolithic ebuild of the dep as an alternative dep.
+# See deprange above for more deatils.
 deprange-dual() {
 	local MIN=$1 MAX=$2 NEWDEP=""
 	shift; shift
 	for PACKAGE in $@; do
 		PARENT=$(get-parent-package $PACKAGE)
 		NEWDEP="$NEWDEP || ( $(deprange-list $MIN $MAX $PACKAGE)"
-		if [ "$PARENT" != "$(get-parent-package $CATEGORY/$PN)" ]; then
+		if [[ "$PARENT" != "$(get-parent-package $CATEGORY/$PN)" ]]; then
 			NEWDEP="$NEWDEP $(deprange-list $MIN $MAX $PARENT)"
 		fi
 		NEWDEP="$NEWDEP )"
@@ -600,20 +620,25 @@
 # kde/qt directory management etc. functions, was kde-dirs.ebuild
 # ---------------------------------------------------------------
 
+# @FUNCTION: need-kde
+# @USAGE: < version >
+# @DESCRIPTION:
+# Sets the correct DEPEND and RDEPEND for the needed kde < version >. Also takes
+# care of the correct Qt-version and correct RDEPEND handling.
 need-kde() {
+	debug-print-function $FUNCNAME "$@"
 
-	debug-print-function $FUNCNAME $*
 	KDEVER="$1"
 
 	# determine install locations
 	set-kdedir ${KDEVER}
 
-	if [ "${RDEPEND-unset}" != "unset" ] ; then
+	if [[ -n "${RDEPEND}" ]]; then
 		x_DEPEND="${RDEPEND}"
 	else
 		x_DEPEND="${DEPEND}"
 	fi
-	if [ -n "${KDEBASE}" ]; then
+	if [[ -n "${KDEBASE}" ]]; then
 		# If we're a kde-base package, we need at least our own version of kdelibs.
 		# Also, split kde-base ebuilds are not updated with every KDE release, and so
 		# can require support of different versions of kdelibs.
@@ -621,7 +646,7 @@
 		# max and min KDE versions. E.g. KM_DEPRANGE="$PV $MAXKDEVER".
 		# Note: we only set RDEPEND if it is already set, otherwise
 		# we break packages relying on portage copying RDEPEND from DEPEND.
-		if [ -n "${KM_DEPRANGE}" ]; then
+		if [[ -n "${KM_DEPRANGE}" ]]; then
 			DEPEND="${DEPEND} $(deprange ${KM_DEPRANGE} kde-base/kdelibs)"
 			RDEPEND="${x_DEPEND} $(deprange ${KM_DEPRANGE} kde-base/kdelibs)"
 		else
@@ -639,16 +664,20 @@
 	qtver-from-kdever ${KDEVER}
 	need-qt ${selected_version}
 
-	if [ -n "${KDEBASE}" ]; then
+	if [[ -n "${KDEBASE}" ]]; then
 		SLOT="$KDEMAJORVER.$KDEMINORVER"
 	else
 		SLOT="0"
 	fi
 }
 
+# @FUNCTION: set-kdedir
+# @USAGE: < version >
+# @DESCRIPTION:
+# Sets the right directories for the kde <version> wrt what kind of package will
+# be installed, e. g. third-party-apps, kde-base-packages, ...
 set-kdedir() {
-
-	debug-print-function $FUNCNAME $*
+	debug-print-function $FUNCNAME "$@"
 
 
 	# set install location:
@@ -674,23 +703,23 @@
 	IFSBACKUP="$IFS"
 	IFS=".-_"
 	for x in $1; do
-		if [ -z "$KDEMAJORVER" ]; then KDEMAJORVER=$x
-		else if [ -z "$KDEMINORVER" ]; then KDEMINORVER=$x
-		else if [ -z "$KDEREVISION" ]; then KDEREVISION=$x
+		if [[ -z "$KDEMAJORVER" ]]; then KDEMAJORVER=$x
+		else if [[ -z "$KDEMINORVER" ]]; then KDEMINORVER=$x
+		else if [[ -z "$KDEREVISION" ]]; then KDEREVISION=$x
 		fi; fi; fi
 	done
-	[ -z "$KDEMINORVER" ] && KDEMINORVER="0"
-	[ -z "$KDEREVISION" ] && KDEREVISION="0"
+	[[ -z "$KDEMINORVER" ]] && KDEMINORVER="0"
+	[[ -z "$KDEREVISION" ]] && KDEREVISION="0"
 	IFS="$IFSBACKUP"
 	debug-print "$FUNCNAME: version breakup: KDEMAJORVER=$KDEMAJORVER KDEMINORVER=$KDEMINORVER KDEREVISION=$KDEREVISION"
 
 	# install prefix
-	if [ -n "$KDEPREFIX" ]; then
+	if [[ -n "$KDEPREFIX" ]]; then
 		export PREFIX="$KDEPREFIX"
-	elif [ "$KDEMAJORVER" == "2" ]; then
+	elif [[ "$KDEMAJORVER" == "2" ]]; then
 		export PREFIX="/usr/kde/2"
 	else
-		if [ -z "$KDEBASE" ]; then
+		if [[ -z "$KDEBASE" ]]; then
 			export PREFIX="/usr"
 		else
 			case $KDEMAJORVER.$KDEMINORVER in
@@ -707,15 +736,16 @@
 	fi
 
 	# kdelibs location
-	if [ -n "$KDELIBSDIR" ]; then
+	if [[ -n "$KDELIBSDIR" ]]; then
 		export KDEDIR="$KDELIBSDIR"
-	elif [ "$KDEMAJORVER" == "2" ]; then
+	elif [[ "$KDEMAJORVER" == "2" ]]; then
 		export KDEDIR="/usr/kde/2"
 	else
-		if [ -z "$KDEBASE" ]; then
+		if [[ -z "$KDEBASE" ]]; then
 			# find the latest kdelibs installed
-			for x in /usr/kde/{cvs,3.5,3.4,3.3,3.2,3.1,3.0,3} $PREFIX $KDE3LIBSDIR $KDELIBSDIR $KDE3DIR $KDEDIR /usr/kde/*; do
-				if [ -f "${x}/include/kwin.h" ]; then
+			for x in /usr/kde/{cvs,3.5,3.4,3.3,3.2,3.1,3.0,3} "${PREFIX}" \
+				"${KDE3LIBSDIR}" "${KDELIBSDIR}" "${KDE3DIR}" "${KDEDIR}" /usr/kde/*; do
+				if [[ -f "${x}/include/kwin.h" ]]; then
 					debug-print found
 					export KDEDIR="$x"
 					break
@@ -737,17 +767,20 @@
 	fi
 
 	debug-print "$FUNCNAME: Will use the kdelibs installed in $KDEDIR, and install into $PREFIX."
-
 }
 
+# @FUNCTION: need-qt
+# @USAGE: < version >
+# @DESCRIPTION:
+# Sets the DEPEND and RDEPEND for Qt <version>.
 need-qt() {
+	debug-print-function $FUNCNAME "${@}"
 
-	debug-print-function $FUNCNAME $*
 	QTVER="$1"
 
 	QT=qt
 
-	if [ "${RDEPEND-unset}" != "unset" ] ; then
+	if [[ "${RDEPEND-unset}" != "unset" ]]; then
 		x_DEPEND="${RDEPEND}"
 	else
 		x_DEPEND="${DEPEND}"
@@ -759,23 +792,34 @@
 			RDEPEND="${x_DEPEND} =x11-libs/${QT}-2.3*"
 			;;
 		3*)
-			DEPEND="${DEPEND} $(qt_min_version ${QTVER})"
-			RDEPEND="${x_DEPEND} $(qt_min_version ${QTVER})"
+			case ${EAPI:-0} in
+				# Add EAPIs without SLOT dependencies.
+				0)	DEPEND="${DEPEND} $(qt_min_version ${QTVER})"
+					RDEPEND="${x_DEPEND} $(qt_min_version ${QTVER})"
+					;;
+				*)	DEPEND="${DEPEND} >=x11-libs/qt-${QTVER}:3"
+					RDEPEND="${RDEPEND} >=x11-libs/qt-${QTVER}:3"
+					;;
+			esac
 			;;
 		*)	echo "!!! error: $FUNCNAME() called with invalid parameter: \"$QTVER\", please report bug" && exit 1;;
 	esac
 
 }
 
+# @FUNCTION: set-qtdir
+# @DESCRIPTION:
+# This function is not needed anymore.
 set-qtdir() {
-	DONOTHING=1
-	# Functionality not needed anymore
+	:
 }
 
+# @FUNCTION: qtver-from-kdever
+# @USAGE: < kde-version >
+# @DESCRIPTION:
 # returns minimal qt version needed for specified kde version
 qtver-from-kdever() {
-
-	debug-print-function $FUNCNAME $*
+	debug-print-function $FUNCNAME "$@"
 
 	local ver
 
@@ -796,8 +840,7 @@
 }
 
 min-kde-ver() {
-
-	debug-print-function $FUNCNAME $*
+	debug-print-function $FUNCNAME "$@"
 
 	case $1 in
 		2*)			selected_version="2.2.2";;
@@ -814,22 +857,25 @@
 
 }
 
+# @FUNCTION: kde_sandbox_patch
+# @USAGE: < dir > [ dir ] [ dir ] [...]
+# @DESCRIPTION:
 # generic makefile sed for sandbox compatibility. for some reason when the kde makefiles (of many packages
 # and versions) try to chown root and chmod 4755 some binaries (after installing, target install-exec-local),
 # they do it to the files in $(bindir), not $(DESTDIR)/$(bindir). Most of these have been fixed in latest cvs
 # but a few remain here and there.
+#
 # Pass a list of dirs to sed, Makefile.{am,in} in these dirs will be sed'ed.
 # This should be harmless if the makefile doesn't need fixing.
 kde_sandbox_patch() {
+	debug-print-function $FUNCNAME "$@"
 
-	debug-print-function $FUNCNAME $*
-
-	while [ -n "$1" ]; do
+	while [[ -n "$1" ]]; do
 	# can't use dosed, because it only works for things in ${D}, not ${S}
 	cd $1
 	for x in Makefile.am Makefile.in Makefile
 	do
-		if [ -f "$x" ]; then
+		if [[ -f "$x" ]]; then
 			echo Running sed on $x
 			cp $x ${x}.orig
 			sed -e 's: $(bindir): $(DESTDIR)/$(bindir):g' -e 's: $(kde_datadir): $(DESTDIR)/$(kde_datadir):g' -e 's: $(TIMID_DIR): $(DESTDIR)/$(TIMID_DIR):g' ${x}.orig > ${x}
@@ -841,24 +887,23 @@
 
 }
 
+# @FUNCTION: kde_remove_flag
+# @USAGE: < dir > < flag >
+# @DESCRIPTION:
 # remove an optimization flag from a specific subdirectory's makefiles.
 # currently kdebase and koffice use it to compile certain subdirs without
 # -fomit-frame-pointer which breaks some things.
-# Parameters:
-# $1: subdirectory
-# $2: flag to remove
 kde_remove_flag() {
+	debug-print-function $FUNCNAME "$@"
 
-	debug-print-function $FUNCNAME $*
-
-	cd ${S}/${1} || die
-	[ -n "$2" ] || die
+	cd "${S}"/${1}  || die "cd to '${S}/${1}' failed."
+	[[ -n "$2" ]] || die "missing argument to kde_remove_flag"
 
 	cp Makefile Makefile.orig
 	sed -e "/CFLAGS/ s/${2}//g
 /CXXFLAGS/ s/${2}//g" Makefile.orig > Makefile
 
-	cd $OLDPWD
+	cd "${OLDPWD}"
 
 }
 
@@ -878,7 +923,7 @@
 		# before running kbuildsycoca. This makes sure they don't show up in the
 		# 3.5 K-menu unless the user manually adds them.
 		XDG_DATA_DIRS="/usr/share:${KDEDIR}/share:/usr/local/share"
-		${KDEDIR}/bin/kbuildsycoca --global --noincremental &> /dev/null
+		"${KDEDIR}"/bin/kbuildsycoca --global --noincremental &> /dev/null
 		eend $?
 	fi
 }
@@ -901,8 +946,8 @@
 				echo "${uninstall_file}" | diff -qs ${entry} - &> /dev/null
 				if [[ $? != 0 ]]; then
 					if [[ ! -f ${D}${PREFIX}/share/applications/kde/$(basename ${entry}) ]]; then
-						dodir ${PREFIX}/share/applications/kde
-						mv ${entry} ${D}${PREFIX}/share/applications/kde
+						dodir "${PREFIX}"/share/applications/kde
+						mv ${entry} "${D}${PREFIX}"/share/applications/kde
 					else
 						ewarn "QA: $(basename ${entry}) already exists in ${PREFIX}/share/applications/kde."
 					fi
@@ -911,11 +956,12 @@
 		fi
 	fi
 
-	validate_desktop_entries ${PREFIX}/share/applications
+	validate_desktop_entries "${PREFIX}"/share/applications
 }
 
 # is this a kde-base ebuid?
-if [ "${CATEGORY}" == "kde-base" ]; then
+if [[ "${CATEGORY}" == "kde-base" ]]; then
 	debug-print "${ECLASS}: KDEBASE ebuild recognized"
 	export KDEBASE="true"
 fi
+



1.84                 eclass/kde-meta.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde-meta.eclass?rev=1.84&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde-meta.eclass?rev=1.84&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde-meta.eclass?r1=1.83&r2=1.84

Index: kde-meta.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/kde-meta.eclass,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- kde-meta.eclass	15 Jan 2008 21:47:59 -0000	1.83
+++ kde-meta.eclass	20 Feb 2008 20:59:43 -0000	1.84
@@ -1,12 +1,19 @@
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde-meta.eclass,v 1.83 2008/01/15 21:47:59 drac Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde-meta.eclass,v 1.84 2008/02/20 20:59:43 philantrop Exp $
+
+# @ECLASS: kde-meta.eclass
+# @MAINTAINER:
+# kde@gentoo.org
 #
-# Author Dan Armak <danarmak@gentoo.org>
+# Original authors:
+# Dan Armak <danarmak@gentoo.org>
 # Simone Gotti <motaboy@gentoo.org>
-#
+# @BLURB: This is the kde-meta eclass which supports broken-up kde-base packages.
+# @DESCRIPTION:
 # This is the kde-meta eclass which supports broken-up kde-base packages.
 
+
 inherit kde multilib
 
 # only broken-up ebuilds can use this eclass
@@ -52,31 +59,11 @@
 		*)		die "$ECLASS: Error: unrecognized version $PV, could not set SRC_URI" ;;
 	esac
 
-	# Base tarball and xdeltas for patch downloading style
-	# Note that we use XDELTA_BASE, XDELTA_DELTA again in src_unpack()
-	# For future versions, add all applicable xdeltas (from x.y.0) in correct order to XDELTA_DELTA
-	# For versions that don't have deltas, it's more efficient to leave XDELTA_BASE
-	# unset, making src_unpack extract directly from the tarball in distfiles
-	# Does anyone really want to make this code generic based on $TARBALLVER above?
-	case "$PV" in
-		3.5.0_rc1)	XDELTA_BASE="mirror://kde/unstable/3.4.91/src/$KMNAME-3.4.91.tar.bz2"
-				XDELTA_DELTA="mirror://kde/unstable/3.4.92/src/$KMNAME-3.4.91-3.4.92.tar.xdelta mirror://gentoo/$KMNAME-3.4.92-3.5.0_rc1.tar.xdelta"
-				;;
-		3.5.0)		XDELTA_BASE="mirror://kde/stable/3.5/src/$KMNAME-3.5.0.tar.bz2"
-				XDELTA_DELTA=""
-				;;
-		*)		;;
-	esac
-
 elif [[ "$KMNAME" == "koffice" ]]; then
 	SRC_PATH="mirror://kde/stable/koffice-$PV/src/koffice-$PV.tar.bz2"
-	XDELTA_BASE=""
-	XDELTA_DELTA=""
 	case $PV in
 		1.3.5)
 			SRC_PATH="mirror://kde/stable/koffice-$PV/src/koffice-$PV.tar.bz2"
-			XDELTA_BASE="mirror://kde/stable/koffice-1.3.4/src/koffice-1.3.4.tar.bz2"
-			XDELTA_DELTA="mirror://kde/stable/koffice-1.3.5/src/koffice-1.3.4-1.3.5.tar.xdelta"
 			;;
 		1.6_beta1)
 			SRC_PATH="mirror://kde/unstable/koffice-${PV/_/-}/koffice-${TARBALLVER}.tar.bz2"
@@ -90,52 +77,60 @@
 	esac
 fi
 
-# Common xdelta code
-if [[ -n "$XDELTA_BASE" ]]; then # depends on $PV only, so is safe to modify SRC_URI inside it
-	IUSE="${IUSE} kdexdeltas"
-
-	# Necessary dep for xdeltas. Hope like hell it doesn't worm its way into RDEPEND
-	# through the sneaky eclass dep mangling portage does.
-	DEPEND="$DEPEND kdexdeltas? ( =dev-util/xdelta-1* )"
-
-	SRC_URI="$SRC_URI kdexdeltas? ( $XDELTA_BASE "
-	for x in $XDELTA_DELTA; do
-		SRC_URI="$SRC_URI $x"
-	done
-	SRC_URI="$SRC_URI ) !kdexdeltas? ( $SRC_PATH )"
-else # xdelta don't available, for example with kde 3.4 alpha/beta/rc ebuilds.
-	SRC_URI="$SRC_URI $SRC_PATH"
-fi
+SRC_URI="$SRC_URI $SRC_PATH"
 
 debug-print "$ECLASS: finished, SRC_URI=$SRC_URI"
 
-# END adapted from kde-dist.eclass
-
 # Add a blocking dep on the package we're derived from
 if [[ "${KMNAME}" != "koffice" ]]; then
 	DEPEND="${DEPEND} !=$(get-parent-package ${CATEGORY}/${PN})-${SLOT}*"
 	RDEPEND="${RDEPEND} !=$(get-parent-package ${CATEGORY}/${PN})-${SLOT}*"
 else
-	DEPEND="${DEPEND} !$(get-parent-package ${CATEGORY}/${PN})"
-	RDEPEND="${RDEPEND} !$(get-parent-package ${CATEGORY}/${PN})"
+	case ${EAPI:-0} in
+		# EAPIs without SLOT dependencies.
+		0)  DEPEND="${DEPEND} !=$(get-parent-package ${CATEGORY}/${PN})-${KDEMAJORVER}.${KDEMINORVER}*"
+			RDEPEND="${RDEPEND} !=$(get-parent-package ${CATEGORY}/${PN})-${KDEMAJORVER}.${KDEMINORVER}*"
+			;;
+		# EAPIs with SLOT dependencies.
+		*)  DEPEND="${DEPEND} !$(get-parent-package ${CATEGORY}/${PN}):${SLOT}"
+			RDEPEND="${RDEPEND} !$(get-parent-package ${CATEGORY}/${PN}):${SLOT}"
+			;;
+	esac
 fi
 
-# Set the following variables in the ebuild. Only KMNAME must be set, the rest are optional.
-# A directory or file can be a path with any number of components (eg foo/bar/baz.h).
+# @ECLASS-VARIABLE: KMNAME
+# @DESCRIPTION:
+# Name of the metapackage (eg kdebase, kdepim). Must be set before inheriting
+# this eclass, since it affects $SRC_URI. This variable MUST be set.
+
+# @ECLASS-VARIABLE: KMNOMODULE
+# @DESCRIPTION:
+# Unless set to "true", then KMMODULE will be not defined and so also the docs.
+# Useful when we want to installs subdirs of a subproject, like plugins, and we
+# have to mark the topsubdir ad KMEXTRACTONLY.
+
+# @ECLASS-VARIABLE: KMMODULE
+# @DESCRIPTION:
+# Defaults to $PN. Specify one subdirectory of KMNAME. Is treated exactly like items in KMEXTRA.
+# Fex., the ebuild name of kdebase/l10n is kdebase-l10n, because just 'l10n' would be too confusing.
 # Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY, KMCOPYLIB.
+
+# @ECLASS-VARIABLE: KMNODOCS
+# @DESCRIPTION:
+# Unless set to "true", 'doc/$KMMODULE' is added to KMEXTRA. Set for packages that don't have docs.
+
+# @ECLASS-VARIABLE: KMEXTRA
+# @DESCRIPTION:
+# Specify files/dirs to extract, compile and install. $KMMODULE is added to
+# KMEXTRA automatically. So is doc/$KMMODULE (unless $KMNODOCS==true). Makefiles
+# are created automagically to compile/install the correct files. Observe these
+# rules:
 #
-# KMNAME: name of the metapackage (eg kdebase, kdepim). Must be set before inheriting this eclass
-# (unlike the other parameters here), since it affects $SRC_URI.
-# KMNOMODULE: unless set to "true", then KMMODULE will be not defined and so also the docs. Useful when we want to installs subdirs of a subproject, like plugins, and we have to mark the topsubdir ad KMEXTRACTONLY.
-# KMMODULE: Defaults to $PN. Specify one subdirectory of KMNAME. Is treated exactly like items in KMEXTRA.
-# Fex., the ebuild name of kdebase/l10n is kdebase-l10n, because just 'l10n' would be too confusing.
-# KMNODOCS: unless set to "true", 'doc/$KMMODULE' is added to KMEXTRA. Set for packages that don't have docs.
-# KMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY: specify files/dirs to extract, compile and install. $KMMODULE
-# is added to $KMEXTRA automatically. So is doc/$KMMODULE (unless $KMNODOCS==true).
-# Makefiles are created automagically to compile/install the correct files. Observe these rules:
-# - Don't specify the same file in more than one of the three variables.
+# - Don't specify the same file in more than one of three variables (KMEXTRA,
+# KMCOMPILEONLY, and KMEXTRACTONLY)
 # - When using KMEXTRA, remember to add the doc/foo dir for the extra dirs if one exists.
 # - KMEXTRACTONLY take effect over an entire directory tree, you can override it defining
+#
 # KMEXTRA, KMCOMPILEONLY for every subdir that must have a different behavior.
 # eg. you have this tree:
 # foo/bar
@@ -147,44 +142,57 @@
 # then the only directory compiled will be foo/bar/baz1 and not foo/bar/baz1/taz (also if it's a subdir of a KMEXTRA) or foo/bar/baz2
 #
 # IMPORTANT!!! you can't define a KMCOMPILEONLY SUBDIR if its parents are defined as KMEXTRA or KMMODULE. or it will be installed anywhere. To avoid this probably are needed some chenges to the generated Makefile.in.
-#
-# KMCOPYLIB: Contains an even number of $IFS (i.e. whitespace) -separated words.
+# Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY, KMCOPYLIB.
+
+# @ECLASS-VARIABLE: KMCOMPILEONLY
+# @DESCRIPTION:
+# Please see KMEXTRA
+
+# @ECLASS-VARIABLE: KMEXTRACTONLY
+# @DESCRIPTION:
+# Please see KMEXTRA
+
+# @ECLASS-VARIABLE: KMCOPYLIB
+# @DESCRIPTION:
+# Contains an even number of $IFS (i.e. whitespace) -separated words.
 # Each two consecutive words, libname and dirname, are considered. symlinks are created under $S/$dirname
 # pointing to $PREFIX/lib/libname*.
+# Do not include the same item in more than one of KMMODULE, KMMEXTRA, KMCOMPILEONLY, KMEXTRACTONLY, KMCOPYLIB.
+
 
 # ====================================================
 
+# @FUNCTION: create_fullpaths
+# @DESCRIPTION:
 # create a full path vars, and remove ALL the endings "/"
-function create_fullpaths() {
+create_fullpaths() {
 	for item in $KMMODULE; do
-		tmp=`echo $item | sed -e "s/\/*$//g"`
-		KMMODULEFULLPATH="$KMMODULEFULLPATH ${S}/$tmp"
+		KMMODULEFULLPATH="$KMMODULEFULLPATH ${S}/${item%/}"
 	done
 	for item in $KMEXTRA; do
-		tmp=`echo $item | sed -e "s/\/*$//g"`
-		KMEXTRAFULLPATH="$KMEXTRAFULLPATH ${S}/$tmp"
+		KMEXTRAFULLPATH="$KMEXTRAFULLPATH ${S}/${item%/}"
 	done
 	for item in $KMCOMPILEONLY; do
-		tmp=`echo $item | sed -e "s/\/*$//g"`
-		KMCOMPILEONLYFULLPATH="$KMCOMPILEONLYFULLPATH ${S}/$tmp"
+		KMCOMPILEONLYFULLPATH="$KMCOMPILEONLYFULLPATH ${S}/${item%/}"
 	done
 	for item in $KMEXTRACTONLY; do
-		tmp=`echo $item | sed -e "s/\/*$//g"`
-		KMEXTRACTONLYFULLPATH="$KMEXTRACTONLYFULLPATH ${S}/$tmp"
+		KMEXTRACTONLYFULLPATH="$KMEXTRACTONLYFULLPATH ${S}/${item%/}"
 	done
 }
 
+# @FUNCTION: change_makefiles
+# @USAGE: < dir > < isextractonly >
+# @DESCRIPTION:
 # Creates Makefile.am files in directories where we didn't extract the originals.
-# Params: $1 = directory
-# $2 = $isextractonly: true iff the parent dir was defined as KMEXTRACTONLY
+# $isextractonly: true if the parent dir was defined as KMEXTRACTONLY
 # Recurses through $S and all subdirs. Creates Makefile.am with SUBDIRS=<list of existing subdirs>
 # or just empty all:, install: targets if no subdirs exist.
-function change_makefiles() {
-	debug-print-function $FUNCNAME $*
+change_makefiles() {
+	debug-print-function $FUNCNAME "$@"
 	local dirlistfullpath dirlist directory isextractonly
 
-	cd $1
-	debug-print "We are in `pwd`"
+	cd "${1}"
+	debug-print "We are in ${PWD}"
 
 	# check if the dir is defined as KMEXTRACTONLY or if it was defined is KMEXTRACTONLY in the parent dir, this is valid only if it's not also defined as KMMODULE, KMEXTRA or KMCOMPILEONLY. They will ovverride KMEXTRACTONLY, but only in the current dir.
 	isextractonly="false"
@@ -196,7 +204,7 @@
 
 	dirlistfullpath=
 	for item in *; do
-		if [[ -d "$item" ]] && [[ "$item" != "CVS" ]] && [[ "$S/$item" != "$S/admin" ]]; then
+		if [[ -d "${item}" && "${item}" != "CVS" && "${S}/${item}" != "${S}/admin" ]]; then
 			# add it to the dirlist, with the FULL path and an ending "/"
 			dirlistfullpath="$dirlistfullpath ${1}/${item}"
 		fi
@@ -215,7 +223,7 @@
 	done
 
 	cd $1
-	debug-print "Come back to `pwd`"
+	debug-print "Come back to ${PWD}"
 	debug-print "dirlist = $dirlistfullpath"
 	if [[ $isextractonly = "true" ]] || [[ ! -f Makefile.am ]] ; then
 		# if this is a latest subdir
@@ -237,7 +245,7 @@
 	fi
 }
 
-function set_common_variables() {
+set_common_variables() {
 	# Overridable module (subdirectory) name, with default value
 	if [[ "$KMNOMODULE" != "true" ]] && [[ -z "$KMMODULE" ]]; then
 		KMMODULE=$PN
@@ -250,10 +258,13 @@
 	fi
 }
 
+# @FUNCTION: kde-meta_src_unpack
+# @USAGE: [ unpack ] [ makefiles ]
+# @DESCRIPTION:
 # This has function sections now. Call unpack, apply any patches not in $PATCHES,
 # then call makefiles.
-function kde-meta_src_unpack() {
-	debug-print-function $FUNCNAME $*
+kde-meta_src_unpack() {
+	debug-print-function $FUNCNAME "$@"
 
 	set_common_variables
 
@@ -278,26 +289,10 @@
 			extractlist="$extractlist $KMNAME-$TARBALLDIRVER/${item%/}"
 		done
 
-		# xdeltas require us to uncompress to a tar file first.
 		# $KMTARPARAMS is also available for an ebuild to use; currently used by kturtle
-		if [[ -n "$XDELTA_BASE" ]] && useq kdexdeltas ; then
-			echo ">>> Base archive + xdelta patch mode enabled."
-			echo ">>> Uncompressing base archive..."
-			cd $T
-			RAWTARBALL=${TARBALL//.bz2}
-			bunzip2 -dkc ${DISTDIR}/${XDELTA_BASE/*\//} > $RAWTARBALL
-			for delta in $XDELTA_DELTA; do
-				deltafile="${delta/*\//}"
-				echo ">>> Applying xdelta: $deltafile"
-				xdelta patch ${DISTDIR}/$deltafile $RAWTARBALL $RAWTARBALL.1
-				mv $RAWTARBALL.1 $RAWTARBALL
-			done
-			TARFILE=$T/$RAWTARBALL
-		else
-			TARFILE=$DISTDIR/$TARBALL
-			KMTARPARAMS="$KMTARPARAMS -j"
-		fi
-		cd $WORKDIR
+		TARFILE=$DISTDIR/$TARBALL
+		KMTARPARAMS="$KMTARPARAMS -j"
+		cd "${WORKDIR}"
 
 		echo ">>> Unpacking parts of ${TARBALL} to ${WORKDIR}"
 		# Note that KMTARPARAMS is also used by an ebuild
@@ -312,8 +307,8 @@
 		fi
 
 		# Default $S is based on $P not $myP; rename the extracted dir to fit $S
-		mv $KMNAME-$TARBALLDIRVER $P || die
-		S="${WORKDIR}/${P}"
+		mv $KMNAME-$TARBALLDIRVER $P || die "mv $KMNAME-$TARBallDIRVER failed."
+		S="${WORKDIR}"/${P}
 
 		# Copy over KMCOPYLIB items
 		libname=""
@@ -322,13 +317,13 @@
 				libname=$x
 			else
 				dirname=$x
-				cd $S
+				cd "${S}"
 				mkdir -p ${dirname}
 				cd ${dirname}
-				search_path=$(echo ${PREFIX}/$(get_libdir)/{,kde3/{,plugins/{designer,styles}}})
+				search_path=$(echo "${PREFIX}"/$(get_libdir)/{,kde3/{,plugins/{designer,styles}}})
 				if [[ ! "$(find ${search_path} -maxdepth 1 -name "${libname}*" 2>/dev/null)" == "" ]]; then
 					echo "Symlinking library ${libname} under ${PREFIX}/$(get_libdir)/ in source dir"
-					ln -s ${PREFIX}/$(get_libdir)/${libname}* .
+					ln -s "${PREFIX}"/$(get_libdir)/${libname}* .
 				else
 					die "Can't find library ${libname} under ${PREFIX}/$(get_libdir)/"
 				fi
@@ -341,29 +336,32 @@
 
 		# kdebase: Remove the installation of the "startkde" script.
 		if [[ "$KMNAME" == "kdebase" ]]; then
-			sed -i -e s:"bin_SCRIPTS = startkde"::g ${S}/Makefile.am.in
+			sed -i -e s:"bin_SCRIPTS = startkde"::g "${S}"/Makefile.am.in
 		fi
 
 		# for ebuilds with extended src_unpack
-		cd $S
+		cd "${S}"
 
 	;;
 	makefiles)
 
 		# Create Makefile.am files
 		create_fullpaths
-		change_makefiles $S "false"
+		change_makefiles "${S}" "false"
 
 		# for ebuilds with extended src_unpack
-		cd $S
+		cd "${S}"
 
 	;;
 	esac
 	done
 }
 
-function kde-meta_src_compile() {
-	debug-print-function $FUNCNAME $*
+# @FUNCTION: kde-meta_src_compile
+# @DESCRIPTION:
+# Does some checks before it invokes kde_src_compile
+kde-meta_src_compile() {
+	debug-print-function $FUNCNAME "$@"
 
 	set_common_variables
 
@@ -377,11 +375,15 @@
 		myconf="$myconf --disable-setgid"
 	fi
 
-	kde_src_compile $*
+	kde_src_compile "$@"
 }
 
-function kde-meta_src_install() {
-	debug-print-function $FUNCNAME $*
+# @FUNCTION: kde-meta_src_install
+# @USAGE: [ make ] [ dodoc ] [ all ]
+# @DESCRIPTION:
+# The kde-meta src_install function
+kde-meta_src_install() {
+	debug-print-function $FUNCNAME "$@"
 
 	set_common_variables
 
@@ -392,9 +394,9 @@
 		case $1 in
 			make)
 				for dir in $KMMODULE $KMEXTRA $DOCS; do
-					if [[ -d $S/$dir ]]; then
-						cd $S/$dir
-						make DESTDIR=${D} destdir=${D} install || die
+					if [[ -d "${S}"/$dir ]]; then
+						cd "${S}"/$dir
+						emake DESTDIR="${D}" destdir="${D}" install || die "emake install failed."
 					fi
 				done
 				;;



1.204                eclass/kde.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde.eclass?rev=1.204&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde.eclass?rev=1.204&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/kde.eclass?r1=1.203&r2=1.204

Index: kde.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/kde.eclass,v
retrieving revision 1.203
retrieving revision 1.204
diff -u -r1.203 -r1.204
--- kde.eclass	26 Jan 2008 23:21:03 -0000	1.203
+++ kde.eclass	20 Feb 2008 20:59:43 -0000	1.204
@@ -1,11 +1,17 @@
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2008 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde.eclass,v 1.203 2008/01/26 23:21:03 zlin Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde.eclass,v 1.204 2008/02/20 20:59:43 philantrop Exp $
+
+# @ECLASS: kde.eclass
+# @MAINTAINER:
+# kde@gentoo.org
 #
-# Author Dan Armak <danarmak@gentoo.org>
+# original author Dan Armak <danarmak@gentoo.org>
 #
 # Revisions Caleb Tennis <caleb@gentoo.org>
-# The kde eclass is inherited by all kde-* eclasses. Few ebuilds inherit straight from here.
+# @BLURB: The kde eclass is inherited by all kde-* eclasses.
+# @DESCRIPTION:
+# This eclass is inherited by all kde-* eclasses. Few ebuilds inherit straight from here.
 
 WANT_AUTOMAKE="1.9"
 
@@ -23,6 +29,13 @@
 	IUSE="${IUSE} kdeenablefinal"
 fi
 
+# @ECLASS-VARIABLE: KDE_S
+# @DESCRIPTION:
+# Like the 'normal' ${S} this variable takes the path to the temporary build
+# directory. If unset ${S} will be used.
+
+# @ECLASS-VARIABLE: USE_KEG_PACKAGING
+# @DESCRIPTION:
 # Set USE_KEG_PACKAGING=1 before inheriting if the package use extragear-like
 # packaging and then supports ${LANGS} and ${LANGS_DOC} variables.
 if [[ -n ${USE_KEG_PACKAGING} && -n "${LANGS}${LANGS_DOC}" ]]; then
@@ -51,6 +64,14 @@
 # overridden in other places like kde-dist, kde-source and some individual ebuilds
 SLOT="0"
 
+# @VARIABLE: ARTS_REQUIRED
+# @DESCRIPTION:
+# Is aRTs-support required or not? Possible values are 'yes', 'never'. Otherwise
+# leave this variable unset. This results in an arts USE flag.
+
+# @FUNCTION: kde_pkg_setup
+# @DESCRIPTION:
+# Some basic test about arts-support. It also filters some compiler flags
 kde_pkg_setup() {
 	if [[ ${PN} != "arts" ]] && [[ ${PN} != "kdelibs" ]] ; then
 		if [[ ${ARTS_REQUIRED} == 'yes' ]] || \
@@ -74,7 +95,7 @@
 		fi
 	fi
 
-	if [ "${PN}" = "kdelibs" ] ; then
+	if [[ "${PN}" = "kdelibs" ]]; then
 		use doc && if ! built_with_use =x11-libs/qt-3* doc ; then
 			eerror "Building kdelibs with the doc USE flag requires qt to be built with the doc USE flag."
 			eerror "Please re-emerge qt-3 with this USE flag enabled."
@@ -86,13 +107,20 @@
 	filter-flags -fvisibility=hidden -fvisibility-inlines-hidden
 }
 
+# @FUNCTION: kde_src_unpack
+# @DESCRIPTION:
+# This function unpacks the sources and patches it. The patches need to be named
+# $PN-$PV-*{diff,patch}
+#
+# This function also handles the linguas if extragear-like packaging is enabled.
+# (See USE_KEG_PACKAGING)
 kde_src_unpack() {
-	debug-print-function $FUNCNAME $*
+	debug-print-function $FUNCNAME "$@"
 
 	[[ -z ${KDE_S} ]] && KDE_S="${S}"
 
 	local PATCHDIR="${WORKDIR}/patches/"
-	if [[ -z $* ]] ; then
+	if [[ -z "$@" ]] ; then
 		# Unpack first and deal with KDE patches after examing possible patch sets.
 		# To be picked up, patches need to be named $PN-$PV-*{diff,patch} and be
 		# placed in $PATCHDIR. Monolithic ebuilds will use the split ebuild patches.
@@ -115,7 +143,7 @@
 	else
 		# Call base_src_unpack, which has sections, to do unpacking and patching
 		# step by step transparently as defined in the ebuild.
-		base_src_unpack $*
+		base_src_unpack "$@"
 	fi
 
 	# if extragear-like packaging is enabled, set the translations and the
@@ -150,12 +178,12 @@
 	# fix the 'languageChange undeclared' bug group: touch all .ui files, so that the
 	# makefile regenerate any .cpp and .h files depending on them.
 	cd "${KDE_S}"
-	debug-print "$FUNCNAME: Searching for .ui files in $PWD"
-	UIFILES="`find . -name '*.ui' -print`"
+	debug-print "$FUNCNAME: Searching for .ui files in ${PWD}"
+	UIFILES="$(find . -name '*.ui' -print)"
 	debug-print "$FUNCNAME: .ui files found:"
 	debug-print "$UIFILES"
 	# done in two stages, because touch doens't have a silent/force mode
-	if [ -n "$UIFILES" ]; then
+	if [[ -n "$UIFILES" ]]; then
 		debug-print "$FUNCNAME: touching .ui files..."
 		touch $UIFILES
 	fi
@@ -168,10 +196,17 @@
 	fi
 }
 
+# @FUNCTION: kde_src_compile
+# @USAGE: [ myconf ] [ configure ] [ make ] [ all ]
+# @DESCRIPTION:
+# This function compiles the sources. It takes care of "cannot write to .kde or
+# .qt"-problem due to sandbox and some other sandbox issues.
+#
+# If no argument is given, all is assumed.
 kde_src_compile() {
+	debug-print-function $FUNCNAME "$@"
 
-	debug-print-function $FUNCNAME $*
-	[ -z "$1" ] && kde_src_compile all
+	[[ -z "$1" ]] && kde_src_compile all
 
 	[[ -z ${KDE_S} ]] && KDE_S="${S}"
 	cd "${KDE_S}"
@@ -182,9 +217,9 @@
 	# this is a fake homedir that is writeable under the sandbox, so that the build process
 	# can do anything it wants with it.
 	REALHOME="$HOME"
-	mkdir -p $T/fakehome/.kde
-	mkdir -p $T/fakehome/.qt
-	export HOME="$T/fakehome"
+	mkdir -p "${T}"/fakehome/.kde
+	mkdir -p "${T}"/fakehome/.qt
+	export HOME="${T}"/fakehome
 	addwrite "${QTDIR}/etc/settings"
 
 	# Fix bug 96177: if KDEROOTHOME is defined, the ebuild accesses the real homedir via it, and not our exported $HOME
@@ -192,10 +227,10 @@
 	unset KDEROOTHOME
 
 	# things that should access the real homedir
-	[ -d "$REALHOME/.ccache" ] && ln -sf "$REALHOME/.ccache" "$HOME/"
-	[ -n "$UNSERMAKE" ] && addwrite "/usr/kde/unsermake"
+	[[ -d "$REALHOME/.ccache" ]] && ln -sf "$REALHOME/.ccache" "$HOME/"
+	[[ -n "$UNSERMAKE" ]] && addwrite "/usr/kde/unsermake"
 
-	while [ "$1" ]; do
+	while [[ "$1" ]]; do
 
 		case $1 in
 			myconf)
@@ -229,7 +264,7 @@
 
 				# rebuild configure script, etc
 				# This can happen with e.g. a cvs snapshot
-				if [ ! -f "./configure" ] || [ -n "$UNSERMAKE" ]; then
+				if [[ ! -f "./configure" ]] || [[ -n "$UNSERMAKE" ]]; then
 					# This is needed to fix building with autoconf 2.60.
 					# Many thanks to who preferred such a stupid check rather
 					# than a working arithmetic comparison.
@@ -252,13 +287,13 @@
 					fi
 
 					for x in Makefile.cvs admin/Makefile.common; do
-						if [ -f "$x" ] && [ -z "$makefile" ]; then makefile="$x"; fi
+						if [[ -f "$x" && -z "$makefile" ]]; then makefile="$x"; fi
 					done
-					if [ -f "$makefile" ]; then
+					if [[ -f "$makefile" ]]; then
 						debug-print "$FUNCNAME: configure: generating configure script, running make -f $makefile"
 						emake -j1 -f $makefile
 					fi
-					[ -f "./configure" ] || die "no configure script found, generation unsuccessful"
+					[[ -f "./configure" ]] || die "no configure script found, generation unsuccessful"
 				fi
 
 				export PATH="${KDEDIR}/bin:${PATH}"
@@ -329,7 +364,7 @@
 				# Seems ./configure add -O2 by default but hppa don't want that but we need -ffunction-sections
 				if [[ "${ARCH}" = "hppa" ]]
 				then
-					einfo Fixating Makefiles
+					einfo "Fixing Makefiles"
 					find ${KDE_S} -name Makefile -print0 | xargs -0 sed -i -e \
 						's:-O2:-ffunction-sections:g'
 				fi
@@ -350,9 +385,17 @@
 
 }
 
+# @FUNCTION: kde_src_install
+# @USAGE: [ make ] [ dodoc ] [ all ]
+# @DESCRIPTION:
+# This installs the software, including the right handling of the
+# "/usr/share/doc/kde"-dir, but it only installs AUTHORS, ChangeLog*, README*,
+# NEWS, and TODO (if available) as docs.
+#
+# If no argument is given, all is assumed
 kde_src_install() {
+	debug-print-function $FUNCNAME "$@"
 
-	debug-print-function $FUNCNAME $*
 	[[ -z "$1" ]] && kde_src_install all
 
 	[[ -z ${KDE_S} ]] && KDE_S="${S}"
@@ -363,12 +406,12 @@
 		case $1 in
 			make)
 				debug-print-section make
-				emake install DESTDIR=${D} destdir=${D} || die "died running make install, $FUNCNAME:make"
+				emake install DESTDIR="${D}" destdir="${D}" || die "died running make install, $FUNCNAME:make"
 				;;
 			dodoc)
 				debug-print-section dodoc
 				for doc in AUTHORS ChangeLog* README* NEWS TODO; do
-					[ -s "$doc" ] && dodoc $doc
+					[[ -s "$doc" ]] && dodoc $doc
 				done
 				;;
 			all)
@@ -388,7 +431,11 @@
 	fi
 }
 
-# slot rebuild function, thanks to Carsten Lohrke in bug 98425.
+# @FUNCTION: slot_rebuild
+# @RETURN: False, if no rebuild is required
+#
+# @MAINTAINER:
+# thanks to Carsten Lohrke in bug 98425.
 slot_rebuild() {
 	local VDB_PATH="$(portageq vdb_path)"
 	local REBUILD_LIST=""
@@ -415,7 +462,7 @@
 				eerror "Installation of ${j/${VDB_PATH}\//} is broken."
 				BROKEN_PKGS="${BROKEN_PKGS} ${j/${VDB_PATH}\//}"
 			else
-				if [[ $(cat ${m}  | grep -co "${KDEDIR}") = 0 ]] ; then
+				if [[ $(cat ${m} | grep -co "${KDEDIR}") = 0 ]] ; then
 					REBUILD_LIST="${REBUILD_LIST} =${j/${VDB_PATH}\//}"
 				fi
 			fi
@@ -430,7 +477,7 @@
 
 	if [[ -n "${REBUILD_LIST}" ]] ; then
 		local temp=""
-		cd ${VDB_PATH}
+		cd "${VDB_PATH}"
 		for i in ${REBUILD_LIST} ; do
 			i="$(echo ${i%-*} | cut -d= -f2)"
 			temp="${temp} $(find . -iname "DEPEND" -exec grep -H ${i} '{}' \; | cut -f2-3 -d/ | grep -v ${CATEGORY}/${PN})"
@@ -442,24 +489,34 @@
 	fi
 
 	if [[ -n "${REBUILD_LIST}" ]] ; then
-		einfo "Please run \"emerge --oneshot ${REBUILD_LIST}\" before continuing.\n"
+		einfo "Please run \"emerge --oneshot ${REBUILD_LIST}\" before continuing."
 	else
-		einfo "Done :), continuing...\n"
+		einfo "Done :), continuing..."
 		return 1
 	fi
 	echo
 }
 
+# @FUNCTION: kde_pkg_preinst
+# @DESCRIPTION:
+# Calls postprocess_desktop_entries
 kde_pkg_preinst() {
 	postprocess_desktop_entries
 }
 
+# @FUNCTION: kde_pkg_postinst
+# @DESCRIPTION:
+# Calls buildsycoca
 kde_pkg_postinst() {
 	buildsycoca
 }
 
+# @FUNCTION: kde_pkg_postrm
+# @DESCRIPTION:
+# Calls buildsycoca
 kde_pkg_postrm() {
 	buildsycoca
 }
 
 EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_install pkg_postinst pkg_postrm pkg_preinst
+



-- 
gentoo-commits@lists.gentoo.org mailing list



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-02-20 20:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-20 20:59 [gentoo-commits] gentoo-x86 commit in eclass: kde-dist.eclass kde-functions.eclass kde-meta.eclass kde.eclass Wulf Krueger (philantrop)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox