summaryrefslogtreecommitdiff
path: root/lang/ruby19-base/patches
diff options
context:
space:
mode:
authortaca <taca@pkgsrc.org>2010-09-12 03:50:05 +0000
committertaca <taca@pkgsrc.org>2010-09-12 03:50:05 +0000
commit1990c588bee975d3f37b0956ed569d224fb6f83e (patch)
tree6e6b5c7d75328af77a376b1eb92a50b257c9d0ae /lang/ruby19-base/patches
parent18808b655e41f341e806ca34727141d05dc7aaa3 (diff)
downloadpkgsrc-1990c588bee975d3f37b0956ed569d224fb6f83e.tar.gz
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/.
Diffstat (limited to 'lang/ruby19-base/patches')
-rw-r--r--lang/ruby19-base/patches/patch-aa39
-rw-r--r--lang/ruby19-base/patches/patch-ab43
-rw-r--r--lang/ruby19-base/patches/patch-ac43
-rw-r--r--lang/ruby19-base/patches/patch-ad19
-rw-r--r--lang/ruby19-base/patches/patch-ae35
-rw-r--r--lang/ruby19-base/patches/patch-af15
-rw-r--r--lang/ruby19-base/patches/patch-ag38
-rw-r--r--lang/ruby19-base/patches/patch-ah18
-rw-r--r--lang/ruby19-base/patches/patch-ai27
-rw-r--r--lang/ruby19-base/patches/patch-aj21
-rw-r--r--lang/ruby19-base/patches/patch-ak15
-rw-r--r--lang/ruby19-base/patches/patch-al49
-rw-r--r--lang/ruby19-base/patches/patch-am24
-rw-r--r--lang/ruby19-base/patches/patch-an14
-rw-r--r--lang/ruby19-base/patches/patch-ao49
-rw-r--r--lang/ruby19-base/patches/patch-ap19
-rw-r--r--lang/ruby19-base/patches/patch-aq31
-rw-r--r--lang/ruby19-base/patches/patch-ar27
-rw-r--r--lang/ruby19-base/patches/patch-as39
-rw-r--r--lang/ruby19-base/patches/patch-at16
-rw-r--r--lang/ruby19-base/patches/patch-au37
21 files changed, 618 insertions, 0 deletions
diff --git a/lang/ruby19-base/patches/patch-aa b/lang/ruby19-base/patches/patch-aa
new file mode 100644
index 00000000000..959b4d2f081
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-aa
@@ -0,0 +1,39 @@
+$NetBSD: patch-aa,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Adding Interix support.
+
+--- configure.in.orig 2010-08-14 08:11:59.000000000 +0000
++++ configure.in
+@@ -958,6 +958,8 @@ main()
+ ],
+ [superux*], [ ac_cv_func_setitimer=no
+ ],
++[interix*], [ LIBS="-lm $LIBS"
++ ac_cv_func_getpgrp_void=yes],
+ [ LIBS="-lm $LIBS"])
+ AC_CHECK_LIB(crypt, crypt)
+ AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
+@@ -1809,7 +1811,9 @@ if test "$with_dln_a_out" != yes; then
+ rb_cv_dlopen=yes],
+ [interix*], [ : ${LDSHARED='$(CC) -shared'}
+ XLDFLAGS="$XLDFLAGS -Wl,-E"
++ DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(.TARGET) -Wl,--image-base,$$(($$RANDOM %4096/2*262144+1342177280))'
+ LIBPATHFLAG=" -L%1\$-s"
++ RPATHFLAG=' -Wl,-R%1$-s'
+ rb_cv_dlopen=yes],
+ [freebsd*|dragonfly*], [
+ : ${LDSHARED='$(CC) -shared'}
+@@ -2164,7 +2168,12 @@ if test "$enable_shared" = 'yes'; then
+ LIBRUBY_ALIASES='lib$(RUBY_BASE_NAME).$(MAJOR).$(MINOR).dylib lib$(RUBY_INSTALL_NAME).dylib'
+ ],
+ [interix*], [
+- LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)'
++ SOLIBS='$(LIBS)'
++ LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
++ # link explicitly to 0x48000000
++ LIBRUBY_DLDFLAGS='-Wl,-h,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) -Wl,--image-base,1207959552'
++ LIBRUBYARG_SHARED='-Wl,-R -Wl,${libdir} -L${libdir} -L. -l$(RUBY_SO_NAME)'
++ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so'
+ ])
+ fi
+ if test "$enable_rpath" = yes; then
diff --git a/lang/ruby19-base/patches/patch-ab b/lang/ruby19-base/patches/patch-ab
new file mode 100644
index 00000000000..418063223e7
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-ab
@@ -0,0 +1,43 @@
+$NetBSD: patch-ab,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Adding Interix support.
+
+--- configure.orig 2010-08-18 05:56:27.000000000 +0000
++++ configure
+@@ -9296,6 +9296,9 @@ esac
+ superux*) :
+ ac_cv_func_setitimer=no
+ ;; #(
++ interix*) LIBS="-lm $LIBS"
++ ac_cv_func_getpgrp_void=yes
++ ;; #(
+ *) :
+ LIBS="-lm $LIBS" ;;
+ esac
+@@ -14926,8 +14929,12 @@ esac ;; #(
+ rb_cv_dlopen=yes ;; #(
+ interix*) :
+ : ${LDSHARED='$(CC) -shared'}
++ LDFLAGS="$LDFLAGS -Wl,-E"
+ XLDFLAGS="$XLDFLAGS -Wl,-E"
++ # use special random-slot linkage in 0x[56]XXXXXXX
+ LIBPATHFLAG=" -L%1\$-s"
++ DLDFLAGS="$DLDFLAGS "'-Wl,-h,$(.TARGET) -Wl,--image-base,$$(($$RANDOM %4096/2*262144+1342177280))'
++ RPATHFLAG=' -Wl,-R%1$-s'
+ rb_cv_dlopen=yes ;; #(
+ freebsd*|dragonfly*) :
+
+@@ -15424,7 +15431,12 @@ esac
+ ;; #(
+ interix*) :
+
+- LIBRUBYARG_SHARED='-L. -L${libdir} -l$(RUBY_SO_NAME)'
++ SOLIBS='$(LIBS)'
++ LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR).$(TEENY)'
++ # link explicitly to 0x48000000
++ LIBRUBY_DLDFLAGS='-Wl,-h,lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) -Wl,--image-base,1207959552'
++ LIBRUBYARG_SHARED='-Wl,-R -Wl,${libdir} -L${libdir} -L. -l$(RUBY_SO_NAME)'
++ LIBRUBY_ALIASES='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR) lib$(RUBY_SO_NAME).so'
+ ;; #(
+ *) :
+ ;;
diff --git a/lang/ruby19-base/patches/patch-ac b/lang/ruby19-base/patches/patch-ac
new file mode 100644
index 00000000000..86c068ec7d2
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-ac
@@ -0,0 +1,43 @@
+$NetBSD: patch-ac,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Accept db3, db4 or db5 as include/library.
+
+--- ext/dbm/extconf.rb.orig 2009-10-02 10:45:39.000000000 +0000
++++ ext/dbm/extconf.rb
+@@ -5,13 +5,16 @@ dir_config("dbm")
+ if dblib = with_config("dbm-type", nil)
+ dblib = dblib.split(/[ ,]+/)
+ else
+- dblib = %w(db db2 db1 dbm gdbm gdbm_compat qdbm)
++ dblib = %w(db db2 db1 db5 db4 db3 dbm gdbm gdbm_compat qdbm)
+ end
+
+ headers = {
+ "db" => ["db.h"],
+ "db1" => ["db1/ndbm.h", "db1.h", "ndbm.h"],
+ "db2" => ["db2/db.h", "db2.h", "db.h"],
++ "db3" => ["db3/db.h", "db3.h", "db.h"],
++ "db4" => ["db4/db.h", "db4.h", "db.h"],
++ "db5" => ["db5/db.h", "db5.h", "db.h"],
+ "dbm" => ["ndbm.h"],
+ "gdbm" => ["gdbm-ndbm.h", "ndbm.h"],
+ "gdbm_compat" => ["gdbm-ndbm.h", "ndbm.h"],
+@@ -24,7 +27,7 @@ def headers.db_check(db)
+ hsearch = nil
+
+ case db
+- when /^db2?$/
++ when /^db[2-5]?$/
+ db_prefix = "__db_n"
+ hsearch = "-DDB_DBM_HSEARCH "
+ when "gdbm"
+@@ -36,7 +39,8 @@ def headers.db_check(db)
+ db_prefix ||= ""
+
+ if (have_library(db, db_prefix+"dbm_open") || have_func(db_prefix+"dbm_open")) and
+- hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", h, hsearch)}
++ hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", h, hsearch)} or
++ hdr = self.fetch(db, ["ndbm.h"]).find {|h| have_type("DBM", ["db.h", h], hsearch)}
+ have_func(db_prefix+"dbm_clearerr") unless have_gdbm
+ $defs << hsearch if hsearch
+ $defs << '-DDBM_HDR="<'+hdr+'>"'
diff --git a/lang/ruby19-base/patches/patch-ad b/lang/ruby19-base/patches/patch-ad
new file mode 100644
index 00000000000..0d5c39ddc66
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-ad
@@ -0,0 +1,19 @@
+$NetBSD: patch-ad,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Use proper OpenSSL's API.
+
+--- ext/openssl/ossl_ssl.c.orig 2010-05-23 12:18:51.000000000 +0000
++++ ext/openssl/ossl_ssl.c
+@@ -700,10 +700,10 @@ ossl_sslctx_get_ciphers(VALUE self)
+ if (!ciphers)
+ return rb_ary_new();
+
+- num = sk_num((STACK*)ciphers);
++ num = sk_SSL_CIPHER_num(ciphers);
+ ary = rb_ary_new2(num);
+ for(i = 0; i < num; i++){
+- cipher = (SSL_CIPHER*)sk_value((STACK*)ciphers, i);
++ cipher = sk_SSL_CIPHER_value(ciphers, i);
+ rb_ary_push(ary, ossl_ssl_cipher_to_ary(cipher));
+ }
+ return ary;
diff --git a/lang/ruby19-base/patches/patch-ae b/lang/ruby19-base/patches/patch-ae
new file mode 100644
index 00000000000..5225790d570
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-ae
@@ -0,0 +1,35 @@
+$NetBSD: patch-ae,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Add install_root option for pkgsrc's rubygems support.
+
+--- lib/rubygems.rb.orig 2010-08-26 08:25:09.000000000 +0000
++++ lib/rubygems.rb
+@@ -353,7 +353,10 @@ module Gem
+ ##
+ # The path where gem executables are to be installed.
+
+- def self.bindir(install_dir=Gem.dir)
++ def self.bindir(install_dir=Gem.dir, install_root=nil)
++ unless install_root.nil?
++ install_dir = install_dir.sub(install_root, "")
++ end
+ return File.join(install_dir, 'bin') unless
+ install_dir.to_s == Gem.default_dir
+ Gem.default_bindir
+@@ -576,7 +579,7 @@ module Gem
+ ##
+ # The index to insert activated gem paths into the $LOAD_PATH.
+ #
+- # Defaults to the site lib directory unless gem_prelude.rb has loaded paths,
++ # Defaults to the vendor lib directory unless gem_prelude.rb has loaded paths,
+ # then it inserts the activated gem's paths before the gem_prelude.rb paths
+ # so you can override the gem_prelude.rb default $LOAD_PATH paths.
+
+@@ -687,6 +690,7 @@ module Gem
+ prefix = File.dirname dir
+
+ if prefix == File.expand_path(ConfigMap[:sitelibdir]) or
++ prefix == File.expand_path(ConfigMap[:vendorlibdir]) or
+ prefix == File.expand_path(ConfigMap[:libdir]) or
+ 'lib' != File.basename(dir) then
+ nil
diff --git a/lang/ruby19-base/patches/patch-af b/lang/ruby19-base/patches/patch-af
new file mode 100644
index 00000000000..8afbfe9cc76
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-af
@@ -0,0 +1,15 @@
+$NetBSD: patch-af,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Prevent access to HOME when --install-root is used.
+
+--- lib/rubygems/commands/install_command.rb.orig 2010-04-22 08:24:42.000000000 +0000
++++ lib/rubygems/commands/install_command.rb
+@@ -146,7 +146,7 @@ to write the specification by hand. For
+ Gem::DocManager.new(gem, options[:rdoc_args]).generate_ri
+ end
+
+- Gem::DocManager.update_ri_cache
++ Gem::DocManager.update_ri_cache(options[:install_root])
+ end
+
+ if options[:generate_rdoc] then
diff --git a/lang/ruby19-base/patches/patch-ag b/lang/ruby19-base/patches/patch-ag
new file mode 100644
index 00000000000..b2064bf89bb
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-ag
@@ -0,0 +1,38 @@
+$NetBSD: patch-ag,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Make sure to setup under DESTDIR.
+
+--- lib/rubygems/commands/setup_command.rb.orig 2010-04-22 08:24:42.000000000 +0000
++++ lib/rubygems/commands/setup_command.rb
+@@ -118,7 +118,7 @@ By default, this RubyGems will install g
+
+ uninstall_old_gemcutter
+
+- install_rdoc
++ install_rdoc install_destdir
+
+ say
+ if @verbose then
+@@ -229,16 +229,20 @@ TEXT
+ end
+ end
+
+- def install_rdoc
++ def install_rdoc(install_destdir)
+ gem_doc_dir = File.join Gem.dir, 'doc'
+ rubygems_name = "rubygems-#{Gem::VERSION}"
+ rubygems_doc_dir = File.join gem_doc_dir, rubygems_name
+
++ unless install_destdir.empty?
++ FileUtils.mkdir_p gem_doc_dir unless File.exist?(gem_doc_dir)
++ end
++
+ if File.writable? gem_doc_dir and
+ (not File.exist? rubygems_doc_dir or
+ File.writable? rubygems_doc_dir) then
+ say "Removing old RubyGems RDoc and ri" if @verbose
+- Dir[File.join(Gem.dir, 'doc', 'rubygems-[0-9]*')].each do |dir|
++ Dir[File.join(gem_doc_dir, 'rubygems-[0-9]*')].each do |dir|
+ rm_rf dir
+ end
+
diff --git a/lang/ruby19-base/patches/patch-ah b/lang/ruby19-base/patches/patch-ah
new file mode 100644
index 00000000000..b6098ec551e
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-ah
@@ -0,0 +1,18 @@
+$NetBSD: patch-ah,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Add install_root option for pkgsrc's rubygems support.
+
+--- lib/rubygems/commands/uninstall_command.rb.orig 2009-10-02 10:45:39.000000000 +0000
++++ lib/rubygems/commands/uninstall_command.rb
+@@ -21,6 +21,11 @@ class Gem::Commands::UninstallCommand <
+ options[:all] = value
+ end
+
++ add_option('-B', '--install-root DIR',
++ 'Root directory for gem files') do |value, options|
++ options[:install_root] = File.expand_path(value)
++ end
++
+ add_option('-I', '--[no-]ignore-dependencies',
+ 'Ignore dependency requirements while',
+ 'uninstalling') do |value, options|
diff --git a/lang/ruby19-base/patches/patch-ai b/lang/ruby19-base/patches/patch-ai
new file mode 100644
index 00000000000..2911cf309c9
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-ai
@@ -0,0 +1,27 @@
+$NetBSD: patch-ai,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Add install_root option for pkgsrc's rubygems support.
+
+--- lib/rubygems/commands/unpack_command.rb.orig 2010-04-22 08:24:42.000000000 +0000
++++ lib/rubygems/commands/unpack_command.rb
+@@ -12,6 +12,10 @@ class Gem::Commands::UnpackCommand < Gem
+ :version => Gem::Requirement.default,
+ :target => Dir.pwd
+
++ add_option('--install-root DIR', 'Root directory for gem files on extract') do |value, options|
++ options[:install_root] = value
++ end
++
+ add_option('--target=DIR',
+ 'target directory for unpacking') do |value, options|
+ options[:target] = value
+@@ -56,7 +60,8 @@ class Gem::Commands::UnpackCommand < Gem
+ basename = File.basename path, '.gem'
+ target_dir = File.expand_path basename, options[:target]
+ FileUtils.mkdir_p target_dir
+- Gem::Installer.new(path, :unpack => true).unpack target_dir
++ Gem::Installer.new(path, :unpack => true,
++ :install_root => options[:install_root]).unpack target_dir
+ say "Unpacked gem: '#{target_dir}'"
+ else
+ alert_error "Gem '#{name}' not installed."
diff --git a/lang/ruby19-base/patches/patch-aj b/lang/ruby19-base/patches/patch-aj
new file mode 100644
index 00000000000..1564d4a6a10
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-aj
@@ -0,0 +1,21 @@
+$NetBSD: patch-aj,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Don't hard code config file's path for gem.
+
+--- lib/rubygems/config_file.rb.orig 2010-06-08 13:14:51.000000000 +0000
++++ lib/rubygems/config_file.rb
+@@ -45,13 +45,7 @@ class Gem::ConfigFile
+
+ PLATFORM_DEFAULTS = {}
+
+- system_config_path =
+- begin
+- require 'etc.so'
+- Etc.sysconfdir
+- rescue LoadError
+- '/etc'
+- end
++ system_config_path = '@PKG_SYSCONFDIR@'
+
+ SYSTEM_WIDE_CONFIG_FILE = File.join system_config_path, 'gemrc'
+
diff --git a/lang/ruby19-base/patches/patch-ak b/lang/ruby19-base/patches/patch-ak
new file mode 100644
index 00000000000..29be73ed757
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-ak
@@ -0,0 +1,15 @@
+$NetBSD: patch-ak,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Use vendordir instead of sitedir.
+
+--- lib/rubygems/defaults.rb.orig 2010-04-22 08:24:42.000000000 +0000
++++ lib/rubygems/defaults.rb
+@@ -18,7 +18,7 @@ module Gem
+
+ def self.default_dir
+ if defined? RUBY_FRAMEWORK_VERSION then
+- File.join File.dirname(ConfigMap[:sitedir]), 'Gems',
++ File.join File.dirname(ConfigMap[:vendordir]), 'Gems',
+ ConfigMap[:ruby_version]
+ elsif ConfigMap[:rubylibprefix] then
+ File.join(ConfigMap[:rubylibprefix], 'gems',
diff --git a/lang/ruby19-base/patches/patch-al b/lang/ruby19-base/patches/patch-al
new file mode 100644
index 00000000000..e690a9a0444
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-al
@@ -0,0 +1,49 @@
+$NetBSD: patch-al,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Add install_root option for pkgsrc's rubygems support.
+
+--- lib/rubygems/dependency_installer.rb.orig 2010-04-22 08:24:42.000000000 +0000
++++ lib/rubygems/dependency_installer.rb
+@@ -38,6 +38,7 @@ class Gem::DependencyInstaller
+ # :format_executable:: See Gem::Installer#initialize.
+ # :ignore_dependencies:: Don't install any dependencies.
+ # :install_dir:: See Gem::Installer#install.
++ # :install_root: See Gem::Installer#install.
+ # :prerelease:: Allow prerelease versions. See #install.
+ # :security_policy:: See Gem::Installer::new and Gem::Security.
+ # :user_install:: See Gem::Installer.new
+@@ -45,7 +46,11 @@ class Gem::DependencyInstaller
+
+ def initialize(options = {})
+ if options[:install_dir] then
+- spec_dir = options[:install_dir], 'specifications'
++ if options[:install_root].nil? or options[:install_root] == "" then
++ spec_dir = options[:install_dir], 'specifications'
++ else
++ spec_dir = options[:install_root], options[:install_dir], 'specifications'
++ end
+ @source_index = Gem::SourceIndex.from_gems_in spec_dir
+ else
+ @source_index = Gem.source_index
+@@ -68,7 +73,12 @@ class Gem::DependencyInstaller
+ @installed_gems = []
+
+ @install_dir = options[:install_dir] || Gem.dir
+- @cache_dir = options[:cache_dir] || @install_dir
++ @install_root = options[:install_root]
++ install_dir = @install_dir
++ unless @install_root.nil? or @install_root == ""
++ install_dir = File.join(@install_root, @install_dir)
++ end
++ @cache_dir = options[:cache_dir] || install_dir
+
+ # Set with any errors that SpecFetcher finds while search through
+ # gemspecs for a dep
+@@ -269,6 +279,7 @@ class Gem::DependencyInstaller
+ :format_executable => @format_executable,
+ :ignore_dependencies => @ignore_dependencies,
+ :install_dir => @install_dir,
++ :install_root => @install_root,
+ :security_policy => @security_policy,
+ :source_index => @source_index,
+ :user_install => @user_install,
diff --git a/lang/ruby19-base/patches/patch-am b/lang/ruby19-base/patches/patch-am
new file mode 100644
index 00000000000..3300f5369a7
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-am
@@ -0,0 +1,24 @@
+$NetBSD: patch-am,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Prevent access to HOME when --install-root is used.
+
+--- lib/rubygems/doc_manager.rb.orig 2010-04-22 08:24:42.000000000 +0000
++++ lib/rubygems/doc_manager.rb
+@@ -61,7 +61,7 @@ class Gem::DocManager
+ ##
+ # Updates the RI cache for RDoc 2 if it is installed
+
+- def self.update_ri_cache
++ def self.update_ri_cache(install_root = nil)
+ load_rdoc rescue return
+
+ return unless defined? RDoc::VERSION # RDoc 1 does not have VERSION
+@@ -72,7 +72,7 @@ class Gem::DocManager
+ :use_cache => true,
+ :use_system => true,
+ :use_site => true,
+- :use_home => true,
++ :use_home => (install_root == nil)? true: false,
+ :use_gems => true,
+ :formatter => RDoc::RI::Formatter,
+ }
diff --git a/lang/ruby19-base/patches/patch-an b/lang/ruby19-base/patches/patch-an
new file mode 100644
index 00000000000..e5b26858142
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-an
@@ -0,0 +1,14 @@
+$NetBSD: patch-an,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+* Make sure to load YAML before use it. When should YAML be loaded?
+
+--- lib/rubygems/specification.rb.orig 2010-04-22 08:24:42.000000000 +0000
++++ lib/rubygems/specification.rb
+@@ -476,6 +476,7 @@ class Gem::Specification
+ # 'input' can be anything that YAML.load() accepts: String or IO.
+
+ def self.from_yaml(input)
++ require 'yaml'
+ input = normalize_yaml_input input
+ spec = YAML.load input
+
diff --git a/lang/ruby19-base/patches/patch-ao b/lang/ruby19-base/patches/patch-ao
new file mode 100644
index 00000000000..925f8594b60
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-ao
@@ -0,0 +1,49 @@
+$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
diff --git a/lang/ruby19-base/patches/patch-ap b/lang/ruby19-base/patches/patch-ap
new file mode 100644
index 00000000000..f34bde72ace
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-ap
@@ -0,0 +1,19 @@
+$NetBSD: patch-ap,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Add install_root option for pkgsrc's rubygems support.
+
+--- lib/rubygems/install_update_options.rb.orig 2010-06-11 14:02:18.000000000 +0000
++++ lib/rubygems/install_update_options.rb
+@@ -22,6 +22,12 @@ module Gem::InstallUpdateOptions
+ value
+ end
+
++ add_option(:"Install/Update", '-B', '--install-root DIR',
++ 'Root directory for gem files on install') do |value, options|
++ options[:install_root] = File.expand_path(value)
++ Gem.ensure_gem_subdirectories File.join options[:install_root], Gem.dir
++ end
++
+ add_option(:"Install/Update", '-i', '--install-dir DIR',
+ 'Gem repository directory to get installed',
+ 'gems') do |value, options|
diff --git a/lang/ruby19-base/patches/patch-aq b/lang/ruby19-base/patches/patch-aq
new file mode 100644
index 00000000000..c0efb41eb7e
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-aq
@@ -0,0 +1,31 @@
+$NetBSD: patch-aq,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Add install_root option for pkgsrc's rubygems support.
+
+--- lib/rubygems/uninstaller.rb.orig 2010-02-22 02:52:35.000000000 +0000
++++ lib/rubygems/uninstaller.rb
+@@ -50,6 +50,11 @@ class Gem::Uninstaller
+ @force_all = options[:all]
+ @force_ignore = options[:ignore]
+ @bin_dir = options[:bin_dir]
++ 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
+
+ # only add user directory if install_dir is not set
+ @user_install = false
+@@ -124,7 +129,11 @@ class Gem::Uninstaller
+ return if spec.nil?
+
+ unless spec.executables.empty? then
+- bindir = @bin_dir ? @bin_dir : Gem.bindir(spec.installation_path)
++ 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
+
+ list = @source_index.find_name(spec.name).delete_if { |s|
+ s.version == spec.version
diff --git a/lang/ruby19-base/patches/patch-ar b/lang/ruby19-base/patches/patch-ar
new file mode 100644
index 00000000000..1f117308841
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-ar
@@ -0,0 +1,27 @@
+$NetBSD: patch-ar,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Use vendordir instead of sitedir.
+
+--- test/rubygems/test_gem.rb.orig 2010-04-22 08:24:42.000000000 +0000
++++ test/rubygems/test_gem.rb
+@@ -427,17 +427,17 @@ class TestGem < RubyGemTestCase
+ end
+
+ def test_self_prefix_sitelibdir
+- orig_sitelibdir = Gem::ConfigMap[:sitelibdir]
++ orig_sitelibdir = Gem::ConfigMap[:vendorlibdir]
+
+ file_name = File.expand_path __FILE__
+ prefix = File.dirname File.dirname(file_name)
+ prefix = File.dirname prefix if File.basename(prefix) == 'test'
+
+- Gem::ConfigMap[:sitelibdir] = prefix
++ Gem::ConfigMap[:vendorlibdir] = prefix
+
+ assert_nil Gem.prefix
+ ensure
+- Gem::ConfigMap[:sitelibdir] = orig_sitelibdir
++ Gem::ConfigMap[:vendorlibdir] = orig_sitelibdir
+ end
+
+ def test_self_refresh
diff --git a/lang/ruby19-base/patches/patch-as b/lang/ruby19-base/patches/patch-as
new file mode 100644
index 00000000000..5e023ec0f18
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-as
@@ -0,0 +1,39 @@
+$NetBSD: patch-as,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Handle 64bit size of time_t.
+
+--- thread_pthread.c.orig 2010-07-22 13:13:57.000000000 +0000
++++ thread_pthread.c
+@@ -17,6 +17,12 @@
+ #include <sys/resource.h>
+ #endif
+
++#if SIZEOF_TIME_T == 8
++#define FMT_TIME_T "lld"
++#else
++#define FMT_TIME_T "ld"
++#endif
++
+ static void native_mutex_lock(pthread_mutex_t *lock);
+ static void native_mutex_unlock(pthread_mutex_t *lock);
+ static int native_mutex_trylock(pthread_mutex_t *lock);
+@@ -620,7 +626,7 @@ native_sleep(rb_thread_t *th, struct tim
+ }
+ }
+
+- thread_debug("native_sleep %ld\n", tv ? tv->tv_sec : -1);
++ thread_debug("native_sleep %" FMT_TIME_T "\n", tv ? tv->tv_sec : -1);
+ GVL_UNLOCK_BEGIN();
+ {
+ pthread_mutex_lock(&th->interrupt_lock);
+@@ -642,8 +648,8 @@ native_sleep(rb_thread_t *th, struct tim
+ }
+ else {
+ int r;
+- thread_debug("native_sleep: pthread_cond_timedwait start (%ld, %ld)\n",
+- (unsigned long)ts.tv_sec, ts.tv_nsec);
++ thread_debug("native_sleep: pthread_cond_timedwait start (%"
++ FMT_TIME_T ", %ld)\n", ts.tv_sec, ts.tv_nsec);
+ r = pthread_cond_timedwait(&th->native_thread_data.sleep_cond,
+ &th->interrupt_lock, &ts);
+ if (r && r != ETIMEDOUT) rb_bug_errno("pthread_cond_timedwait", r);
diff --git a/lang/ruby19-base/patches/patch-at b/lang/ruby19-base/patches/patch-at
new file mode 100644
index 00000000000..66aaebc94d8
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-at
@@ -0,0 +1,16 @@
+$NetBSD: patch-at,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Avoid ugly warning.
+
+--- vsnprintf.c.orig 2010-04-28 01:27:37.000000000 +0000
++++ vsnprintf.c
+@@ -203,7 +203,9 @@ typedef struct __sFILE {
+ #define __sfeof(p) (((p)->_flags & __SEOF) != 0)
+ #define __sferror(p) (((p)->_flags & __SERR) != 0)
+ #define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
++#ifndef __sfileno
+ #define __sfileno(p) ((p)->_file)
++#endif
+
+ #undef feof
+ #undef ferror
diff --git a/lang/ruby19-base/patches/patch-au b/lang/ruby19-base/patches/patch-au
new file mode 100644
index 00000000000..9e1d0d1bd4c
--- /dev/null
+++ b/lang/ruby19-base/patches/patch-au
@@ -0,0 +1,37 @@
+$NetBSD: patch-au,v 1.1.1.1 2010/09/12 03:50:06 taca Exp $
+
+Defer loading readline, when it is really needed.
+Some unknown reason:
+
+1. build devel/ruby-readline with editline(3).
+2. Execute a ruby script loading readline in background from shell.
+3. When the script output something to stdout, it got SIGTSTP and suspends.
+
+There is no such problem when build devel/ruby-readline with GNU's readline.
+
+--- lib/rdoc/ri/driver.rb.orig 2010-07-01 02:05:35.000000000 +0000
++++ lib/rdoc/ri/driver.rb
+@@ -1,11 +1,6 @@
+ require 'abbrev'
+ require 'optparse'
+
+-begin
+- require 'readline'
+-rescue LoadError
+-end
+-
+ require 'rdoc/ri'
+ require 'rdoc/ri/paths'
+ require 'rdoc/markup'
+@@ -809,6 +804,11 @@ Options may also be set in the 'RI' envi
+ # Runs ri interactively using Readline if it is available.
+
+ def interactive
++ begin
++ require 'readline'
++ rescue LoadError
++ end
++
+ puts "\nEnter the method name you want to look up."
+
+ if defined? Readline then