1 |
graaff 15/05/31 05:57:24 |
2 |
|
3 |
Modified: ChangeLog ruby-ng.eclass |
4 |
Added: ruby-single.eclass ruby-utils.eclass |
5 |
Log: |
6 |
Add ruby-single.eclass to support packages that just need a ruby interpreter to be present. Refactor code common with ruby-ng.eclass into ruby-utils.eclass. |
7 |
|
8 |
Revision Changes Path |
9 |
1.1630 eclass/ChangeLog |
10 |
|
11 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1630&view=markup |
12 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1630&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1629&r2=1.1630 |
14 |
|
15 |
Index: ChangeLog |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v |
18 |
retrieving revision 1.1629 |
19 |
retrieving revision 1.1630 |
20 |
diff -u -r1.1629 -r1.1630 |
21 |
--- ChangeLog 30 May 2015 16:09:05 -0000 1.1629 |
22 |
+++ ChangeLog 31 May 2015 05:57:23 -0000 1.1630 |
23 |
@@ -1,6 +1,12 @@ |
24 |
# ChangeLog for eclass directory |
25 |
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 |
26 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1629 2015/05/30 16:09:05 mpagano Exp $ |
27 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1630 2015/05/31 05:57:23 graaff Exp $ |
28 |
+ |
29 |
+ 31 May 2015; Hans de Graaff <graaff@g.o> ruby-ng.eclass, |
30 |
+ +ruby-single.eclass, +ruby-utils.eclass: |
31 |
+ Add ruby-single.eclass to support packages that just need a ruby interpreter |
32 |
+ to be present. Refactor code common with ruby-ng.eclass into |
33 |
+ ruby-utils.eclass. |
34 |
|
35 |
30 May 2015; Mike Pagano <mpagano@g.o> kernel-2.eclass: |
36 |
Drop PDEPEND on virtual/dev-manager. See bug #550086. |
37 |
|
38 |
|
39 |
|
40 |
1.57 eclass/ruby-ng.eclass |
41 |
|
42 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-ng.eclass?rev=1.57&view=markup |
43 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-ng.eclass?rev=1.57&content-type=text/plain |
44 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-ng.eclass?r1=1.56&r2=1.57 |
45 |
|
46 |
Index: ruby-ng.eclass |
47 |
=================================================================== |
48 |
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v |
49 |
retrieving revision 1.56 |
50 |
retrieving revision 1.57 |
51 |
diff -u -r1.56 -r1.57 |
52 |
--- ruby-ng.eclass 28 Dec 2014 07:23:56 -0000 1.56 |
53 |
+++ ruby-ng.eclass 31 May 2015 05:57:23 -0000 1.57 |
54 |
@@ -1,6 +1,6 @@ |
55 |
-# Copyright 1999-2014 Gentoo Foundation |
56 |
+# Copyright 1999-2015 Gentoo Foundation |
57 |
# Distributed under the terms of the GNU General Public License v2 |
58 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.56 2014/12/28 07:23:56 graaff Exp $ |
59 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.57 2015/05/31 05:57:23 graaff Exp $ |
60 |
|
61 |
# @ECLASS: ruby-ng.eclass |
62 |
# @MAINTAINER: |
63 |
@@ -34,6 +34,7 @@ |
64 |
# * all_ruby_configure |
65 |
|
66 |
# @ECLASS-VARIABLE: USE_RUBY |
67 |
+# @DEFAULT_UNSET |
68 |
# @REQUIRED |
69 |
# @DESCRIPTION: |
70 |
# This variable contains a space separated list of targets (see above) a package |
71 |
@@ -72,7 +73,7 @@ |
72 |
# (e.g. selenium's firefox driver extension). When set this argument is |
73 |
# passed to "grep -E" to remove reporting of these shared objects. |
74 |
|
75 |
-inherit eutils java-utils-2 multilib toolchain-funcs |
76 |
+inherit eutils java-utils-2 multilib toolchain-funcs ruby-utils |
77 |
|
78 |
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test src_install pkg_setup |
79 |
|
80 |
@@ -99,46 +100,7 @@ |
81 |
# Set `comparator' and `version' to include a comparator (=, >=, etc.) and a |
82 |
# version string to the returned string |
83 |
ruby_implementation_depend() { |
84 |
- local rubypn= |
85 |
- local rubyslot= |
86 |
- |
87 |
- case $1 in |
88 |
- ruby18) |
89 |
- rubypn="dev-lang/ruby" |
90 |
- rubyslot=":1.8" |
91 |
- ;; |
92 |
- ruby19) |
93 |
- rubypn="dev-lang/ruby" |
94 |
- rubyslot=":1.9" |
95 |
- ;; |
96 |
- ruby20) |
97 |
- rubypn="dev-lang/ruby" |
98 |
- rubyslot=":2.0" |
99 |
- ;; |
100 |
- ruby21) |
101 |
- rubypn="dev-lang/ruby" |
102 |
- rubyslot=":2.1" |
103 |
- ;; |
104 |
- ruby22) |
105 |
- rubypn="dev-lang/ruby" |
106 |
- rubyslot=":2.2" |
107 |
- ;; |
108 |
- ree18) |
109 |
- rubypn="dev-lang/ruby-enterprise" |
110 |
- rubyslot=":1.8" |
111 |
- ;; |
112 |
- jruby) |
113 |
- rubypn="dev-java/jruby" |
114 |
- rubyslot="" |
115 |
- ;; |
116 |
- rbx) |
117 |
- rubypn="dev-lang/rubinius" |
118 |
- rubyslot="" |
119 |
- ;; |
120 |
- *) die "$1: unknown Ruby implementation" |
121 |
- esac |
122 |
- |
123 |
- echo "$2${rubypn}$3${rubyslot}" |
124 |
+ _ruby_implementation_depend $1 |
125 |
} |
126 |
|
127 |
# @FUNCTION: ruby_samelib |
128 |
|
129 |
|
130 |
|
131 |
1.1 eclass/ruby-single.eclass |
132 |
|
133 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-single.eclass?rev=1.1&view=markup |
134 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-single.eclass?rev=1.1&content-type=text/plain |
135 |
|
136 |
Index: ruby-single.eclass |
137 |
=================================================================== |
138 |
# Copyright 1999-2015 Gentoo Foundation |
139 |
# Distributed under the terms of the GNU General Public License v2 |
140 |
# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-single.eclass,v 1.1 2015/05/31 05:57:23 graaff Exp $ |
141 |
|
142 |
# @ECLASS: ruby-single |
143 |
# @MAINTAINER: |
144 |
# Ruby team <ruby@g.o> |
145 |
# @AUTHOR: |
146 |
# Author: Hans de Graaff <graaff@g.o> |
147 |
# Based on python-single-r1 by: Michał Górny <mgorny@g.o> |
148 |
# @BLURB: An eclass for Ruby packages not installed for multiple implementations. |
149 |
# @DESCRIPTION: |
150 |
# An eclass for packages which don't support being installed for |
151 |
# multiple Ruby implementations. This mostly includes ruby-based |
152 |
# scripts. |
153 |
|
154 |
case "${EAPI:-0}" in |
155 |
0|1|2|3) |
156 |
die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" |
157 |
;; |
158 |
4|5) |
159 |
;; |
160 |
*) |
161 |
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" |
162 |
;; |
163 |
esac |
164 |
|
165 |
if [[ ! ${_RUBY_SINGLE} ]]; then |
166 |
|
167 |
inherit ruby-utils |
168 |
|
169 |
# @ECLASS-VARIABLE: USE_RUBY |
170 |
# @DEFAULT_UNSET |
171 |
# @REQUIRED |
172 |
# @DESCRIPTION: |
173 |
# This variable contains a space separated list of targets (see above) a package |
174 |
# is compatible to. It must be set before the `inherit' call. There is no |
175 |
# default. All ebuilds are expected to set this variable. |
176 |
|
177 |
|
178 |
# @ECLASS-VARIABLE: RUBY_DEPS |
179 |
# @DESCRIPTION: |
180 |
# |
181 |
# This is an eclass-generated Ruby dependency string for all |
182 |
# implementations listed in USE_RUBY. Any one of the supported ruby |
183 |
# targets will satisfy this dependency. |
184 |
# |
185 |
# Example use: |
186 |
# @CODE |
187 |
# RDEPEND="${RUBY_DEPS} |
188 |
# dev-foo/mydep" |
189 |
# BDEPEND="${RDEPEND}" |
190 |
# @ |
191 |
# |
192 |
# Example value: |
193 |
# @CODE |
194 |
# || ( dev-lang/ruby:2.0 dev-lang/ruby:1.9 ) |
195 |
# @CODE |
196 |
|
197 |
_ruby_single_implementations_depend() { |
198 |
local depend |
199 |
for _ruby_implementation in ${RUBY_TARGETS_PREFERENCE}; do |
200 |
if [[ ${USE_RUBY} =~ ${_ruby_implementation} ]]; then |
201 |
depend="${depend} $(_ruby_implementation_depend $_ruby_implementation)" |
202 |
fi |
203 |
done |
204 |
echo "|| ( ${depend} )" |
205 |
} |
206 |
|
207 |
_ruby_single_set_globals() { |
208 |
RUBY_DEPS=$(_ruby_single_implementations_depend) |
209 |
} |
210 |
_ruby_single_set_globals |
211 |
|
212 |
|
213 |
_RUBY_SINGLE=1 |
214 |
fi |
215 |
|
216 |
|
217 |
|
218 |
1.1 eclass/ruby-utils.eclass |
219 |
|
220 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-utils.eclass?rev=1.1&view=markup |
221 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-utils.eclass?rev=1.1&content-type=text/plain |
222 |
|
223 |
Index: ruby-utils.eclass |
224 |
=================================================================== |
225 |
# Copyright 1999-2015 Gentoo Foundation |
226 |
# Distributed under the terms of the GNU General Public License v2 |
227 |
# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-utils.eclass,v 1.1 2015/05/31 05:57:23 graaff Exp $ |
228 |
|
229 |
# @ECLASS: ruby-utils.eclass |
230 |
# @MAINTAINER: |
231 |
# Ruby team <ruby@g.o> |
232 |
# @AUTHOR: |
233 |
# Author: Hans de Graaff <graaff@g.o> |
234 |
# @BLURB: An eclass for supporting ruby scripts and bindings in non-ruby packages |
235 |
# @DESCRIPTION: |
236 |
# The ruby-utils eclass is designed to allow an easier installation of |
237 |
# Ruby scripts and bindings for non-ruby packages. |
238 |
# |
239 |
# This eclass does not set any metadata variables nor export any phase |
240 |
# functions. It can be inherited safely. |
241 |
|
242 |
|
243 |
if [[ ! ${_RUBY_UTILS} ]]; then |
244 |
|
245 |
|
246 |
# @ECLASS-VARIABLE: RUBY_TARGETS_PREFERENCE |
247 |
# @DESCRIPTION: |
248 |
# This variable lists all the known ruby targets in preference of use as |
249 |
# determined by the ruby team. By using this ordering rather than the |
250 |
# USE_RUBY mandated ordering we have more control over which ruby |
251 |
# implementation will be installed first (and thus eselected). This will |
252 |
# provide for a better first installation experience. |
253 |
|
254 |
# All RUBY_TARGETS |
255 |
RUBY_TARGETS_PREFERENCE="ruby20 ruby19 " |
256 |
|
257 |
# All other active ruby targets |
258 |
RUBY_TARGETS_PREFERENCE+="ruby21 ruby22 " |
259 |
|
260 |
|
261 |
_ruby_implementation_depend() { |
262 |
local rubypn= |
263 |
local rubyslot= |
264 |
|
265 |
case $1 in |
266 |
ruby18) |
267 |
rubypn="dev-lang/ruby" |
268 |
rubyslot=":1.8" |
269 |
;; |
270 |
ruby19) |
271 |
rubypn="dev-lang/ruby" |
272 |
rubyslot=":1.9" |
273 |
;; |
274 |
ruby20) |
275 |
rubypn="dev-lang/ruby" |
276 |
rubyslot=":2.0" |
277 |
;; |
278 |
ruby21) |
279 |
rubypn="dev-lang/ruby" |
280 |
rubyslot=":2.1" |
281 |
;; |
282 |
ruby22) |
283 |
rubypn="dev-lang/ruby" |
284 |
rubyslot=":2.2" |
285 |
;; |
286 |
ree18) |
287 |
rubypn="dev-lang/ruby-enterprise" |
288 |
rubyslot=":1.8" |
289 |
;; |
290 |
jruby) |
291 |
rubypn="dev-java/jruby" |
292 |
rubyslot="" |
293 |
;; |
294 |
rbx) |
295 |
rubypn="dev-lang/rubinius" |
296 |
rubyslot="" |
297 |
;; |
298 |
*) die "$1: unknown Ruby implementation" |
299 |
esac |
300 |
|
301 |
echo "$2${rubypn}$3${rubyslot}" |
302 |
} |
303 |
|
304 |
|
305 |
|
306 |
_RUBY_UTILS=1 |
307 |
fi |