summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDan Armak <danarmak@gentoo.org>2002-01-25 17:42:01 +0000
committerDan Armak <danarmak@gentoo.org>2002-01-25 17:42:01 +0000
commitb5acd41f80a610b8da73f3b73b1602cff0fee2cc (patch)
tree9d4d3f6aa1e081eed5160cfa7ddee32fd128fee6 /eclass
parentLatest version. (diff)
downloadgentoo-2-b5acd41f80a610b8da73f3b73b1602cff0fee2cc.tar.gz
gentoo-2-b5acd41f80a610b8da73f3b73b1602cff0fee2cc.tar.bz2
gentoo-2-b5acd41f80a610b8da73f3b73b1602cff0fee2cc.zip
typo fixes, remove unmaintained news.txt
Diffstat (limited to 'eclass')
-rw-r--r--eclass/doc/eclass-howto.lyx103
-rw-r--r--eclass/doc/news.txt187
-rw-r--r--eclass/doc/todo.txt4
-rw-r--r--eclass/inherit.eclass53
4 files changed, 55 insertions, 292 deletions
diff --git a/eclass/doc/eclass-howto.lyx b/eclass/doc/eclass-howto.lyx
index 62995647d581..8e25690b9ed5 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 eclasses v4
+Updated for 20020125
\layout Section
Introduction
@@ -43,38 +43,39 @@ eclasses are parts of ebuilds; that is, they have the same syntax ebuilds
As in OOP, this is used to ensure maximum code reuse among similar ebuilds.
\layout Standard
+This inheritance is implmented via simple bash sourcing.
+ So, when you 'inherit
+\begin_inset Quotes erd
+\end_inset
+
+ something its functions and variables override your own.
+ For this reason, variables and funcitons are usually extended and not just
+ set (more on this later).
+\layout Standard
+
The most similar group of ebuilds is the kde apps.
- were accordingly selected to be the test case for eclasses, and I believe
- I can now say the test has been successful.
+ These were accordingly selected to be the test case for eclasses, and I
+ believe I can now say the test has been successful.
Eclasses for non-kde ebuilds may follow, but there are no concrete plans
as of this time.
\layout Standard
-Please read news.txt for an abstract of changes between versions of the eclasses.
+Because of the current customizable KDEDIR (KDE?DIR, KDE?LIBSDIR) scheme,
+ all kde ebuilds (including ebuilds for apps with optional kde support)
+
+\emph on
+must
+\emph default
+use the eclasses.
+ As a minimum, inherit kde-dirs to get the set-qtdir(), set-kdedir() functions.
\layout Standard
Section two explains how eclasses work; section three explains how to write
inheriting ebuilds.
-\layout Subsection
-
-Notes on this document
-\layout Itemize
-
-
-\emph on
-ebuild variables/functions
-\emph default
- refers to those used in std.
- ebuilds e.g.
- $S, $P, src_unpack()...
-\layout Itemize
-
-Versioning: I suppose I could have made, instead of versions 1, 2, 3, 3.1,
- 3.1 versions 0.1, ...
- 0.3.1, or maybe 0.0.3-1.
- Usually I would.
- Not sure why I didn't.
- Too late to change it now.
+ If you just want to write an eubild for a kde app, section 3 is a good
+ concise introduction.
+ Section 2 makes for deeper understanding but is probably not worth the
+ time if you're just making an ebuild or two.
\layout Section
The eclasses
@@ -87,10 +88,28 @@ The best way of becoming familiar with the current eclass structure is an
inherit.eclass
\layout Standard
-Defines inherit() function which handles sourcing of eclasses.
+This is the basic eclass.
+ It should always be present (i.e.
+ inherited).
+ No other eclass iherits from it, however: an inheriting ebuild needs to
+ inherit it explicitly before it does anything else, by saying:
+\layout Code
+
+.
+ /usr/portage/eclass/inherit.eclass || die
+\layout Standard
+
+Eclasses do not need this first line, since they are always sourced from
+ an ebuild which already has it.
\layout Standard
-Syntax of inheriting: we define a simple function inherit():
+The second line would typically be:
+\layout Code
+
+inherit <list of eclasses>
+\layout Standard
+
+This eclass defines the inherit() function which handles sourcing of eclasses:
\layout Code
ECLASSDIR=/usr/portage/eclass
@@ -115,34 +134,14 @@ inherit() {
\layout Standard
This function simply sources files from a hard-coded location.
- If, in the future, we will decide to move eclasses to a different location
- or to introduce more
-\begin_inset Quotes eld
-\end_inset
-
-formats
-\begin_inset Quotes erd
-\end_inset
-
- (like drobbins' projected
-\emph on
-xbuilds
-\emph default
-), any name-to-file resolution code will go in here.
-\layout Standard
-
-Every inheriting ebuild begins with these two lines:
-\layout Code
-
-.
- /usr/portage/eclass/inherit.eclass || die
-\layout Code
+ If, in the future, we will decide to move eclasses to a different location,
+ any name-to-file resolution code will go in here.
+\layout Subsection
-inherit <list of eclasses> || die
-\layout Standard
+Generic eclass features
+\layout Subsubsection
-Eclasses do not need this first line, since they are always sourced from
- an ebuild which already has it.
+Debug output
\layout Subsection
virtual.eclass
diff --git a/eclass/doc/news.txt b/eclass/doc/news.txt
deleted file mode 100644
index e2c0b7efaad0..000000000000
--- a/eclass/doc/news.txt
+++ /dev/null
@@ -1,187 +0,0 @@
-04/01/2002
-merged virtual.eclass -> inherit.eclass.
-added || die to source statement in inherit(), so it's no longer needed when calling it.
-
-28/12
-v5.1
-Really big changes. Most of what has been added in the last versions has been deleted. Summary of changes:
-- There is now only one 2.x and one 3.x version of qt and kdelibs installed at any given time, should be the latest.
-They go into /usr/qt/{2,3} and /usr/kde/{2,3} respectively. Also the actual qt libs live in /usr/lib, while /usr/qt/{2,3}/lib
-is a symlink to /usr/lib.
-- The qt ebuild is now called x11-libs/qt (not qt-x11). It contains only the actual library, developer tools like the qt designer,
-the headers and moc. There is also an app-doc/qt-docs which installs the manpages, documentation, examples and tutorials.
-- An ebuild now calls need-kde $ver. This does:
- a. add kdelibs $ver to DEPEND/RDEPEND
- b. call set-kdedir, which sets KDEDIR to /usr/kde/2 or /usr/kde/3 based on the first char of $ver.
- c. call need-qt $qtver, where qtver is derived from kdever via qtver-from-kdever().
- d. need-qt adds $ver to DEPEND, RDEPEND and calls set-qtdir $ver.
- e. set-qtdir acts like set-kdedir wrt. QTDIR.
-- An ebuild that needs a special version of qt, or qt without kde, can call need-qt directly.
-- select-version() and separate-string() have been removed.
-- objprelink support has been removed since it doesn't work with the latest binutils; we are promised generic system-wide
-prelinking support Real Soon Now. All objprelink functions, calls, refs, deps etc. have been deleted, and the ebuilds
-will shortly be removed as well.
-
-27/12
-KDEVER[] renamed to KDEVERPARTS[] because it turns out if you have a KDEVER[]
-array in bash, you can't have a separate KDEVER variable but will access
-KDEVER[0] instead.
-Also many small misc fixes in kde.eclass.
-In particular to support versions like 3.0_beta1 which avtually have a source
-tarball/dir name of 3.0beta1 we now have kde.org.eclass and kde.eclass use
-${P//_} for SRC_URI and S.
-
-24/12
-fix for emerging a new kdelibs
-
-23/12
-v5
-This adds full support for multi-version coexistence, e.g. kde/qt 2/3/...
-There have been many many changes. Some of the are:
-
-A good conformist inheriting ebuild shuold now look something like this:
-------------
-# 4 header lines
-. /usr/portage/eclass/inherit.eclass || die
-inherit kde-something || die # inherit kde-base for most ebuilds, kde-dst/kde-i18n etc. for others
-need-kde x.y.z # must be present!
-
-# any code after this is not required and extends/overrides only
-need-qt x.y.z
-myconf="$myconf --mysetting=yes"
-<change other variables, functions>
-------------
-
-depend.eclass has been merged into kde.eclass due to cross-dependencies between the two.
-
-Note: need-kdelibs() is now called need-kde().
-
-need-kdelibs() exports:
-KDEVER version number required/matching
-KDEMAJORVER major version component (2, 3...)
-KDEVER[] array with components of KDEVER as elements (output of separate-string())
- major is element 0, minor is element 1... alpha, beta, pre, rc are resolved to
- -4, -3, -2, -1. There are always 5 elements; any missing ones are set to 0.
-
-If/when you want to do some kde2/3 specific stuff, just branch based on $KDEMAJORVER and/or $KDEVER, $KDEVER[].
-
-need-kdelibs() also adds KDEVER to DEPEND/RDEPEND and calls set-kdedir() which hasn't changed since v4.9.
-need-kdelibs() also calls qtver-from-kdever(), a new function that matches a qt version number to the supplied
-kde version number. Then need-kdelibs() calls need-qt() with the version number supplied by qtver-from-kdever().
-
-If you need a non-standard qt version, you can call need-q(0 yourself (after calling need-kde()) to override.
-need-qt() works exactly the same as need-kdelibs().
-
-Again: you must call need-kde, and you must supply *some* version.
-
-All inheriting ebuilds have been updated to use the new scheme.
-
-Only ebuilds inheriting from kde-base or directly from kde need to call need-kde(); the kde-dist, kde-i18n
-and koffice-i18n eclasses do it for you.
-
-23/12
-v4.9
-This extends depend.eclass a lot, adds function select-version(). I will now work on eclasses
-that will support qt/kde 2/3/... equally well and that will be v5. I will also update and clarify
-the docs then.
-select-version() select the best version from a number of versions offered. In comparison
-with the former simplistic algorithm, it supports:
-- incompatible major versions (i.e. 2.2.1 resolves to 2.3.2 not 3.0.1)
-- release type support (alpha, beta, pre, rc) and portage-format version specification:
-$major.$minor.$revision_<type>$number.
-- version parts > 9. The old algorithm compared per-character and thus thought 12<2.
-There are many more misc small updates and changes.
-One of them is that $DEBUG_OUTPUT is now changed into $ECLASS_DEBUG_OUTPUT, and can
-be set before running emerge/ebuild. That is, you don't ahve to edit debug.eclass anymore.
-
-16/11
-v4
-Added multi-qt and multi-kdelibs functionality. See detailed explanation in eclass howto.
-There is now a new depend.eclass inherited by kde.eclass. It provides two pairs of
-functions, need-{kdelibs,qt} and set-{kdedir,qtdir}.
-An inheriting ebuild calls "need-kdelibs $ver" from its main section and gets the correct
-things added to DEPEND and RDEPEND. Same for qt. Usually ebuilds don't call need-qt
-directly, because the kdelibs depend already provides them with the necessary qt
-version, but the function does exist and is usable.
-The set-* functions are called at the beginning of kde_src_compile/configure section.
-They export the correct QTDIR and KDEDIR (the latter points to the location of kdelibs)
-based on the vars kde_version and qt_version which are set in need-*. (So don't touch
-these vars; I've added a list of Internal Vars to the eclass howto). If no multi-*-scheme
-compatible directories are found, set-* leaves KDEDIR/QTDIR untouched, this enables
-older systems to work with the new eclass and ebuilds.
-There have been many other misc small changes in the eclasses, because this was a
-big commit after weeks of testing. For example the newdepend() function was added to
-base.eclass; I'll eventually modify ebuilds to use it.
-When the new dep functionality is added to portage, I'll change the need-* functions
-accordingly, but the ebuilds won't need to be changed.
-
-26/10
-Added koffice-i18n.eclass, very similar to kde-i18n.eclass.
-
-15/10
-Added some multi-QTDIR failsafes (shouldn't be needed, but do no harm):
-myconf+=--with-qt-dir=${QTDIR}
-LIBRARY_PATH=${LIBRARY_PATH}:${QTDIR}/lib make
-
-~12/10
-kde-objprelink-patch fixes
-
-5/10
-v3.3
-Removal of kde-objprelink. You now inherit from it no longer :-)
-It has been merged into kde. You will get the dependency and the configure parameter
-automatically, and can call kde-objprelink-patch() (which is now in kde.eclass) if needed.
-
-3/10
-v3.2
-Addition of kde-objprelink, further minor changes and fixes.
-You now inherit from kde-objprelink. If you need the admin patch, run kde-objprelink-patch()
-at the end of src_unpack. kde-dist inherits from kde-objprelink, other eclasses do not.
-
-2/10
-Unmasking of eclasses. Other developers test, but do not use in their work. Evaluation period.
-
-1/10
-v3.1
-Addition of debug.eclass.
-
-1/10
-v3
-Another major change.
-This involves primarily the kde eclasses.
-
-We now have kde.eclass, which is *not* the same as kde.eclass from v2, but is
-rather a kde-virtual eclass. It includes all the basic definitions and standard
-functions. It is med-level; people do not usually inherit from it.
-
-Then, we have high-level eclasses:
-kde-base.eclass inherits c,kde and adds pbjprelink,qt deps. It's used by misc apps.
-kde.org.eclass adds the SRC_URI/SRC_PATH block for ftp.kde.org and friends.
-kde-dist.eclass inherits kde-base,kde.org and adds HOMEPAGE,DESCRIPTION etc. and
- Kkdelibs-${PV} deps. It is used by kdebase/* packages.
-kde-i18n.eclass inerits kde,kde.org and adds the neccessary things for kde-i18n packages.
- It will probably be used for the upcoming koffice-i18n packages as well.
-
-Notice, now you now longer call kde-base_ and kde-i18n_ functions, but only kde_ functions.
-
-I have had to swap eclasses' names around to make them more intuitive. Here is a table
-of the changes:
-kde-virtual => kde
-kde => kde-base
-kde-base => kde-dist + kde.org
-kde-i18n == kde-i18n
-
-(kde-virtual was a mid-stage eclass from version 2.5 which was never commited on cvs).
-
-1/10
-v2.5
-A temp version which wasn't commited. Testbed for radical ideas.
-
-30/9
-v2
-Documented in original howto
-
-29/9
-v1
-Original version
-Had an infinite recursion in base.eclass. Was deleted from cvs later that day.
diff --git a/eclass/doc/todo.txt b/eclass/doc/todo.txt
index ea68d8e437e6..2ea6c0571f61 100644
--- a/eclass/doc/todo.txt
+++ b/eclass/doc/todo.txt
@@ -1,7 +1,3 @@
- sort out docs/sgml, get link from site
-- have ebuilds/eclasses use newdepend()
- sort debug.eclass msgs into levels, divide output
-- eclasses that support kde/qt 2/3/... equally well, without a default major number.
-- cvs/cvsup support :-)
-- update docs
- sort out local var declares
diff --git a/eclass/inherit.eclass b/eclass/inherit.eclass
index 7d5f8b8e10f7..cc962b74bbd3 100644
--- a/eclass/inherit.eclass
+++ b/eclass/inherit.eclass
@@ -1,10 +1,11 @@
# 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.9 2002/01/04 12:06:28 danarmak Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/inherit.eclass,v 1.10 2002/01/25 17:42:01 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 tmie comes for this to move into stable ebuild.sh, we can just delete the source lines.
+# 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
@@ -21,51 +22,5 @@ inherit() {
}
-# this was once virtual.eclass, now merged
-# provides empty functions that call debug-print-function and the EXPORT_FUNCTIONS() implementation
-
-inherit debug
-
-ECLASS=virtual
-
-DESCRIPTION="Based on the $ECLASS eclass."
-
-virtual_src_unpack() {
-debug-print-function $FUNCNAME $*
-}
-virtual_src_compile() {
-debug-print-function $FUNCNAME $*
-}
-virtual_src_install() {
-debug-print-function $FUNCNAME $*
-}
-virtual_pkg_preinst() {
-debug-print-function $FUNCNAME $*
-}
-virtual_pkg_postinst() {
-debug-print-function $FUNCNAME $*
-}
-virtual_pkg_prerm() {
-debug-print-function $FUNCNAME $*
-}
-virtual_pkg_postrm() {
-debug-print-function $FUNCNAME $*
-}
-
-# EXPORT_FUNCTIONS trick
-# This is the global part, defined here only.
-
-EXPORT_FUNCTIONS() {
-
- while [ "$1" ]; do
- debug-print "EXPORT_FUNCTIONS: ${1} -> ${ECLASS}_${1}"
- eval "$1() { ${ECLASS}_$1 ; }" > /dev/null
- shift
- done
-
-}
-
-
-# This part should be repeated for every eclass inheriting from here.
-EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_prerm pkg_postrm
+inherit virtual debug