pkgsrc/lang/ruby19-base/patches/patch-ao
taca 1e91015451 Importing ruby19-base 1.9.2pl0.
This package is Ruby 1.9 based release.

And this new release has several features and some incompatibility.
Please refer changes from Ruby 1.8.7:

	http://svn.ruby-lang.org/repos/ruby/tags/v1_9_1_0/NEWS
	http://svn.ruby-lang.org/repos/ruby/tags/v1_9_2_0/NEWS

*Note* NetBSD isn't "supported" but "perhaps" platform by Ruby.  Please
refer about it "Supported Platform" in
http://www.ruby-lang.org/en/news/2010/08/18/ruby-1-9-2-is-released/.
2010-09-12 03:50:05 +00:00

49 lines
2.2 KiB
Text

$NetBSD: patch-ao,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
Add install_root option for pkgsrc's rubygems support.
--- lib/rubygems/installer.rb.orig 2010-04-22 08:24:42.000000000 +0000
+++ lib/rubygems/installer.rb
@@ -84,6 +84,9 @@ class Gem::Installer
# for a signed-gems-only policy.
# :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.
# :format_executable:: Format the executable the same as the ruby executable.
# If your ruby is ruby18, foo_exec will be installed as
# foo_exec18.
@@ -99,6 +102,7 @@ class Gem::Installer
:exec_format => false,
:force => false,
:install_dir => Gem.dir,
+ :install_root => nil,
:source_index => Gem.source_index,
}.merge options
@@ -110,6 +114,11 @@ class Gem::Installer
@format_executable = options[:format_executable]
@security_policy = options[:security_policy]
@wrappers = options[:wrappers]
+ install_root = options[:install_root]
+ unless install_root.nil? or install_root == ""
+ @install_root = File.expand_path install_root
+ @gem_home = File.join(@install_root, @gem_home)
+ end
@bin_dir = options[:bin_dir]
@development = options[:development]
@source_index = options[:source_index]
@@ -289,7 +298,11 @@ 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.
- bindir = @bin_dir ? @bin_dir : Gem.bindir(@gem_home)
+ bindir = @bin_dir ? @bin_dir : (Gem.bindir @gem_home, @install_root)
+
+ unless @install_root.nil? or @install_root == ""
+ bindir = File.join(@install_root, bindir)
+ end
Dir.mkdir bindir unless File.exist? bindir
raise Gem::FilePermissionError.new(bindir) unless File.writable? bindir