From 5433e1918d405b930f6c6ffa5476eddea9786dec Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Thu, 20 Jul 2023 23:55:51 -0700 Subject: [PATCH] (..) Only override rbconfig when cross compiling Need to think about this, see ruby-3.2.2 line 238 --- configs/components/_base-ruby-augeas.rb | 6 ++---- configs/components/ruby-shadow.rb | 11 +++-------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/configs/components/_base-ruby-augeas.rb b/configs/components/_base-ruby-augeas.rb index deab8c8ad..4ae0e612f 100644 --- a/configs/components/_base-ruby-augeas.rb +++ b/configs/components/_base-ruby-augeas.rb @@ -35,11 +35,9 @@ pkg.environment "CONFIGURE_ARGS", '--vendor' pkg.environment "PKG_CONFIG_PATH", "#{File.join(settings[:libdir], 'pkgconfig')}:/usr/lib/pkgconfig" -if platform.is_solaris? - if platform.architecture == 'sparc' - pkg.environment "RUBY", host_ruby - end +if platform.is_cross_compiled? && platform.is_solaris? ruby = "#{host_ruby} -r#{settings[:datadir]}/doc/rbconfig-#{ruby_version}-orig.rb" + pkg.environment "RUBY", host_ruby elsif platform.is_cross_compiled? if platform.is_linux? || platform.is_macos? pkg.environment "RUBY", host_ruby diff --git a/configs/components/ruby-shadow.rb b/configs/components/ruby-shadow.rb index 72b424172..37e66da54 100644 --- a/configs/components/ruby-shadow.rb +++ b/configs/components/ruby-shadow.rb @@ -3,22 +3,17 @@ pkg.ref "refs/tags/2.5.0" pkg.build_requires "ruby-#{settings[:ruby_version]}" - pkg.environment "PATH", "$(PATH):/usr/ccs/bin:/usr/sfw/bin" + pkg.environment "PATH", "$(PATH):/opt/pl-build-tools/bin:/usr/ccs/bin:/usr/sfw/bin" pkg.environment "CONFIGURE_ARGS", '--vendor' - if platform.is_solaris? - if platform.architecture == 'sparc' - pkg.environment "RUBY", settings[:host_ruby] - end - ruby = "#{settings[:host_ruby]} -r#{settings[:datadir]}/doc/rbconfig-#{settings[:ruby_version]}-orig.rb" - elsif platform.is_cross_compiled? + if platform.is_cross_compiled? pkg.environment "RUBY", settings[:host_ruby] ruby = "#{settings[:host_ruby]} -r#{settings[:datadir]}/doc/rbconfig-#{settings[:ruby_version]}-orig.rb" else ruby = File.join(settings[:ruby_bindir], 'ruby') end - matchdata = platform.settings[:ruby_version].match /(\d+)\.(\d+)\.\d+/ + matchdata = platform.settings[:ruby_version].match(/(\d+)\.(\d+)\.\d+/) ruby_major_version = matchdata[1].to_i if ruby_major_version >= 3 base = "resources/patches/ruby_32"