|
|
5257f0 |
From b5e9dc3683cb085aa57e7b12c35a4f21b2cc1482 Mon Sep 17 00:00:00 2001
|
|
|
5257f0 |
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
|
|
5257f0 |
Date: Fri, 11 Nov 2011 13:14:45 +0100
|
|
|
5257f0 |
Subject: [PATCH] Allow to install RubyGems into custom location, outside of
|
|
|
5257f0 |
Ruby tree.
|
|
|
5257f0 |
|
|
|
5257f0 |
---
|
|
|
5257f0 |
configure.in | 8 ++++++++
|
|
|
5257f0 |
tool/rbinstall.rb | 9 +++++++++
|
|
|
5257f0 |
version.c | 4 ++++
|
|
|
5257f0 |
3 files changed, 21 insertions(+)
|
|
|
5257f0 |
|
|
|
5257f0 |
diff --git a/configure.in b/configure.in
|
|
|
5257f0 |
index 1627d12..e064b2b 100644
|
|
|
5257f0 |
--- a/configure.in
|
|
|
5257f0 |
+++ b/configure.in
|
|
|
4acc54 |
@@ -3401,6 +3401,13 @@ AC_ARG_WITH(vendorarchdir,
|
|
|
5257f0 |
[vendorarchdir=$withval],
|
|
|
5257f0 |
[vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
|
|
|
5257f0 |
|
|
|
5257f0 |
+AC_ARG_WITH(rubygemsdir,
|
|
|
5257f0 |
+ AS_HELP_STRING([--with-rubygemsdir=DIR], [custom rubygems directory]),
|
|
|
5257f0 |
+ [rubygemsdir=$withval])
|
|
|
5257f0 |
+if test "$rubygemsdir" != ""; then
|
|
|
5257f0 |
+ AC_DEFINE_UNQUOTED(RUBYGEMS_DIR,"$rubygemsdir" !<verconf>!)
|
|
|
5257f0 |
+fi
|
|
|
5257f0 |
+
|
|
|
5257f0 |
unexpand_shvar rubylibprefix exec_prefix libdir RUBY_BASE_NAME
|
|
|
5257f0 |
unexpand_shvar rubyarchprefix exec_prefix libdir arch RUBY_BASE_NAME archlibdir rubylibprefix
|
|
|
5257f0 |
unexpand_shvar rubysitearchprefix exec_prefix libdir sitearch arch RUBY_BASE_NAME archlibdir sitearchlibdir rubylibprefix
|
|
|
4acc54 |
@@ -3467,6 +3474,7 @@ AC_SUBST(sitearchdir)dnl
|
|
|
5257f0 |
AC_SUBST(vendordir)dnl
|
|
|
5257f0 |
AC_SUBST(vendorlibdir)dnl
|
|
|
5257f0 |
AC_SUBST(vendorarchdir)dnl
|
|
|
5257f0 |
+AC_SUBST(rubygemsdir)dnl
|
|
|
5257f0 |
|
|
|
5257f0 |
configure_args=$ac_configure_args
|
|
|
5257f0 |
AC_SUBST(configure_args)dnl
|
|
|
5257f0 |
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
|
|
|
5257f0 |
index 92e54c6..c72dfb6 100755
|
|
|
5257f0 |
--- a/tool/rbinstall.rb
|
|
|
5257f0 |
+++ b/tool/rbinstall.rb
|
|
|
4acc54 |
@@ -320,6 +320,7 @@ sitelibdir = CONFIG["sitelibdir"]
|
|
|
5257f0 |
sitearchlibdir = CONFIG["sitearchdir"]
|
|
|
5257f0 |
vendorlibdir = CONFIG["vendorlibdir"]
|
|
|
5257f0 |
vendorarchlibdir = CONFIG["vendorarchdir"]
|
|
|
5257f0 |
+rubygemsdir = CONFIG["rubygemsdir"]
|
|
|
5257f0 |
mandir = CONFIG["mandir", true]
|
|
|
5257f0 |
docdir = CONFIG["docdir", true]
|
|
|
5257f0 |
configure_args = Shellwords.shellwords(CONFIG["configure_args"])
|
|
|
4acc54 |
@@ -507,7 +508,15 @@ end
|
|
|
5257f0 |
install?(:local, :comm, :lib) do
|
|
|
5257f0 |
prepare "library scripts", rubylibdir
|
|
|
5257f0 |
noinst = %w[README* *.txt *.rdoc *.gemspec]
|
|
|
5257f0 |
+ noinst += %w[*ubygems.rb rubygems/ datadir.rb] if rubygemsdir
|
|
|
5257f0 |
install_recursive(File.join(srcdir, "lib"), rubylibdir, :no_install => noinst, :mode => $data_mode)
|
|
|
5257f0 |
+ if rubygemsdir
|
|
|
5257f0 |
+ noinst = %w[obsolete.rb]
|
|
|
5257f0 |
+ install_recursive(File.join(srcdir, "lib", "rubygems"), File.join(rubygemsdir, "rubygems"), :mode => $data_mode)
|
|
|
5257f0 |
+ install_recursive(File.join(srcdir, "lib", "rbconfig"), File.join(rubygemsdir, "rbconfig"), :no_install => noinst, :mode => $data_mode)
|
|
|
5257f0 |
+ install(File.join(srcdir, "lib", "ubygems.rb"), File.join(rubygemsdir, "ubygems.rb"), :mode => $data_mode)
|
|
|
5257f0 |
+ install(File.join(srcdir, "lib", "rubygems.rb"), File.join(rubygemsdir, "rubygems.rb"), :mode => $data_mode)
|
|
|
5257f0 |
+ end
|
|
|
5257f0 |
end
|
|
|
5257f0 |
|
|
|
5257f0 |
install?(:local, :arch, :lib) do
|
|
|
5257f0 |
diff --git a/version.c b/version.c
|
|
|
5257f0 |
index 54c4513..d76100b 100644
|
|
|
5257f0 |
--- a/version.c
|
|
|
5257f0 |
+++ b/version.c
|
|
|
5257f0 |
@@ -99,6 +99,10 @@ const char ruby_initial_load_paths[] =
|
|
|
5257f0 |
#endif
|
|
|
5257f0 |
#endif
|
|
|
5257f0 |
|
|
|
5257f0 |
+#ifdef RUBYGEMS_DIR
|
|
|
5257f0 |
+ RUBYGEMS_DIR "\0"
|
|
|
5257f0 |
+#endif
|
|
|
5257f0 |
+
|
|
|
5257f0 |
RUBY_LIB "\0"
|
|
|
5257f0 |
#ifdef RUBY_THINARCH
|
|
|
5257f0 |
RUBY_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
|
|
|
5257f0 |
--
|
|
|
5257f0 |
1.8.1.2
|
|
|
5257f0 |
|