ruby/ruby-2.1.0-custom-rubygems-location.patch

97 lines
3.3 KiB
Diff
Raw Normal View History

2013-10-07 10:30:18 +00:00
From 94da59aafacc6a9efe829529eb51385588d6f149 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.
---
2013-10-07 10:30:18 +00:00
configure.in | 5 +++++
loadpath.c | 4 ++++
template/verconf.h.in | 3 +++
tool/rbinstall.rb | 9 +++++++++
4 files changed, 21 insertions(+)
2012-01-18 14:54:01 +00:00
diff --git a/configure.in b/configure.in
2013-10-07 10:30:18 +00:00
index 03a4152..0e371e2 100644
2012-01-18 14:54:01 +00:00
--- a/configure.in
+++ b/configure.in
2014-03-05 14:30:45 +00:00
@@ -3731,6 +3731,10 @@ AC_ARG_WITH(vendorarchdir,
2013-02-08 23:54:37 +00:00
[vendorarchdir=$withval],
2013-02-21 13:36:05 +00:00
[vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby/${ruby_version}'}${multiarch-'${vendorlibdir}/${sitearch}'}])
2012-01-18 14:54:01 +00:00
+AC_ARG_WITH(rubygemsdir,
+ AS_HELP_STRING([--with-rubygemsdir=DIR], [custom rubygems directory]),
+ [rubygemsdir=$withval])
+
2013-10-07 10:30:18 +00:00
if test "${LOAD_RELATIVE+set}"; then
AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE)
RUBY_EXEC_PREFIX=''
2014-03-05 14:30:45 +00:00
@@ -3754,6 +3754,7 @@ AC_SUBST(sitearchdir)dnl
2012-01-18 14:54:01 +00:00
AC_SUBST(vendordir)dnl
2013-02-08 23:54:37 +00:00
AC_SUBST(vendorlibdir)dnl
2012-01-18 14:54:01 +00:00
AC_SUBST(vendorarchdir)dnl
+AC_SUBST(rubygemsdir)dnl
2013-10-07 10:30:18 +00:00
AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl
diff --git a/loadpath.c b/loadpath.c
index 623dc9d..74c5d9e 100644
--- a/loadpath.c
+++ b/loadpath.c
2014-01-06 12:48:46 +00:00
@@ -94,6 +94,10 @@ const char ruby_initial_load_paths[] =
2013-12-17 15:56:33 +00:00
#endif
2013-10-07 10:30:18 +00:00
#endif
+#ifdef RUBYGEMS_DIR
+ RUBYGEMS_DIR "\0"
+#endif
+
RUBY_LIB "\0"
#ifdef RUBY_THINARCH
RUBY_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
diff --git a/template/verconf.h.in b/template/verconf.h.in
index 79c003e..34f2382 100644
--- a/template/verconf.h.in
+++ b/template/verconf.h.in
@@ -34,6 +34,9 @@
% if C["RUBY_SEARCH_PATH"]
#define RUBY_SEARCH_PATH "${RUBY_SEARCH_PATH}"
% end
+% if C["rubygemsdir"]
+#define RUBYGEMS_DIR "${rubygemsdir}"
+% end
%
% R = {}
% R["ruby_version"] = '"RUBY_LIB_VERSION"'
2012-01-18 14:54:01 +00:00
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb
2013-10-07 10:30:18 +00:00
index b47b6e1..0b99408 100755
2012-01-18 14:54:01 +00:00
--- a/tool/rbinstall.rb
+++ b/tool/rbinstall.rb
2014-01-06 12:48:46 +00:00
@@ -324,6 +324,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"])
2014-01-06 12:48:46 +00:00
@@ -512,7 +513,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
2013-02-14 16:13:24 +00:00
--
2013-10-07 10:30:18 +00:00
1.8.3.1
2012-01-18 14:54:01 +00:00