42 lines
1.8 KiB
Plaintext
42 lines
1.8 KiB
Plaintext
$NetBSD: patch-ad,v 1.14 2014/02/19 15:47:32 taca Exp $
|
|
|
|
* Add install_root option for pkgsrc's rubygems support.
|
|
|
|
--- lib/rubygems/installer.rb.orig 2013-09-09 23:41:27.000000000 +0000
|
|
+++ lib/rubygems/installer.rb
|
|
@@ -98,6 +98,9 @@ class Gem::Installer
|
|
# foo_exec18.
|
|
# :ignore_dependencies:: Don't raise if a dependency is missing.
|
|
# :install_dir:: The directory to install the gem into.
|
|
+ # :install_root:: The directory to use as a buildroot for "destdir"-style
|
|
+ # installation. All paths during installation are relative
|
|
+ # to the buildroot.
|
|
# :security_policy:: Use the specified security policy. See Gem::Security
|
|
# :user_install:: Indicate that the gem should be unpacked into the users
|
|
# personal gem directory.
|
|
@@ -548,7 +551,8 @@ class Gem::Installer
|
|
:env_shebang => false,
|
|
:force => false,
|
|
:install_dir => Gem.dir,
|
|
- :only_install_dir => false
|
|
+ :only_install_dir => false,
|
|
+ :install_root => nil,
|
|
}.merge options
|
|
|
|
@env_shebang = options[:env_shebang]
|
|
@@ -563,8 +567,13 @@ class Gem::Installer
|
|
# If the user has asked for the gem to be installed in a directory that is
|
|
# the system gem directory, then use the system bin directory, else create
|
|
# (or use) a new bin dir under the gem_home.
|
|
- @bin_dir = options[:bin_dir] || Gem.bindir(gem_home)
|
|
+ install_root = options[:install_root]
|
|
+ @bin_dir = options[:bin_dir] || Gem.bindir(gem_home, install_root)
|
|
@development = options[:development]
|
|
+ unless install_root.nil? or install_root.empty?
|
|
+ @install_root = File.expand_path install_root
|
|
+ @gem_home = File.join(@install_root, @gem_home)
|
|
+ end
|
|
|
|
@build_args = options[:build_args] || Gem::Command.build_args
|
|
end
|