diff options
author | Dan Armak <danarmak@gentoo.org> | 2002-01-10 20:41:29 +0000 |
---|---|---|
committer | Dan Armak <danarmak@gentoo.org> | 2002-01-10 20:41:29 +0000 |
commit | f0496e8bc7d040529f4d8a7fd40d194d427c6a99 (patch) | |
tree | ac21783ef9cca1076d19624ed189ef77049d4a42 | |
parent | added a ||die description (diff) | |
download | historical-f0496e8bc7d040529f4d8a7fd40d194d427c6a99.tar.gz historical-f0496e8bc7d040529f4d8a7fd40d194d427c6a99.tar.bz2 historical-f0496e8bc7d040529f4d8a7fd40d194d427c6a99.zip |
moved the qt,kde directory-setting functions from kde.eclass to a new kde-dirs.eclass (which is
inherited by kde.eclass). apps which only need to know the location (e.g. to install a desktopp
symlink) will now be able to inherit kde-dirs only (i'll modify them to do that later) and thus avoid
the main body of kde eclass code.
also added initial non-standard multiple kdedirs support (should work, but not tested)
-rw-r--r-- | eclass/kde-dirs.eclass | 140 | ||||
-rw-r--r-- | eclass/kde.eclass | 144 |
2 files changed, 143 insertions, 141 deletions
diff --git a/eclass/kde-dirs.eclass b/eclass/kde-dirs.eclass new file mode 100644 index 000000000000..92ee9ab5904b --- /dev/null +++ b/eclass/kde-dirs.eclass @@ -0,0 +1,140 @@ +# 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-dirs.eclass,v 1.1 2002/01/10 20:41:29 danarmak Exp $ +# The kde eclass is inherited by all kde-* eclasses. Few ebuilds inherit straight from here. +ECLASS=kde-dirs + +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 $* + + # 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 KDE2LIBSDIR="$KDE3DIR" + + local KDEVER + KDEVER=$1 + + # select 1st element in dot-separated string + IFSBACKUP=$IFS + IFS="." + KDEMAJORVER="" + for x in $KDEVER; 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 $* + + local QTVER + QTVER=$1 + + # select 1st element in dot-separated string + IFSBACKUP=$IFS + IFS="." + QTMAJORVER="" + for x in $QTVER; 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() (kde.eclass) 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 $* +} + +# for new schemes +min-kde-ver() { + + debug-print-function $FUNCNAME $* + + case $1 in + 2*) selected_version="2.2.2-r2";; + 3*) selected_version="3.0";; + *) echo "!!! error: $FUNCNAME() (kde.eclass) 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.1";; + 3*) selected_version="3.0.1";; + *) echo "!!! error: $FUNCNAME() (kde.eclass) called with invalid parameter: \"$1\", please report bug" && exit 1;; + esac + +} + + + + + + + diff --git a/eclass/kde.eclass b/eclass/kde.eclass index d5200393a3c2..33d6f5f26edc 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.34 2002/01/10 19:57:41 danarmak Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kde.eclass,v 1.35 2002/01/10 20:41:29 danarmak Exp $ # The kde eclass is inherited by all kde-* eclasses. Few ebuilds inherit straight from here. -inherit autoconf base +inherit autoconf base kde-dirs ECLASS=kde DESCRIPTION="Based on the $ECLASS eclass" @@ -20,7 +20,7 @@ kde_src_compile() { case $1 in myconf) debug-print-section myconf - myconf="$myconf --host=${CHOST} --with-x --enable-mitshm --with-xinerama --with-qt-dir=${QTDIR} --with-kde-dir=${KDEDIR}" + myconf="$myconf --host=${CHOST} --with-x --enable-mitshm --with-xinerama --with-qt-dir=${QTDIR}" case $KDEMAJORVER in 2) myconf="$myconf --prefix=${KDE2DIR}";; 3) myconf="$myconf --prefix=${KDE3DIR}";; @@ -93,141 +93,3 @@ kde_src_install() { EXPORT_FUNCTIONS src_compile src_install -# This used to be depend.eclass. At some point I realized it might as well be called kde-depend.eclass. And then -# because functions from there needed functions from here and vice versa I merged them. - -#--------------- - -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 $* - - # 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" - - local KDEVER - KDEVER=$1 - - # select 1st element in dot-separated string - IFSBACKUP=$IFS - IFS="." - KDEMAJORVER="" - for x in $KDEVER; do - [ -z "$KDEMAJORVER" ] && KDEMAJORVER=$x - done - IFS=$IFSBACKUP - - case $KDEMAJORVER in - 2) export KDEDIR=${KDE2DIR};; - 3) export KDEDIR=${KDE3DIR};; - 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 $* - - local QTVER - QTVER=$1 - - # select 1st element in dot-separated string - IFSBACKUP=$IFS - IFS="." - QTMAJORVER="" - for x in $QTVER; 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() (kde.eclass) 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 $* -} - -# for new schemes -min-kde-ver() { - - debug-print-function $FUNCNAME $* - - case $1 in - 2*) selected_version="2.2.2-r2";; - 3*) selected_version="3.0";; - *) echo "!!! error: $FUNCNAME() (kde.eclass) 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.1";; - 3*) selected_version="3.0.1";; - *) echo "!!! error: $FUNCNAME() (kde.eclass) called with invalid parameter: \"$1\", please report bug" && exit 1;; - esac - -} - - - - - - - |