[jruby] 01/01: Add /usr/lib/ruby/vendor_ruby to the default $LOAD_PATH

Miguel Landaeta nomadium at moszumanska.debian.org
Wed May 27 20:11:31 UTC 2015


This is an automated email from the git hooks/post-receive script.

nomadium pushed a commit to branch experimental
in repository jruby.

commit bfdc4e0c9eb425ddb5fb470a8e126bf960f08479
Author: Miguel Landaeta <nomadium at debian.org>
Date:   Wed May 27 17:10:59 2015 -0300

    Add /usr/lib/ruby/vendor_ruby to the default $LOAD_PATH
---
 debian/changelog                                   |  3 +-
 ...Add-usr-lib-ruby-vendor-ruby-to-load-path.patch | 60 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 debian/rules                                       |  3 ++
 4 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 46714cb..51b3902 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 jruby (1.7.19-1) UNRELEASED; urgency=medium
 
   * New upstream release. (Closes: #636554, #773131, #750749).
+  * Add /usr/lib/ruby/vendor_ruby to the default $LOAD_PATH. (Closes: #663342).
   * Switch build system to Maven, upstream doesn't maintain Ant one anymore:
     - Add B-D on: maven, maven-{debian,repo}-helper and several maven plugins.
     - Replace cdbs with debhelper.
@@ -46,7 +47,7 @@ jruby (1.7.19-1) UNRELEASED; urgency=medium
     minified copy. This is to avoid lintian warnings, during build time
     a link symbolic to libjs-jquery is deployed.
 
- -- Miguel Landaeta <nomadium at debian.org>  Wed, 27 May 2015 12:41:39 -0300
+ -- Miguel Landaeta <nomadium at debian.org>  Wed, 27 May 2015 17:09:51 -0300
 
 jruby (1.5.6-10) unstable; urgency=medium
 
diff --git a/debian/patches/0003-Add-usr-lib-ruby-vendor-ruby-to-load-path.patch b/debian/patches/0003-Add-usr-lib-ruby-vendor-ruby-to-load-path.patch
new file mode 100644
index 0000000..ffcfd95
--- /dev/null
+++ b/debian/patches/0003-Add-usr-lib-ruby-vendor-ruby-to-load-path.patch
@@ -0,0 +1,60 @@
+From: Miguel Landaeta <nomadium at debian.org>
+Date: Wed, 27 May 2015 16:56:49 -0300
+Subject: Add /usr/lib/ruby/vendor_ruby to default LOAD_PATH
+Bug: https://bugs.debian.org/663342
+Forwarded: no
+
+diff --git a/core/src/main/java/org/jruby/ext/rbconfig/RbConfigLibrary.java b/core/src/main/java/org/jruby/ext/rbconfig/RbConfigLibrary.java
+index e2a4dca..7642404 100644
+--- a/core/src/main/java/org/jruby/ext/rbconfig/RbConfigLibrary.java
++++ b/core/src/main/java/org/jruby/ext/rbconfig/RbConfigLibrary.java
+@@ -63,6 +63,8 @@ public class RbConfigLibrary implements Library {
+     private static final String RUBY_FREEBSD = "freebsd";
+     private static final String RUBY_AIX = "aix";
+    
++    private static final String MRI_VENDOR_DIR = "/usr/lib/ruby/vendor_ruby";
++
+     private static String normalizedHome;
+     
+     /** This is a map from Java's "friendly" OS names to those used by Ruby */
+@@ -186,6 +188,10 @@ public class RbConfigLibrary implements Library {
+         return new NormalizedFile(getRubyLibDir(runtime), "vendor_ruby").getPath();
+     }
+ 
++    public static String getMRIVendorDir(Ruby runtime) {
++        return SafePropertyAccessor.getProperty("vendor.mri.dir", MRI_VENDOR_DIR);
++    }
++
+     public static String getVendorLibDir(Ruby runtime) {
+         return getVendorDir(runtime);
+     }
+@@ -297,6 +303,7 @@ public class RbConfigLibrary implements Library {
+         String rubyLibDir = getRubyLibDir(runtime);
+         String archDir = getArchDir(runtime);
+         String vendorDir = getVendorDir(runtime);
++        String vendorMRIDir = getMRIVendorDir(runtime);
+         String vendorLibDir = getVendorLibDir(runtime);
+         String vendorArchDir = getVendorArchDir(runtime);
+         String siteDir = getSiteDir(runtime);
+@@ -313,6 +320,7 @@ public class RbConfigLibrary implements Library {
+         setConfig(configHash, "vendorlibdir",   vendorLibDir);
+         setConfig(configHash, "vendorarchdir",    vendorArchDir);
+         }
++        setConfig(configHash, "vendor_mri_dir", vendorMRIDir);
+         setConfig(configHash, "sitedir",        siteDir);
+         setConfig(configHash, "sitelibdir",     siteLibDir);
+         setConfig(configHash, "sitearchdir",    siteArchDir);
+diff --git a/core/src/main/java/org/jruby/runtime/load/LoadService.java b/core/src/main/java/org/jruby/runtime/load/LoadService.java
+index 9d5ef00..80b05a9 100644
+--- a/core/src/main/java/org/jruby/runtime/load/LoadService.java
++++ b/core/src/main/java/org/jruby/runtime/load/LoadService.java
+@@ -279,6 +279,9 @@ public class LoadService {
+                 addPath(RbConfigLibrary.getRubyLibDir(runtime));
+             }
+ 
++            // Allow jruby to load libraries installed in the system
++            addPath(RbConfigLibrary.getMRIVendorDir(runtime));
++
+         } catch(SecurityException ignore) {}
+ 
+         // "." dir is used for relative path loads from a given file, as in require '../foo/bar'
diff --git a/debian/patches/series b/debian/patches/series
index e18eabe..8a35ff7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 0001-Fix-shebang-lines.patch
 0002-Fix-warning-jruby-script.patch
+0003-Add-usr-lib-ruby-vendor-ruby-to-load-path.patch
diff --git a/debian/rules b/debian/rules
index f31d330..d5547a1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -18,6 +18,9 @@ override_dh_auto_clean:
 	mh_unpatchpoms -pjruby
 	mh_clean
 	rm -f lib/jruby.jar bin/jruby
+	for subp in stdlib dist; do \
+		rm -rf ./maven/jruby-$$subp/target ; \
+	done
 	rm -rf -- "$(DEB_MAVEN_REPO)"
 
 override_dh_auto_configure:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jruby.git



More information about the pkg-java-commits mailing list