summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDan Armak <danarmak@gentoo.org>2002-03-27 22:33:54 +0000
committerDan Armak <danarmak@gentoo.org>2002-03-27 22:33:54 +0000
commit91171ee6f7a497827e45c4a0303d5cffb4ca0a77 (patch)
tree6874f956ec58d00e8a999feed54bf2b94c58e2bc /eclass
parentman page/LFH fixes (diff)
downloadgentoo-2-91171ee6f7a497827e45c4a0303d5cffb4ca0a77.tar.gz
gentoo-2-91171ee6f7a497827e45c4a0303d5cffb4ca0a77.tar.bz2
gentoo-2-91171ee6f7a497827e45c4a0303d5cffb4ca0a77.zip
big commit that makes eclasses work wth both old portages (1.8.8, rc6 profile) and the new ones
(>=1.8.9_pre32, 1.0 profile). the latter have some parts of the eclasses in ebuild.sh. Now i ahve a unified code base and commit changes easily.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/base.eclass13
-rw-r--r--eclass/debug.eclass45
-rw-r--r--eclass/doc/eclass-howto.lyx2
-rw-r--r--eclass/functions.eclass158
-rw-r--r--eclass/inherit.eclass52
-rw-r--r--eclass/kde.eclass12
6 files changed, 103 insertions, 179 deletions
diff --git a/eclass/base.eclass b/eclass/base.eclass
index 6b6a9e33a86a..f06cf8e6719b 100644
--- a/eclass/base.eclass
+++ b/eclass/base.eclass
@@ -1,10 +1,10 @@
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Dan Armak <danarmak@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.11 2002/02/07 18:52:18 danarmak Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.12 2002/03/27 22:33:53 danarmak Exp $
# The base eclass defines some default functions and variables. Nearly everything
# else inherits from here.
-inherit functions
+[ -n "$COMPAT" ] && inherit functions
ECLASS=base
S=${WORKDIR}/${P}
@@ -15,6 +15,8 @@ base_src_unpack() {
debug-print-function $FUNCNAME $*
[ -z "$1" ] && base_src_unpack all
+ cd ${WORKDIR}
+
while [ "$1" ]; do
case $1 in
@@ -40,9 +42,11 @@ base_src_unpack() {
base_src_compile() {
- debug-print-function $FUNCNAME $*
+ debug-print-function $FUNCNAME $*
[ -z "$1" ] && base_src_compile all
+ cd ${S}
+
while [ "$1" ]; do
case $1 in
@@ -70,6 +74,8 @@ base_src_install() {
debug-print-function $FUNCNAME $*
[ -z "$1" ] && base_src_install all
+ cd ${S}
+
while [ "$1" ]; do
case $1 in
@@ -89,4 +95,3 @@ base_src_install() {
}
EXPORT_FUNCTIONS src_unpack src_compile src_install
-
diff --git a/eclass/debug.eclass b/eclass/debug.eclass
index a4b9aed3ba2c..b7bfe95d09c2 100644
--- a/eclass/debug.eclass
+++ b/eclass/debug.eclass
@@ -1,19 +1,29 @@
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Dan Armak <danarmak@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/eclass/debug.eclass,v 1.12 2002/03/27 18:33:23 danarmak Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/debug.eclass,v 1.13 2002/03/27 22:33:53 danarmak Exp $
# This provides functions for verbose output for debugging
-# redirect output, unset to disable. use e.g. /dev/stdout to write into a file/device.
-# use special setting "on" to echo the output - unlike above, doesn't violate sandbox.
-# the test here is to enable people to export DEBUG_OUTPUT before running ebuild/emerge
-# so that they won't have to edit debug.eclass anymore
-#[ -n "$ECLASS_DEBUG_OUTPUT" ] || ECLASS_DEBUG_OUTPUT="on"
+# Moved into ebuild.sh in portage-1.8.9_pre32. Here for compatibility.
-# used internally for output
-# redirects output wherever's needed
-# in the future might use e* from /etc/init.d/functions.sh if i feel like it
-debug-print() {
+if [ -z "$COMPAT" ]; then
+
+ einfo "!!! Error: debug.eclass sourced, but compatibility mode not set. This ebuild needs
+to be updated, please report."
+ exit 1
+
+else
+
+ # redirect output, unset to disable. use e.g. /dev/stdout to write into a file/device.
+ # use special setting "on" to echo the output - unlike above, doesn't violate sandbox.
+ # the test here is to enable people to export DEBUG_OUTPUT before running ebuild/emerge
+ # so that they won't have to edit debug.eclass anymore
+ #[ -n "$ECLASS_DEBUG_OUTPUT" ] || ECLASS_DEBUG_OUTPUT="on"
+
+ # used internally for output
+ # redirects output wherever's needed
+ # in the future might use e* from /etc/init.d/functions.sh if i feel like it
+ debug-print() {
while [ "$1" ]; do
@@ -30,21 +40,22 @@ debug-print() {
shift
done
-}
-
-# std message functions
+ }
-debug-print-function() {
+ # std message functions
+
+ debug-print-function() {
str="$1: entering function"
shift
debug-print "$str, parameters: $*"
-}
+ }
-debug-print-section() {
+ debug-print-section() {
debug-print "now in section $*"
-}
+ }
+fi
diff --git a/eclass/doc/eclass-howto.lyx b/eclass/doc/eclass-howto.lyx
index 924d176a5c04..c50275d5d721 100644
--- a/eclass/doc/eclass-howto.lyx
+++ b/eclass/doc/eclass-howto.lyx
@@ -30,7 +30,7 @@ eclass howto
Dan Armak
\layout Date
-Updated for 20020206
+Partailly updated for 20020206
\layout Section
Warning
diff --git a/eclass/functions.eclass b/eclass/functions.eclass
index 317d349c320d..84ab955fc1b7 100644
--- a/eclass/functions.eclass
+++ b/eclass/functions.eclass
@@ -1,16 +1,30 @@
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Dan Armak <danarmak@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/eclass/functions.eclass,v 1.8 2002/03/27 19:54:16 danarmak Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/functions.eclass,v 1.9 2002/03/27 22:33:53 danarmak Exp $
# This contains everything except things that modify ebuild variables and functions (e.g. $P, src_compile() etc.)
-ECLASS=functions
-# ---------------------
-# misc helper functions
-# ---------------------
+# Moved into ebuild.sh in portage-1.8.9_pre32. Here for compatibility with rc6 profiles and 1.8.8 portages.
-# adds all parameters to DEPEND and RDEPEND
-newdepend() {
+if [ -z "$COMPAT" ]; then
+
+ einfo "!!! Error: functions.eclass sourced, but compatibility mode not set. This ebuild needs
+to be updated, please report."
+ exit 1
+
+else
+
+ # in case someone really wants the old functions.eclass, get this too, it was a part of it once
+ inherit kde-functions
+
+ ECLASS=functions
+
+ # ---------------------
+ # misc helper functions
+ # ---------------------
+
+ # adds all parameters to DEPEND and RDEPEND
+ newdepend() {
debug-print-function newdepend $*
debug-print "newdepend: DEPEND=$DEPEND RDEPEND=$RDEPEND"
@@ -34,132 +48,4 @@ newdepend() {
}
-# ---------------------------------------------------------------
-# kde/qt directory management etc. functions, was kde-dirs.ebuild
-# ---------------------------------------------------------------
-
-need-kde() {
-
- debug-print-function $FUNCNAME $*
- KDEVER="$1"
-
- #newdepend ">=kde-base/kdelibs-$KDEVER"
- min-kde-ver $KDEVER
- newdepend "=kde-base/kdelibs-${selected_version}*"
- set-kdedir $KDEVER
-
- qtver-from-kdever $KDEVER
- need-qt $selected_version
-
-}
-
-set-kdedir() {
-
- debug-print-function $FUNCNAME $*
-
- # default settings for older make.globals versions which don't include the default KDE?DIR settings
- [ -z "$KDE2DIR" ] && export KDE2DIR="/usr/kde/2"
- [ -z "$KDE3DIR" ] && export KDE3DIR="/usr/kde/3"
- # not defined at all by default
- [ -z "$KDE2LIBSDIR" ] && export KDE2LIBSDIR="$KDE2DIR"
- [ -z "$KDE3LIBSDIR" ] && export KDE3LIBSDIR="$KDE3DIR"
-
- # select 1st element in dot-separated string
- IFSBACKUP=$IFS
- IFS="."
- KDEMAJORVER=""
- for x in $1; do
- [ -z "$KDEMAJORVER" ] && KDEMAJORVER=$x
- done
- IFS=$IFSBACKUP
-
- case $KDEMAJORVER in
- 2) export KDEDIR=${KDE2LIBSDIR};;
- 3) export KDEDIR=${KDE3LIBSDIR};;
- esac
-
- debug-print "$FUNCNAME: result: KDEDIR=$KDEDIR"
-
-}
-
-need-qt() {
-
- debug-print-function $FUNCNAME $*
- QTVER="$1"
- #newdepend ">=x11-libs/qt-$QTVER"
- min-qt-ver $QTVER
- newdepend "=x11-libs/qt-$selected_version*"
- set-qtdir $QTVER
-
-}
-
-set-qtdir() {
-
- debug-print-function $FUNCNAME $*
-
- # select 1st element in dot-separated string
- IFSBACKUP=$IFS
- IFS="."
- QTMAJORVER=""
- for x in $1; do
- [ -z "$QTMAJORVER" ] && QTMAJORVER=$x
- done
- IFS=$IFSBACKUP
-
- export QTDIR="/usr/qt/$QTMAJORVER"
-
-}
-
-# returns minimal qt version needed for specified kde version
-qtver-from-kdever() {
-
- debug-print-function $FUNCNAME $*
-
- local ver
-
- case $1 in
- 2*) ver=2.3.1;;
- 3*) ver=3.0.1;;
- *) echo "!!! error: $FUNCNAME() called with invalid parameter: \"$1\", please report bug" && exit 1;;
- esac
-
- selected_version="$ver"
-
-}
-
-# compat
-need-kdelibs() {
- echo "WARNING: need-kdelibs() called, where need-kde() is correct.
-If this happens at the unmerging of an old ebuild, disregard; otherwise report."
- need-kde $*
-}
-
-min-kde-ver() {
-
- debug-print-function $FUNCNAME $*
-
- case $1 in
- 2*) selected_version="2.2.2";;
- 3.0_beta1) selected_version="3.0_beta1";;
- 3.0_beta2) selected_version="3.0_beta2";;
- 3.0_rc1) selected_version="3.0_rc1";;
- 3.0_rc2) selected_version="3.0_rc2";;
- 3.0_rc3) selected_version="3.0_rc3";;
- 3*) selected_version="3.0";;
- *) echo "!!! error: $FUNCNAME() called with invalid parameter: \"$1\", please report bug" && exit 1;;
- esac
-
-}
-
-min-qt-ver() {
-
- debug-print-function $FUNCNAME $*
-
- case $1 in
- 2*) selected_version="2.3";;
- 3*) selected_version="3";;
- *) echo "!!! error: $FUNCNAME() called with invalid parameter: \"$1\", please report bug" && exit 1;;
- esac
-
-}
-
+fi
diff --git a/eclass/inherit.eclass b/eclass/inherit.eclass
index a9fb791ea086..303c8d51f8a2 100644
--- a/eclass/inherit.eclass
+++ b/eclass/inherit.eclass
@@ -1,37 +1,50 @@
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Dan Armak <danarmak@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/eclass/inherit.eclass,v 1.13 2002/02/07 18:52:18 danarmak Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/inherit.eclass,v 1.14 2002/03/27 22:33:53 danarmak Exp $
# This eclass provides the inherit() function. In the future it will be placed in ebuild.sh, but for now drobbins
# doesn't want to make a new portage just for my testing, so every eclass/ebuild will source this file manually and
# then inherit(). This way when the time comes for this to move into ebuild.sh, we can just delete the source lines.
-ECLASS=inherit
-ECLASSDIR=/usr/portage/eclass
+# Since portage-1.8.9_pre32 eclasses were partially merged with ebuild.sh and this part went there.
+# Since we're providing backward support for rc6 profile/portage-1.8.8 owners till a month after
+# the 1.0 release, I do this which is like a c++ include file's #ifdef...#define...#endif
-inherit() {
+# $ECLASSDIR is defined in ebuild.sh in new portages. If it isn't there go into compatibility mode,
+# else sourcing this file does nothing
+
+if [ -z "$ECLASSDIR" ]; then
+
+ export COMPAT="true"
+
+ ECLASS=inherit
+ ECLASSDIR=/usr/portage/eclass
+
+ inherit() {
- while [ "$1" ]; do
+ while [ "$1" ]; do
- # any future resolution code goes here
- local location
- location="${ECLASSDIR}/${1}.eclass"
+ # any future resolution code goes here
+ local location
+ location="${ECLASSDIR}/${1}.eclass"
- # for now, disable by deafult because it creates a lot extra sourcing. (get debug lvels there already!)
- #. ${ECLASSDIR}/debug.eclass
- #debug-print "inherit: $1 -> $location"
+ # for now, disable by deafult because it creates a lot extra sourcing. (get debug lvels there already!)
+ #. ${ECLASSDIR}/debug.eclass
+ #debug-print "inherit: $1 -> $location"
- source "$location" || die "died sourcing $location in $FUNCNAME"
+ source "$location" || die "died sourcing $location in $FUNCNAME"
- shift
+ shift
- done
+ done
-}
+ }
-inherit debug
+ inherit debug
+
+ debug-print "inherit.eclass: compatibility mode set"
-EXPORT_FUNCTIONS() {
+ EXPORT_FUNCTIONS() {
while [ "$1" ]; do
debug-print "EXPORT_FUNCTIONS: ${1} -> ${ECLASS}_${1}"
@@ -39,5 +52,8 @@ EXPORT_FUNCTIONS() {
shift
done
-}
+ }
+else
+ debug-print "inherit.eclass: new portage detected, taking no action"
+fi
diff --git a/eclass/kde.eclass b/eclass/kde.eclass
index 54073705783a..e56f6fb97f8e 100644
--- a/eclass/kde.eclass
+++ b/eclass/kde.eclass
@@ -1,9 +1,9 @@
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Dan Armak <danarmak@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde.eclass,v 1.42 2002/03/07 17:54:47 danarmak Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde.eclass,v 1.43 2002/03/27 22:33:53 danarmak Exp $
# The kde eclass is inherited by all kde-* eclasses. Few ebuilds inherit straight from here.
-inherit base
+inherit base kde-functions
ECLASS=kde
newdepend /autotools
@@ -15,6 +15,8 @@ kde_src_compile() {
debug-print-function $FUNCNAME $*
[ -z "$1" ] && kde_src_compile all
+
+ cd ${S}
while [ "$1" ]; do
@@ -69,6 +71,8 @@ kde_src_install() {
debug-print-function $FUNCNAME $*
[ -z "$1" ] && kde_src_install all
+ cd ${S}
+
while [ "$1" ]; do
case $1 in
@@ -111,7 +115,9 @@ kde_sandbox_patch() {
[ -f "$x" ] && \
cp $x ${x}.orig && \
sed -e 's: $(bindir): $(DESTDIR)/$(bindir):g' ${x}.orig > ${x} && \
- rm ${x}.orig
+ rm ${x}.orig
+ sed -e 's: $(kde_datadir): $(DESTDIR)/$(kde_datadir):g' ${x}.orig > ${x} && \
+ rm ${x}.orig
done
shift
done