| 1 | # Copyright 1999-2009 Gentoo Foundation |
1 | # Copyright 1999-2009 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/ruby-ng.eclass,v 1.13 2010/05/01 16:05:45 flameeyes Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.14 2010/05/21 23:18:46 flameeyes Exp $ |
| 4 | # |
4 | # |
| 5 | # @ECLASS: ruby-ng.eclass |
5 | # @ECLASS: ruby-ng.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # Ruby herd <ruby@gentoo.org> |
7 | # Ruby herd <ruby@gentoo.org> |
| 8 | # |
8 | # |
| … | |
… | |
| 138 | atom="${condition}? ( ${atom} )" |
138 | atom="${condition}? ( ${atom} )" |
| 139 | done |
139 | done |
| 140 | |
140 | |
| 141 | RDEPEND="${RDEPEND} ${atom}" |
141 | RDEPEND="${RDEPEND} ${atom}" |
| 142 | _ruby_add_bdepend "$atom" test |
142 | _ruby_add_bdepend "$atom" test |
|
|
143 | } |
|
|
144 | |
|
|
145 | _ruby_atoms_samelib() { |
|
|
146 | local samelib=$(ruby_samelib) |
|
|
147 | |
|
|
148 | for token in $*; do |
|
|
149 | case "$token" in |
|
|
150 | "||" | "(" | ")" ) |
|
|
151 | echo "${token}" ;; |
|
|
152 | *) |
|
|
153 | echo "${token}${samelib}" ;; |
|
|
154 | esac |
|
|
155 | done |
| 143 | } |
156 | } |
| 144 | |
157 | |
| 145 | # @FUNCTION: ruby_add_rdepend |
158 | # @FUNCTION: ruby_add_rdepend |
| 146 | # @USAGE: [conditions] atom |
159 | # @USAGE: [conditions] atom |
| 147 | # @DESCRIPTION: |
160 | # @DESCRIPTION: |
| … | |
… | |
| 165 | *) |
178 | *) |
| 166 | die "bad number of arguments to $0" |
179 | die "bad number of arguments to $0" |
| 167 | ;; |
180 | ;; |
| 168 | esac |
181 | esac |
| 169 | |
182 | |
| 170 | for atom in $atoms; do |
|
|
| 171 | _ruby_add_rdepend "${atom}$(ruby_samelib)" "$conditions" |
183 | _ruby_add_rdepend "$(_ruby_atoms_samelib "${atoms}")" "$conditions" |
| 172 | done |
|
|
| 173 | } |
184 | } |
| 174 | |
185 | |
| 175 | # @FUNCTION: ruby_add_bdepend |
186 | # @FUNCTION: ruby_add_bdepend |
| 176 | # @USAGE: [conditions] atom |
187 | # @USAGE: [conditions] atom |
| 177 | # @DESCRIPTION: |
188 | # @DESCRIPTION: |
| … | |
… | |
| 196 | *) |
207 | *) |
| 197 | die "bad number of arguments to $0" |
208 | die "bad number of arguments to $0" |
| 198 | ;; |
209 | ;; |
| 199 | esac |
210 | esac |
| 200 | |
211 | |
| 201 | for atom in $atoms; do |
|
|
| 202 | _ruby_add_bdepend "${atom}$(ruby_samelib)" "$conditions" |
212 | _ruby_add_bdepend "$(_ruby_atoms_samelib "${atoms}")" "$conditions" |
| 203 | done |
|
|
| 204 | } |
213 | } |
| 205 | |
214 | |
| 206 | for _ruby_implementation in $USE_RUBY; do |
215 | for _ruby_implementation in $USE_RUBY; do |
| 207 | IUSE="${IUSE} ruby_targets_${_ruby_implementation}" |
216 | IUSE="${IUSE} ruby_targets_${_ruby_implementation}" |
| 208 | |
217 | |