| 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.48 2010/01/24 13:43:26 scarabeus Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.51 2010/05/25 20:37:12 reavertm 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 | # |
| … | |
… | |
| 63 | } |
63 | } |
| 64 | |
64 | |
| 65 | # @FUNCTION: base_src_prepare |
65 | # @FUNCTION: base_src_prepare |
| 66 | # @DESCRIPTION: |
66 | # @DESCRIPTION: |
| 67 | # The base src_prepare function, which is exported |
67 | # The base src_prepare function, which is exported |
| 68 | # EAPI is greater or equal to 2. |
68 | # EAPI is greater or equal to 2. Here the PATCHES array is evaluated. |
| 69 | base_src_prepare() { |
69 | base_src_prepare() { |
| 70 | debug-print-function $FUNCNAME "$@" |
70 | debug-print-function $FUNCNAME "$@" |
| 71 | debug-print "$FUNCNAME: PATCHES=$PATCHES" |
71 | debug-print "$FUNCNAME: PATCHES=$PATCHES" |
| 72 | |
72 | |
| 73 | local patches_failed=0 |
73 | local patches_failed=0 |
| … | |
… | |
| 85 | # in order to preserve normal EPATCH_SOURCE value that can |
85 | # in order to preserve normal EPATCH_SOURCE value that can |
| 86 | # be used other way than with base eclass store in local |
86 | # be used other way than with base eclass store in local |
| 87 | # variable and restore later |
87 | # variable and restore later |
| 88 | oldval=${EPATCH_SOURCE} |
88 | oldval=${EPATCH_SOURCE} |
| 89 | EPATCH_SOURCE=${x} |
89 | EPATCH_SOURCE=${x} |
|
|
90 | EPATCH_FORCE=yes |
| 90 | epatch |
91 | epatch |
| 91 | EPATCH_SOURCE=${oldval} |
92 | EPATCH_SOURCE=${oldval} |
| 92 | elif [[ -f "${x}" ]]; then |
93 | elif [[ -f "${x}" ]]; then |
| 93 | epatch "${x}" |
94 | epatch "${x}" |
| 94 | else |
95 | else |
| … | |
… | |
| 113 | } |
114 | } |
| 114 | |
115 | |
| 115 | # @FUNCTION: base_src_configure |
116 | # @FUNCTION: base_src_configure |
| 116 | # @DESCRIPTION: |
117 | # @DESCRIPTION: |
| 117 | # The base src_configure function, which is exported when |
118 | # The base src_configure function, which is exported when |
| 118 | # EAPI is greater or equal to 2. Runs basic econf. Here the PATCHES array is |
119 | # EAPI is greater or equal to 2. Runs basic econf. |
| 119 | # evaluated. |
|
|
| 120 | base_src_configure() { |
120 | base_src_configure() { |
| 121 | debug-print-function $FUNCNAME "$@" |
121 | debug-print-function $FUNCNAME "$@" |
| 122 | |
122 | |
| 123 | # there is no pushd ${S} so we can override its place where to run |
123 | # there is no pushd ${S} so we can override its place where to run |
| 124 | [[ -x ${ECONF_SOURCE:-.}/configure ]] && econf |
124 | [[ -x ${ECONF_SOURCE:-.}/configure ]] && econf $@ |
| 125 | } |
125 | } |
| 126 | |
126 | |
| 127 | # @FUNCTION: base_src_compile |
127 | # @FUNCTION: base_src_compile |
| 128 | # @DESCRIPTION: |
128 | # @DESCRIPTION: |
| 129 | # The base src_compile function, calls src_configure with |
129 | # The base src_compile function, calls src_configure with |
| … | |
… | |
| 170 | pushd "${S}" > /dev/null |
170 | pushd "${S}" > /dev/null |
| 171 | |
171 | |
| 172 | if [[ "$(declare -p DOCS 2>/dev/null 2>&1)" == "declare -a"* ]]; then |
172 | if [[ "$(declare -p DOCS 2>/dev/null 2>&1)" == "declare -a"* ]]; then |
| 173 | for x in "${DOCS[@]}"; do |
173 | for x in "${DOCS[@]}"; do |
| 174 | debug-print "$FUNCNAME: docs: creating document from ${x}" |
174 | debug-print "$FUNCNAME: docs: creating document from ${x}" |
| 175 | dodoc -r "${x}" || die "dodoc failed" |
175 | dodoc "${x}" || die "dodoc failed" |
| 176 | done |
176 | done |
| 177 | fi |
177 | fi |
| 178 | if [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" == "declare -a"* ]]; then |
178 | if [[ "$(declare -p HTML_DOCS 2>/dev/null 2>&1)" == "declare -a"* ]]; then |
| 179 | for x in "${HTML_DOCS[@]}"; do |
179 | for x in "${HTML_DOCS[@]}"; do |
| 180 | debug-print "$FUNCNAME: docs: creating html document from ${x}" |
180 | debug-print "$FUNCNAME: docs: creating html document from ${x}" |