| 1 | # Copyright 1999-2008 Gentoo Foundation |
1 | # Copyright 1999-2008 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.41 2010/01/11 16:57:46 scarabeus Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.44 2010/01/13 09:51:53 scarabeus Exp $ |
| 4 | |
4 | |
| 5 | # @ECLASS: base.eclass |
5 | # @ECLASS: base.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # QA Team <qa@gentoo.org> |
7 | # QA Team <qa@gentoo.org> |
| 8 | # |
8 | # |
| … | |
… | |
| 14 | |
14 | |
| 15 | inherit eutils |
15 | inherit eutils |
| 16 | |
16 | |
| 17 | BASE_EXPF="src_unpack src_compile src_install" |
17 | BASE_EXPF="src_unpack src_compile src_install" |
| 18 | case "${EAPI:-0}" in |
18 | case "${EAPI:-0}" in |
| 19 | 2|3|4) BASE_EXPF="src_prepare src_configure" ;; |
19 | 2|3|4) BASE_EXPF+=" src_prepare src_configure" ;; |
| 20 | *) ;; |
20 | *) ;; |
| 21 | esac |
21 | esac |
| 22 | |
22 | |
| 23 | EXPORT_FUNCTIONS ${BASE_EXPF} |
23 | EXPORT_FUNCTIONS ${BASE_EXPF} |
| 24 | |
24 | |
| 25 | # @ECLASS-VARIABLE: DOCS |
25 | # @ECLASS-VARIABLE: DOCS |
| 26 | # @USAGE: DOCS=( "${S}/doc/document.txt" "${S}/doc/doc_folder/" ) |
|
|
| 27 | # @DESCRIPTION: |
26 | # @DESCRIPTION: |
| 28 | # Array containing documents passed to dodoc command. |
27 | # Array containing documents passed to dodoc command. |
|
|
28 | # |
|
|
29 | # DOCS=( "${S}/doc/document.txt" "${S}/doc/doc_folder/" ) |
| 29 | |
30 | |
| 30 | # @ECLASS-VARIABLE: HTML_DOCS |
31 | # @ECLASS-VARIABLE: HTML_DOCS |
| 31 | # @USAGE: HTML_DOCS=( "${S}/doc/document.html" "${S}/doc/html_folder/" ) |
|
|
| 32 | # @DESCRIPTION: |
32 | # @DESCRIPTION: |
| 33 | # Array containing documents passed to dohtml command. |
33 | # Array containing documents passed to dohtml command. |
|
|
34 | # |
|
|
35 | # HTML_DOCS=( "${S}/doc/document.html" "${S}/doc/html_folder/" ) |
| 34 | |
36 | |
| 35 | # @ECLASS-VARIABLE: PATCHES |
37 | # @ECLASS-VARIABLE: PATCHES |
| 36 | # @USAGE: PATCHES=( "${FILESDIR}/mypatch.patch" "${FILESDIR}/patches_folder/" ) |
|
|
| 37 | # @DESCRIPTION: |
38 | # @DESCRIPTION: |
| 38 | # PATCHES array variable containing all various patches to be applied. |
39 | # PATCHES array variable containing all various patches to be applied. |
| 39 | # This variable is expected to be defined in global scope of ebuild. |
40 | # This variable is expected to be defined in global scope of ebuild. |
| 40 | # Make sure to specify the full path. This variable is utilised in |
41 | # Make sure to specify the full path. This variable is utilised in |
| 41 | # src_unpack/src_prepare phase based on EAPI. |
42 | # src_unpack/src_prepare phase based on EAPI. |
|
|
43 | # |
| 42 | # NOTE: if using patches folders with special file suffixes you have to |
44 | # NOTE: if using patches folders with special file suffixes you have to |
| 43 | # define one additional variable EPATCH_SUFFIX="something" |
45 | # define one additional variable EPATCH_SUFFIX="something" |
|
|
46 | # |
|
|
47 | # PATCHES=( "${FILESDIR}/mypatch.patch" "${FILESDIR}/patches_folder/" ) |
| 44 | |
48 | |
| 45 | |
49 | |
| 46 | # @FUNCTION: base_src_unpack |
50 | # @FUNCTION: base_src_unpack |
| 47 | # @DESCRIPTION: |
51 | # @DESCRIPTION: |
| 48 | # The base src_unpack function, which is exported. |
52 | # The base src_unpack function, which is exported. |
| … | |
… | |
| 101 | } |
105 | } |
| 102 | |
106 | |
| 103 | # @FUNCTION: base_src_configure |
107 | # @FUNCTION: base_src_configure |
| 104 | # @DESCRIPTION: |
108 | # @DESCRIPTION: |
| 105 | # The base src_configure function, which is exported when |
109 | # The base src_configure function, which is exported when |
| 106 | # EAPI is greater or equal to 2. Runs basic econf. |
110 | # EAPI is greater or equal to 2. Runs basic econf. Here the PATCHES array is |
|
|
111 | # evaluated. |
| 107 | base_src_configure() { |
112 | base_src_configure() { |
| 108 | debug-print-function $FUNCNAME "$@" |
113 | debug-print-function $FUNCNAME "$@" |
| 109 | |
114 | |
| 110 | # there is no pushd ${S} so we can override its place where to run |
115 | # there is no pushd ${S} so we can override its place where to run |
| 111 | [[ -x ${ECONF_SOURCE:-.}/configure ]] && econf |
116 | [[ -x ${ECONF_SOURCE:-.}/configure ]] && econf |