2012-11-19 13:38:30 +00:00
|
|
|
From 643a3d3af2a3847e730c79515bc586768053119a Mon Sep 17 00:00:00 2001
|
2012-01-18 14:54:01 +00:00
|
|
|
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
|
|
|
Date: Fri, 11 Nov 2011 13:14:45 +0100
|
|
|
|
Subject: [PATCH] Allow to install RubyGems into custom location, outside of
|
|
|
|
Ruby tree.
|
|
|
|
|
|
|
|
---
|
2012-11-19 13:38:30 +00:00
|
|
|
configure.in | 8 ++++++++
|
|
|
|
tool/mkconfig.rb | 1 +
|
|
|
|
tool/rbinstall.rb | 9 +++++++++
|
|
|
|
version.c | 4 ++++
|
|
|
|
4 files changed, 22 insertions(+)
|
2012-01-18 14:54:01 +00:00
|
|
|
|
|
|
|
diff --git a/configure.in b/configure.in
|
2012-11-19 13:38:30 +00:00
|
|
|
index 748edc9..6a16745 100644
|
2012-01-18 14:54:01 +00:00
|
|
|
--- a/configure.in
|
|
|
|
+++ b/configure.in
|
2012-12-04 11:51:34 +00:00
|
|
|
@@ -3197,6 +3197,13 @@ until VENDORARCH_DIR=`eval echo \\"${dir}\\"`; test "x${dir}" = "x${VENDORARCH_D
|
2012-01-18 14:54:01 +00:00
|
|
|
dir="${VENDORARCH_DIR}"
|
|
|
|
done
|
|
|
|
|
|
|
|
+AC_ARG_WITH(rubygemsdir,
|
|
|
|
+ AS_HELP_STRING([--with-rubygemsdir=DIR], [custom rubygems directory]),
|
|
|
|
+ [rubygemsdir=$withval])
|
|
|
|
+if test "$rubygemsdir" != ""; then
|
2012-06-06 12:19:36 +00:00
|
|
|
+ AC_DEFINE_UNQUOTED(RUBYGEMS_DIR,"$rubygemsdir" !<verconf>!)
|
2012-01-18 14:54:01 +00:00
|
|
|
+fi
|
|
|
|
+
|
|
|
|
if test "${LOAD_RELATIVE+set}"; then
|
|
|
|
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
|
|
|
|
RUBY_EXEC_PREFIX=""
|
2012-12-04 11:51:34 +00:00
|
|
|
@@ -3290,6 +3297,7 @@ AC_SUBST(sitedir)dnl
|
2012-01-18 14:54:01 +00:00
|
|
|
AC_SUBST(sitearchdir)dnl
|
|
|
|
AC_SUBST(vendordir)dnl
|
|
|
|
AC_SUBST(vendorarchdir)dnl
|
|
|
|
+AC_SUBST(rubygemsdir)dnl
|
|
|
|
|
|
|
|
configure_args=$ac_configure_args
|
|
|
|
AC_SUBST(configure_args)dnl
|
|
|
|
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
|
2012-11-19 13:38:30 +00:00
|
|
|
index 79b8e44..9cef0c6 100755
|
2012-01-18 14:54:01 +00:00
|
|
|
--- a/tool/mkconfig.rb
|
|
|
|
+++ b/tool/mkconfig.rb
|
|
|
|
@@ -84,6 +84,7 @@ File.foreach "config.status" do |line|
|
|
|
|
when /^sitearchdir$/; sitearchdir_override = val; next
|
|
|
|
when /^vendorarchdir$/; vendorarchdir_override = val; next
|
|
|
|
when /^sitearch/; val = '$(arch)' if val.empty?
|
|
|
|
+ when /^rubygemsdir/; next if val.empty?
|
|
|
|
end
|
|
|
|
case val
|
|
|
|
when /^\$\(ac_\w+\)$/; next
|
|
|
|
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
|
2012-11-19 13:38:30 +00:00
|
|
|
index 17294a2..2757a73 100755
|
2012-01-18 14:54:01 +00:00
|
|
|
--- a/tool/rbinstall.rb
|
|
|
|
+++ b/tool/rbinstall.rb
|
2012-11-05 15:38:52 +00:00
|
|
|
@@ -313,6 +313,7 @@ sitelibdir = CONFIG["sitelibdir"]
|
2012-01-18 14:54:01 +00:00
|
|
|
sitearchlibdir = CONFIG["sitearchdir"]
|
|
|
|
vendorlibdir = CONFIG["vendorlibdir"]
|
|
|
|
vendorarchlibdir = CONFIG["vendorarchdir"]
|
|
|
|
+rubygemsdir = CONFIG["rubygemsdir"]
|
2012-04-18 17:40:36 +00:00
|
|
|
mandir = CONFIG["mandir", true]
|
2012-06-05 12:52:00 +00:00
|
|
|
docdir = CONFIG["docdir", true]
|
2012-01-18 14:54:01 +00:00
|
|
|
configure_args = Shellwords.shellwords(CONFIG["configure_args"])
|
2012-11-05 15:38:52 +00:00
|
|
|
@@ -500,7 +501,15 @@ end
|
2012-01-18 14:54:01 +00:00
|
|
|
install?(:local, :comm, :lib) do
|
|
|
|
prepare "library scripts", rubylibdir
|
2012-11-19 13:38:30 +00:00
|
|
|
noinst = %w[README* *.txt *.rdoc *.gemspec]
|
2012-01-18 14:54:01 +00:00
|
|
|
+ noinst += %w[*ubygems.rb rubygems/ datadir.rb] if rubygemsdir
|
|
|
|
install_recursive(File.join(srcdir, "lib"), rubylibdir, :no_install => noinst, :mode => $data_mode)
|
|
|
|
+ if rubygemsdir
|
|
|
|
+ noinst = %w[obsolete.rb]
|
|
|
|
+ install_recursive(File.join(srcdir, "lib", "rubygems"), File.join(rubygemsdir, "rubygems"), :mode => $data_mode)
|
|
|
|
+ install_recursive(File.join(srcdir, "lib", "rbconfig"), File.join(rubygemsdir, "rbconfig"), :no_install => noinst, :mode => $data_mode)
|
|
|
|
+ install(File.join(srcdir, "lib", "ubygems.rb"), File.join(rubygemsdir, "ubygems.rb"), :mode => $data_mode)
|
|
|
|
+ install(File.join(srcdir, "lib", "rubygems.rb"), File.join(rubygemsdir, "rubygems.rb"), :mode => $data_mode)
|
|
|
|
+ end
|
|
|
|
end
|
|
|
|
|
|
|
|
install?(:local, :arch, :lib) do
|
|
|
|
diff --git a/version.c b/version.c
|
2012-11-19 13:38:30 +00:00
|
|
|
index 962f39f..979701d 100644
|
2012-01-18 14:54:01 +00:00
|
|
|
--- a/version.c
|
|
|
|
+++ b/version.c
|
2012-04-18 17:40:36 +00:00
|
|
|
@@ -104,6 +104,10 @@ const char ruby_initial_load_paths[] =
|
2012-01-18 14:54:01 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+#ifdef RUBYGEMS_DIR
|
|
|
|
+ RUBYGEMS_DIR "\0"
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
RUBY_LIB "\0"
|
|
|
|
#ifdef RUBY_THIN_ARCHLIB
|
|
|
|
RUBY_THIN_ARCHLIB "\0"
|
|
|
|
--
|
2012-11-19 13:38:30 +00:00
|
|
|
1.8.0
|
2012-01-18 14:54:01 +00:00
|
|
|
|