|
|
a03b2d2 |
From 94da59aafacc6a9efe829529eb51385588d6f149 Mon Sep 17 00:00:00 2001
|
|
|
117278a |
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
|
|
|
117278a |
Date: Fri, 11 Nov 2011 13:14:45 +0100
|
|
|
117278a |
Subject: [PATCH] Allow to install RubyGems into custom location, outside of
|
|
|
117278a |
Ruby tree.
|
|
|
117278a |
|
|
|
117278a |
---
|
|
|
9195984 |
configure.in | 5 +++++
|
|
|
9195984 |
loadpath.c | 4 ++++
|
|
|
9195984 |
template/verconf.h.tmpl | 3 +++
|
|
|
9195984 |
tool/rbinstall.rb | 9 +++++++++
|
|
|
a03b2d2 |
4 files changed, 21 insertions(+)
|
|
|
117278a |
|
|
|
117278a |
diff --git a/configure.in b/configure.in
|
|
|
a03b2d2 |
index 03a4152..0e371e2 100644
|
|
|
117278a |
--- a/configure.in
|
|
|
117278a |
+++ b/configure.in
|
|
|
3130f89 |
@@ -4426,6 +4426,10 @@ AC_ARG_WITH(vendorarchdir,
|
|
|
bf92566 |
[vendorarchdir=$withval],
|
|
|
4c12d4e |
[vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby'${ruby_version_dir}}${multiarch-'${vendorlibdir}/${sitearch}'}])
|
|
|
117278a |
|
|
|
117278a |
+AC_ARG_WITH(rubygemsdir,
|
|
|
117278a |
+ AS_HELP_STRING([--with-rubygemsdir=DIR], [custom rubygems directory]),
|
|
|
117278a |
+ [rubygemsdir=$withval])
|
|
|
117278a |
+
|
|
|
a03b2d2 |
if test "${LOAD_RELATIVE+set}"; then
|
|
|
a03b2d2 |
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
|
|
|
a03b2d2 |
RUBY_EXEC_PREFIX=''
|
|
|
3130f89 |
@@ -4450,6 +4454,7 @@ AC_SUBST(sitearchdir)dnl
|
|
|
117278a |
AC_SUBST(vendordir)dnl
|
|
|
bf92566 |
AC_SUBST(vendorlibdir)dnl
|
|
|
117278a |
AC_SUBST(vendorarchdir)dnl
|
|
|
117278a |
+AC_SUBST(rubygemsdir)dnl
|
|
|
117278a |
|
|
|
4c12d4e |
AC_SUBST(CONFIGURE, "`echo $0 | sed 's|.*/||'`")dnl
|
|
|
a03b2d2 |
AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl
|
|
|
a03b2d2 |
diff --git a/loadpath.c b/loadpath.c
|
|
|
a03b2d2 |
index 623dc9d..74c5d9e 100644
|
|
|
a03b2d2 |
--- a/loadpath.c
|
|
|
a03b2d2 |
+++ b/loadpath.c
|
|
|
02ee790 |
@@ -94,6 +94,10 @@ const char ruby_initial_load_paths[] =
|
|
|
360d2b9 |
#endif
|
|
|
a03b2d2 |
#endif
|
|
|
a03b2d2 |
|
|
|
a03b2d2 |
+#ifdef RUBYGEMS_DIR
|
|
|
a03b2d2 |
+ RUBYGEMS_DIR "\0"
|
|
|
a03b2d2 |
+#endif
|
|
|
a03b2d2 |
+
|
|
|
a03b2d2 |
RUBY_LIB "\0"
|
|
|
a03b2d2 |
#ifdef RUBY_THINARCH
|
|
|
a03b2d2 |
RUBY_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
|
|
|
9195984 |
diff --git a/template/verconf.h.tmpl b/template/verconf.h.tmpl
|
|
|
a03b2d2 |
index 79c003e..34f2382 100644
|
|
|
9195984 |
--- a/template/verconf.h.tmpl
|
|
|
9195984 |
+++ b/template/verconf.h.tmpl
|
|
|
4c12d4e |
@@ -36,6 +36,9 @@
|
|
|
a03b2d2 |
% if C["RUBY_SEARCH_PATH"]
|
|
|
a03b2d2 |
#define RUBY_SEARCH_PATH "${RUBY_SEARCH_PATH}"
|
|
|
a03b2d2 |
% end
|
|
|
a03b2d2 |
+% if C["rubygemsdir"]
|
|
|
a03b2d2 |
+#define RUBYGEMS_DIR "${rubygemsdir}"
|
|
|
a03b2d2 |
+% end
|
|
|
a03b2d2 |
%
|
|
|
a03b2d2 |
% R = {}
|
|
|
a03b2d2 |
% R["ruby_version"] = '"RUBY_LIB_VERSION"'
|
|
|
117278a |
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
|
|
|
a03b2d2 |
index b47b6e1..0b99408 100755
|
|
|
117278a |
--- a/tool/rbinstall.rb
|
|
|
117278a |
+++ b/tool/rbinstall.rb
|
|
|
3130f89 |
@@ -330,6 +330,7 @@ def CONFIG.[](name, mandatory = false)
|
|
|
117278a |
sitearchlibdir = CONFIG["sitearchdir"]
|
|
|
117278a |
vendorlibdir = CONFIG["vendorlibdir"]
|
|
|
117278a |
vendorarchlibdir = CONFIG["vendorarchdir"]
|
|
|
117278a |
+rubygemsdir = CONFIG["rubygemsdir"]
|
|
|
ea3cb65 |
mandir = CONFIG["mandir", true]
|
|
|
4efe111 |
docdir = CONFIG["docdir", true]
|
|
|
117278a |
configure_args = Shellwords.shellwords(CONFIG["configure_args"])
|
|
|
3130f89 |
@@ -517,7 +518,15 @@ def CONFIG.[](name, mandatory = false)
|
|
|
117278a |
install?(:local, :comm, :lib) do
|
|
|
117278a |
prepare "library scripts", rubylibdir
|
|
|
b3f2794 |
noinst = %w[README* *.txt *.rdoc *.gemspec]
|
|
|
117278a |
+ noinst += %w[*ubygems.rb rubygems/ datadir.rb] if rubygemsdir
|
|
|
117278a |
install_recursive(File.join(srcdir, "lib"), rubylibdir, :no_install => noinst, :mode => $data_mode)
|
|
|
117278a |
+ if rubygemsdir
|
|
|
117278a |
+ noinst = %w[obsolete.rb]
|
|
|
117278a |
+ install_recursive(File.join(srcdir, "lib", "rubygems"), File.join(rubygemsdir, "rubygems"), :mode => $data_mode)
|
|
|
117278a |
+ install_recursive(File.join(srcdir, "lib", "rbconfig"), File.join(rubygemsdir, "rbconfig"), :no_install => noinst, :mode => $data_mode)
|
|
|
117278a |
+ install(File.join(srcdir, "lib", "ubygems.rb"), File.join(rubygemsdir, "ubygems.rb"), :mode => $data_mode)
|
|
|
117278a |
+ install(File.join(srcdir, "lib", "rubygems.rb"), File.join(rubygemsdir, "rubygems.rb"), :mode => $data_mode)
|
|
|
117278a |
+ end
|
|
|
117278a |
end
|
|
|
117278a |
|
|
|
9195984 |
install?(:local, :comm, :hdr, :'comm-hdr') do
|
|
|
9c18864 |
--
|
|
|
a03b2d2 |
1.8.3.1
|
|
|
117278a |
|