summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <graaff@gentoo.org>2008-11-14 11:59:14 +0000
committerHans de Graaff <graaff@gentoo.org>2008-11-14 11:59:14 +0000
commite09b3880ab15b7bb0d5bd05aba0c876cea01ee56 (patch)
tree9f093e24b54b11487ee10f4109b6a862aeecdd92 /eclass/gems.eclass
parentfixup econf call (missing backslash) (diff)
downloadgentoo-2-e09b3880ab15b7bb0d5bd05aba0c876cea01ee56.tar.gz
gentoo-2-e09b3880ab15b7bb0d5bd05aba0c876cea01ee56.tar.bz2
gentoo-2-e09b3880ab15b7bb0d5bd05aba0c876cea01ee56.zip
Handle the installation of gems differently when using rubygems >= 1.3.0.
Specifically we use our own custom --sandbox-fix option to make sure that finding dependencies still works even when using a sandbox installation. Thanks for Alex Legler (a3li) for the work on this.
Diffstat (limited to 'eclass/gems.eclass')
-rw-r--r--eclass/gems.eclass15
1 files changed, 12 insertions, 3 deletions
diff --git a/eclass/gems.eclass b/eclass/gems.eclass
index 810395e18a68..83bb4a986b2b 100644
--- a/eclass/gems.eclass
+++ b/eclass/gems.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gems.eclass,v 1.21 2008/02/17 08:49:19 rbrown Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gems.eclass,v 1.22 2008/11/14 11:59:14 graaff Exp $
#
# Author: Rob Cakebread <pythonhead@gentoo.org>
# Current Maintainer: Ruby Herd <ruby@gentoo.org>
@@ -65,8 +65,17 @@ gems_src_install() {
fi
dodir ${GEMSDIR}
- gem install ${GEM_SRC} --version ${PV} ${myconf} \
- --local --install-dir "${D}/${GEMSDIR}" || die "gem install failed"
+
+ local gte13=$(/usr/bin/${ruby_version} -rubygems -e 'puts Gem::RubyGemsVersion >= "1.3.0"')
+
+ if [[ "${gte13}" == "true" ]] ; then
+ gem install ${GEM_SRC} --version ${PV} ${myconf} \
+ --local --install-dir "${D}/${GEMSDIR}" --sandbox-fix \
+ || die "gem (>=1.3.0) install failed"
+ else
+ gem install ${GEM_SRC} --version ${PV} ${myconf} \
+ --local --install-dir "${D}/${GEMSDIR}" || die "gem (<1.3.0) install failed"
+ fi
if [[ -d "${D}/${GEMSDIR}/bin" ]] ; then
exeinto /usr/bin