ports/lang/ruby31/files/patch-tool_mkconfig.rb
Yasuhiro Kimura 633b51aa6f lang/ruby31: Add new port
Add preview1 of Ruby 3.3 series.

To handle pre-release version, Mk/bsd.ruby.mk is changed as following.

* New variable RUBY_DISTVERSION is introduced. It keeps DISTVERSION of
  each ruby port (lang/rubyXY).
* The value of RUBY_VERSION, RUBY_PORTVERSION, RUBY_WRKSRC and
  RUBY_DISTNAME is set by using that of RUBY_DISTVERSION

ReleaseNotes:	https://www.ruby-lang.org/en/news/2021/11/09/ruby-3-1-0-preview1-released/
PR:		259746
Approved by:	maintainer timeout (> 1 month)
2021-12-19 09:34:57 +09:00

14 lines
533 B
Ruby

--- tool/mkconfig.rb.orig 2019-12-25 09:50:58 UTC
+++ tool/mkconfig.rb
@@ -160,8 +160,9 @@ def vars.expand(val, config = self)
val.replace(newval) unless newval == val
val
end
-prefix = vars.expand(vars["prefix"] ||= "")
-rubyarchdir = vars.expand(vars["rubyarchdir"] ||= "")
+prefix = vars.expand(vars["rubyarchdir"])
+major, minor, *rest = RUBY_VERSION.split('.')
+rubyarchdir = "/lib/ruby/#{major}.#{minor}/#{arch}"
relative_archdir = rubyarchdir.rindex(prefix, 0) ? rubyarchdir[prefix.size..-1] : rubyarchdir
puts %[\