ruby/ruby-1.8.6.p36_vendor_ruby.patch

164 lines
5.7 KiB
Diff

Index: configure.in
===================================================================
--- configure.in.orig
+++ configure.in
@@ -1571,9 +1571,28 @@ AC_DEFINE_UNQUOTED(RUBY_LIB, "${RUBY_LIB
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB, "${RUBY_SITE_LIB_PATH}")
AC_DEFINE_UNQUOTED(RUBY_SITE_LIB2, "${RUBY_SITE_LIB_PATH2}")
+AC_ARG_WITH(vendordir,
+ [ --with-vendordir=DIR vendor libraries in DIR [LIBDIR/ruby/vendor_ruby]],
+ [vendordir=$withval],
+ [vendordir='${libdir}/ruby/vendor_ruby'])
+VENDOR_DIR="`eval \"echo ${vendordir}\"`"
+case "$target_os" in
+ cygwin*|mingw*|*djgpp*|os2_emx*)
+ RUBY_VENDOR_LIB_PATH="`expr "$VENDOR_DIR" : "$prefix\(/.*\)"`" ||
+ RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
+ *)
+ RUBY_VENDOR_LIB_PATH="$VENDOR_DIR";;
+esac
+RUBY_VENDOR_LIB_PATH2="${RUBY_VENDOR_LIB_PATH}/${MAJOR}.${MINOR}"
+
+AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB, "${RUBY_VENDOR_LIB_PATH}")
+AC_DEFINE_UNQUOTED(RUBY_VENDOR_LIB2, "${RUBY_VENDOR_LIB_PATH2}")
+
AC_SUBST(arch)dnl
AC_SUBST(sitearch)dnl
+AC_SUBST(vendorarch)dnl
AC_SUBST(sitedir)dnl
+AC_SUBST(vendordir)dnl
configure_args=$ac_configure_args
AC_SUBST(configure_args)dnl
@@ -1586,6 +1605,8 @@ if test "$fat_binary" != no ; then
AC_DEFINE_UNQUOTED(RUBY_SITE_THIN_ARCHLIB,
"${RUBY_SITE_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
+ AC_DEFINE_UNQUOTED(RUBY_VENDOR_THIN_ARCHLIB,
+ "${RUBY_VENDOR_LIB_PATH}/" __ARCHITECTURE__ "-${target_os}")
AC_DEFINE_UNQUOTED(RUBY_PLATFORM, __ARCHITECTURE__ "-${target_os}")
else
arch="${target_cpu}-${target_os}"
@@ -1593,12 +1614,15 @@ else
fi
case "$target_os" in
- mingw*) sitearch="i386-$rb_cv_msvcrt" ;;
- *) sitearch="${arch}" ;;
+ mingw*) sitearch="i386-$rb_cv_msvcrt"
+ vendorarch="i386-$rb_cv_msvcrt" ;;
+ *) sitearch="${arch}"
+ vendorarch="${arch}" ;;
esac
AC_DEFINE_UNQUOTED(RUBY_ARCHLIB, "${RUBY_LIB_PATH}/${arch}")
AC_DEFINE_UNQUOTED(RUBY_SITE_ARCHLIB, "${RUBY_SITE_LIB_PATH2}/${sitearch}")
+AC_DEFINE_UNQUOTED(RUBY_VENDOR_ARCHLIB, "${RUBY_VENDOR_LIB_PATH2}/${vendorarch}")
AC_ARG_WITH(search-path,
[ --with-search-path=DIR specify the additional search path],
Index: instruby.rb
===================================================================
--- instruby.rb.orig
+++ instruby.rb
@@ -162,6 +162,8 @@ rubylibdir = CONFIG["rubylibdir"]
archlibdir = CONFIG["archdir"]
sitelibdir = CONFIG["sitelibdir"]
sitearchlibdir = CONFIG["sitearchdir"]
+vendorlibdir = CONFIG["vendorlibdir"]
+vendorarchlibdir = CONFIG["vendorarchdir"]
mandir = File.join(CONFIG["mandir"], "man")
configure_args = Shellwords.shellwords(CONFIG["configure_args"])
enable_shared = CONFIG["ENABLE_SHARED"] == 'yes'
@@ -202,7 +204,7 @@ if $extout
extout = "#$extout"
install?(:ext, :arch, :'ext-arch') do
puts "installing extension objects"
- makedirs [archlibdir, sitearchlibdir]
+ makedirs [archlibdir, sitearchlibdir, vendorarchlibdir]
if noinst = CONFIG["no_install_files"] and noinst.empty?
noinst = nil
end
@@ -210,7 +212,7 @@ if $extout
end
install?(:ext, :comm, :'ext-comm') do
puts "installing extension scripts"
- makedirs [rubylibdir, sitelibdir]
+ makedirs [rubylibdir, sitelibdir, vendorlibdir]
install_recursive("#{extout}/common", rubylibdir)
end
end
Index: Makefile.in
===================================================================
--- Makefile.in.orig
+++ Makefile.in
@@ -24,6 +24,8 @@ datadir = @datadir@
arch = @arch@
sitearch = @sitearch@
sitedir = @sitedir@
+vendorarch = @vendorarch@
+vendordir = @vendordir@
TESTUI = console
TESTS =
Index: mkconfig.rb
===================================================================
--- mkconfig.rb.orig
+++ mkconfig.rb
@@ -143,6 +143,14 @@ print <<EOS
CONFIG["archdir"] = "$(rubylibdir)/$(arch)"
CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)"
CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)"
+ CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)"
+ CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(vendorarch)"
+ if defined?(VENDOR_SPECIFIC) && VENDOR_SPECIFIC
+ CONFIG["sitearch"] = CONFIG["vendorarch"]
+ CONFIG["sitedir"] = CONFIG["vendordir"]
+ CONFIG["sitelibdir"] = CONFIG["vendorlibdir"]
+ CONFIG["sitearchdir"] = CONFIG["vendorarchdir"]
+ end
CONFIG["topdir"] = File.dirname(__FILE__)
MAKEFILE_CONFIG = {}
CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup}
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb.orig
+++ lib/mkmf.rb
@@ -51,6 +51,9 @@ $archdir = CONFIG["archdir"]
$sitedir = CONFIG["sitedir"]
$sitelibdir = CONFIG["sitelibdir"]
$sitearchdir = CONFIG["sitearchdir"]
+$vendordir = CONFIG["vendordir"]
+$vendorlibdir = CONFIG["vendorlibdir"]
+$vendorarchdir = CONFIG["vendorarchdir"]
$mswin = /mswin/ =~ RUBY_PLATFORM
$bccwin = /bccwin/ =~ RUBY_PLATFORM
@@ -1095,6 +1103,7 @@ RUBY_INSTALL_NAME = #{CONFIG['RUBY_INSTA
RUBY_SO_NAME = #{CONFIG['RUBY_SO_NAME']}
arch = #{CONFIG['arch']}
sitearch = #{CONFIG['sitearch']}
+vendorarch = #{CONFIG['vendorarch']}
ruby_version = #{Config::CONFIG['ruby_version']}
ruby = #{$ruby}
RUBY = $(ruby#{sep})
Index: ruby.c
===================================================================
--- ruby.c.orig
+++ ruby.c
@@ -298,6 +298,13 @@ ruby_init_loadpath()
ruby_incpush(RUBY_RELATIVE(RUBY_SITE_ARCHLIB));
ruby_incpush(RUBY_RELATIVE(RUBY_SITE_LIB));
+ ruby_incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB2));
+#ifdef RUBY_VENDOR_THIN_ARCHLIB
+ ruby_incpush(RUBY_RELATIVE(RUBY_VENDOR_THIN_ARCHLIB));
+#endif
+ ruby_incpush(RUBY_RELATIVE(RUBY_VENDOR_ARCHLIB));
+ ruby_incpush(RUBY_RELATIVE(RUBY_VENDOR_LIB));
+
ruby_incpush(RUBY_RELATIVE(RUBY_LIB));
#ifdef RUBY_THIN_ARCHLIB
ruby_incpush(RUBY_RELATIVE(RUBY_THIN_ARCHLIB));