[oe] meta-openembedded/meta-ruby: ruby-1.9.3-disable-versioned-paths.patch misses one path

Ulf Magnusson ulfalizer at gmail.com
Thu Nov 5 12:38:18 UTC 2015


Hello,

ruby-1.9.3-disable-versioned-paths.patch adds the
--disable-versioned-paths option, which strips Ruby's version number
from some install paths. The patch misses a spot however, which causes
TOPDIR to get an incorrect value (nil) in rbconfig.rb. This in turn
causes problems e.g. when trying to cross-compile native extensions.

The following patch fixes this. It assumes
ruby-1.9.3-disable-versioned-paths.patch has already been applied.

---
 tool/mkconfig.rb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index 10dbe65..aa54512 100755
--- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb
@@ -44,6 +44,7 @@ vars = {}
 continued_name = nil
 continued_line = nil
 path_version = "/$(ruby_version)"
+prefix_version = "/#{version}"
 File.foreach "config.status" do |line|
   next if /^#/ =~ line
   name = nil
@@ -149,7 +150,10 @@ File.foreach "config.status" do |line|
     when "ruby_version"
       version = val[/\A"(.*)"\z/, 1]
     when /^USE_VERSIONED_PATHS$/
-      path_version = nil if /NO/ =~ val
+      if /NO/ =~ val
+        path_version = nil
+        prefix_version = nil
+      end
     end
   end
 #  break if /^CEOF/
@@ -157,7 +161,7 @@ end

 drive = File::PATH_SEPARATOR == ';'

-prefix = "/#{v_runtime[:libdir] || 'lib'}/ruby/#{version}/#{arch}"
+prefix = "/#{v_runtime[:libdir] || 'lib'}/ruby#{prefix_version}/#{arch}"
 print "  TOPDIR = File.dirname(__FILE__).chomp!(#{prefix.dump})\n"
 print "  DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " :
""), "'' unless defined? DESTDIR\n"
 print <<'ARCH' if universal
-- 
2.1.4


Another "bug" is that meta/recipes-devtools/ruby (i.e., the newer Ruby
recipe) uses --disable-versioned-paths too even though afaics no such
option exists in that version. Maybe I should report that separately.

Cheers,
Ulf



More information about the Openembedded-devel mailing list