diff options
author | Hans de Graaff <graaff@gentoo.org> | 2015-05-31 05:57:23 +0000 |
---|---|---|
committer | Hans de Graaff <graaff@gentoo.org> | 2015-05-31 05:57:23 +0000 |
commit | 2c8902ce11b8141812cb62d52a6f0352b91a5359 (patch) | |
tree | cccd220f6a53125ca88fad033c82165308de38d8 /eclass/ruby-utils.eclass | |
parent | Version bump. (diff) | |
download | gentoo-2-2c8902ce11b8141812cb62d52a6f0352b91a5359.tar.gz gentoo-2-2c8902ce11b8141812cb62d52a6f0352b91a5359.tar.bz2 gentoo-2-2c8902ce11b8141812cb62d52a6f0352b91a5359.zip |
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.
Diffstat (limited to 'eclass/ruby-utils.eclass')
-rw-r--r-- | eclass/ruby-utils.eclass | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/eclass/ruby-utils.eclass b/eclass/ruby-utils.eclass new file mode 100644 index 000000000000..edf7a8c0d3f5 --- /dev/null +++ b/eclass/ruby-utils.eclass @@ -0,0 +1,83 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-utils.eclass,v 1.1 2015/05/31 05:57:23 graaff Exp $ + +# @ECLASS: ruby-utils.eclass +# @MAINTAINER: +# Ruby team <ruby@gentoo.org> +# @AUTHOR: +# Author: Hans de Graaff <graaff@gentoo.org> +# @BLURB: An eclass for supporting ruby scripts and bindings in non-ruby packages +# @DESCRIPTION: +# The ruby-utils eclass is designed to allow an easier installation of +# Ruby scripts and bindings for non-ruby packages. +# +# This eclass does not set any metadata variables nor export any phase +# functions. It can be inherited safely. + + +if [[ ! ${_RUBY_UTILS} ]]; then + + +# @ECLASS-VARIABLE: RUBY_TARGETS_PREFERENCE +# @DESCRIPTION: +# This variable lists all the known ruby targets in preference of use as +# determined by the ruby team. By using this ordering rather than the +# USE_RUBY mandated ordering we have more control over which ruby +# implementation will be installed first (and thus eselected). This will +# provide for a better first installation experience. + +# All RUBY_TARGETS +RUBY_TARGETS_PREFERENCE="ruby20 ruby19 " + +# All other active ruby targets +RUBY_TARGETS_PREFERENCE+="ruby21 ruby22 " + + +_ruby_implementation_depend() { + local rubypn= + local rubyslot= + + case $1 in + ruby18) + rubypn="dev-lang/ruby" + rubyslot=":1.8" + ;; + ruby19) + rubypn="dev-lang/ruby" + rubyslot=":1.9" + ;; + ruby20) + rubypn="dev-lang/ruby" + rubyslot=":2.0" + ;; + ruby21) + rubypn="dev-lang/ruby" + rubyslot=":2.1" + ;; + ruby22) + rubypn="dev-lang/ruby" + rubyslot=":2.2" + ;; + ree18) + rubypn="dev-lang/ruby-enterprise" + rubyslot=":1.8" + ;; + jruby) + rubypn="dev-java/jruby" + rubyslot="" + ;; + rbx) + rubypn="dev-lang/rubinius" + rubyslot="" + ;; + *) die "$1: unknown Ruby implementation" + esac + + echo "$2${rubypn}$3${rubyslot}" +} + + + +_RUBY_UTILS=1 +fi |