summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /eclass/ruby-single.eclass
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'eclass/ruby-single.eclass')
-rw-r--r--eclass/ruby-single.eclass90
1 files changed, 90 insertions, 0 deletions
diff --git a/eclass/ruby-single.eclass b/eclass/ruby-single.eclass
new file mode 100644
index 00000000000..8dd1d82b618
--- /dev/null
+++ b/eclass/ruby-single.eclass
@@ -0,0 +1,90 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# @ECLASS: ruby-single
+# @MAINTAINER:
+# Ruby team <ruby@gentoo.org>
+# @AUTHOR:
+# Author: Hans de Graaff <graaff@gentoo.org>
+# Based on python-single-r1 by: Michał Górny <mgorny@gentoo.org>
+# @BLURB: An eclass for Ruby packages not installed for multiple implementations.
+# @DESCRIPTION:
+# An eclass for packages which don't support being installed for
+# multiple Ruby implementations. This mostly includes ruby-based
+# scripts. Set USE_RUBY to include all the ruby targets that have been
+# verified to work and include the eclass. RUBY_DEPS is now available to
+# pull in the dependency on the requested ruby targets.
+#
+# @CODE
+# USE_RUBY="ruby20 ruby21"
+# inherit ruby-single
+# RDEPEND="${RUBY_DEPS}"
+# @CODE
+
+case "${EAPI:-0}" in
+ 0|1|2|3)
+ die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
+ ;;
+ 4|5)
+ ;;
+ *)
+ die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
+ ;;
+esac
+
+if [[ ! ${_RUBY_SINGLE} ]]; then
+
+inherit ruby-utils
+
+# @ECLASS-VARIABLE: USE_RUBY
+# @DEFAULT_UNSET
+# @REQUIRED
+# @DESCRIPTION:
+# This variable contains a space separated list of targets (see above) a package
+# is compatible to. It must be set before the `inherit' call. There is no
+# default. All ebuilds are expected to set this variable.
+
+
+# @ECLASS-VARIABLE: RUBY_DEPS
+# @DESCRIPTION:
+#
+# This is an eclass-generated Ruby dependency string for all
+# implementations listed in USE_RUBY. Any one of the supported ruby
+# targets will satisfy this dependency. A dependency on
+# virtual/rubygems is also added to ensure that this is installed
+# in time for the package to use it.
+#
+# Example use:
+# @CODE
+# RDEPEND="${RUBY_DEPS}
+# dev-foo/mydep"
+# BDEPEND="${RDEPEND}"
+# @CODE
+#
+# Example value:
+# @CODE
+# || ( dev-lang/ruby:2.0 dev-lang/ruby:1.9 ) virtual/rubygems
+# @CODE
+#
+# The order of dependencies will change over time to best match the
+# current state of ruby targets, e.g. stable version first.
+
+_ruby_single_implementations_depend() {
+ local depend
+ for _ruby_implementation in ${RUBY_TARGETS_PREFERENCE}; do
+ if [[ ${USE_RUBY} =~ ${_ruby_implementation} ]]; then
+ depend="${depend} $(_ruby_implementation_depend $_ruby_implementation)"
+ fi
+ done
+ echo "|| ( ${depend} ) virtual/rubygems"
+}
+
+_ruby_single_set_globals() {
+ RUBY_DEPS=$(_ruby_single_implementations_depend)
+}
+_ruby_single_set_globals
+
+
+_RUBY_SINGLE=1
+fi