/[gentoo-x86]/eclass/ruby-utils.eclass
Gentoo

Contents of /eclass/ruby-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun May 31 05:57:23 2015 UTC (3 years, 10 months ago) by graaff
Branch: MAIN
CVS Tags: HEAD
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.

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/ruby-ng.eclass,v 1.53 2013/12/26 07:11:48 graaff Exp $
4
5 # @ECLASS: ruby-utils.eclass
6 # @MAINTAINER:
7 # Ruby team <ruby@gentoo.org>
8 # @AUTHOR:
9 # Author: Hans de Graaff <graaff@gentoo.org>
10 # @BLURB: An eclass for supporting ruby scripts and bindings in non-ruby packages
11 # @DESCRIPTION:
12 # The ruby-utils eclass is designed to allow an easier installation of
13 # Ruby scripts and bindings for non-ruby packages.
14 #
15 # This eclass does not set any metadata variables nor export any phase
16 # functions. It can be inherited safely.
17
18
19 if [[ ! ${_RUBY_UTILS} ]]; then
20
21
22 # @ECLASS-VARIABLE: RUBY_TARGETS_PREFERENCE
23 # @DESCRIPTION:
24 # This variable lists all the known ruby targets in preference of use as
25 # determined by the ruby team. By using this ordering rather than the
26 # USE_RUBY mandated ordering we have more control over which ruby
27 # implementation will be installed first (and thus eselected). This will
28 # provide for a better first installation experience.
29
30 # All RUBY_TARGETS
31 RUBY_TARGETS_PREFERENCE="ruby20 ruby19 "
32
33 # All other active ruby targets
34 RUBY_TARGETS_PREFERENCE+="ruby21 ruby22 "
35
36
37 _ruby_implementation_depend() {
38 local rubypn=
39 local rubyslot=
40
41 case $1 in
42 ruby18)
43 rubypn="dev-lang/ruby"
44 rubyslot=":1.8"
45 ;;
46 ruby19)
47 rubypn="dev-lang/ruby"
48 rubyslot=":1.9"
49 ;;
50 ruby20)
51 rubypn="dev-lang/ruby"
52 rubyslot=":2.0"
53 ;;
54 ruby21)
55 rubypn="dev-lang/ruby"
56 rubyslot=":2.1"
57 ;;
58 ruby22)
59 rubypn="dev-lang/ruby"
60 rubyslot=":2.2"
61 ;;
62 ree18)
63 rubypn="dev-lang/ruby-enterprise"
64 rubyslot=":1.8"
65 ;;
66 jruby)
67 rubypn="dev-java/jruby"
68 rubyslot=""
69 ;;
70 rbx)
71 rubypn="dev-lang/rubinius"
72 rubyslot=""
73 ;;
74 *) die "$1: unknown Ruby implementation"
75 esac
76
77 echo "$2${rubypn}$3${rubyslot}"
78 }
79
80
81
82 _RUBY_UTILS=1
83 fi

  ViewVC Help
Powered by ViewVC 1.1.20