ports/lang/ruby22/files/patch-tool_mkconfig.rb
Sunpoet Po-Chuan Hsieh 10084409d4 - Move *_DEPENDS together
- Add GMP option: libgmp.so is linked if present
- Sort CONFIGURE_ARGS
- Remove duplicate WRKSRC
- Sort USES
- Use pre-install: instead of pre-su-install:
- Convert to new options helper
- Convert to new options target helper
- Add regression-test:
- Fix typo
- Cosmetic change
- Pet portlint: fix diff header of patch files
- Bump PORTREVISION for dependency and package change
2015-09-07 17:47:48 +00:00

14 lines
670 B
Ruby

--- tool/mkconfig.rb.orig 2014-07-07 02:07:01 UTC
+++ tool/mkconfig.rb
@@ -167,8 +167,9 @@
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
print " TOPDIR = File.dirname(__FILE__).chomp!(#{relative_archdir.dump})\n"
print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n"