Files
MSYS2-packages/ruby/ruby-2.6.0-msys2.patch
2018-12-26 10:49:38 +03:00

702 lines
27 KiB
Diff

diff -Naur ruby-2.6.0-orig/configure.ac ruby-2.6.0/configure.ac
--- ruby-2.6.0-orig/configure.ac 2018-12-26 09:24:17.669958600 +0300
+++ ruby-2.6.0/configure.ac 2018-12-26 09:14:01.152475500 +0300
@@ -316,14 +316,14 @@
ASFLAGS=$ASFLAGS
AC_SUBST(ASFLAGS)
-AS_CASE(["$target_os"],[cygwin*|mingw*], [ac_cv_prog_ac_ct_OBJCOPY=":"])
+AS_CASE(["$target_os"],[cygwin*|msys*|mingw*], [ac_cv_prog_ac_ct_OBJCOPY=":"])
# BSD's ports and MacPorts prefix GNU binutils with 'g'
AC_CHECK_TOOLS(OBJDUMP, [objdump gobjdump])
AC_CHECK_TOOLS(OBJCOPY, [objcopy gobjcopy])
AS_CASE(["$target_os"],
-[cygwin*|mingw*], [
+[cygwin*|msys*|mingw*], [
AC_CHECK_TOOL(WINDRES, windres)
AC_CHECK_TOOL(DLLWRAP, dllwrap)
target=`echo $target | sed "s/^$target_cpu-/-/"`
@@ -620,7 +620,7 @@
AC_DEFINE(RUBY_MINGW64_BROKEN_FREXP_MODF)
])
],
- [cygwin*|darwin*|netbsd*], [
+ [cygwin*|msys*|darwin*|netbsd*], [
# need lgamma_r(), finite()
],
[solaris*], [
@@ -924,7 +924,7 @@
[haiku*], [
LIBS="$LIBS" # m lib is include in root
],
-[cygwin*], [ ac_cv_header_langinfo_h=yes
+[cygwin*|msys*], [ ac_cv_header_langinfo_h=yes
RUBY_APPEND_OPTIONS(CPPFLAGS, -D_XOPEN_SOURCE -D_GNU_SOURCE)
AC_CHECK_FUNCS(cygwin_conv_path)
AC_LIBOBJ([langinfo])
@@ -1944,7 +1944,7 @@
rb_cv_getcwd_malloc=yes,
rb_cv_getcwd_malloc=no,
AS_CASE($target_os,
- [linux*|darwin*|*bsd|cygwin*|mingw*|mswin*],
+ [linux*|darwin*|*bsd|cygwin*|msys*|mingw*|mswin*],
[rb_cv_getcwd_malloc=yes],
[rb_cv_getcwd_malloc=no]))])
AS_IF([test "$rb_cv_getcwd_malloc" = no], [AC_DEFINE(NO_GETCWD_MALLOC, 1)])
@@ -2609,7 +2609,7 @@
# mkmf.rb's have_header() to fail if the desired resource happens to be
# installed in the /usr/local tree.
RUBY_APPEND_OPTION(CCDLFLAGS, -fno-common)],
- [bsdi*|cygwin*|mingw*|aix*|interix*], [ ],
+ [bsdi*|cygwin*|msys*|mingw*|aix*|interix*], [ ],
[
RUBY_APPEND_OPTION(CCDLFLAGS, -fPIC)])
], [
@@ -2713,7 +2713,7 @@
: ${LDSHARED='$(LD) -Bshareable -x'}
LDFLAGS="$LDFLAGS -L/lib -L/usr/lib -L/usr/local/lib"
rb_cv_dlopen=yes],
- [cygwin*|mingw*], [
+ [cygwin*|msys*|mingw*], [
: ${LDSHARED='$(CC) -shared'}
XLDFLAGS="$XLDFLAGS -Wl,--stack,0x00200000,--enable-auto-import"
DLDFLAGS="${DLDFLAGS} -Wl,--enable-auto-image-base,--enable-auto-import"
@@ -3066,7 +3066,7 @@
SOLIBS='$(MAINLIBS)'
AS_CASE(["$target_os"],
- [cygwin*|mingw*|haiku*|darwin*], [
+ [cygwin*|msys*|mingw*|haiku*|darwin*], [
: ${DLDLIBS=""}
],
[
@@ -3096,7 +3096,7 @@
[darwin*], [
RUBY_SO_NAME='$(RUBY_BASE_NAME).$(RUBY_API_VERSION)'
],
- [cygwin*], [
+ [cygwin*|msys*], [
RUBY_SO_NAME='$(RUBY_BASE_NAME)$(MAJOR)$(MINOR)0'
],
[mingw*], [
@@ -3449,7 +3449,7 @@
CFLAGS="$CFLAGS -std"
])
],
- [cygwin*|mingw*], [
+ [cygwin*|msys*|mingw*], [
LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)'
AS_CASE(["$target_os"],
[cygwin*], [
@@ -3458,6 +3458,12 @@
LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
])
],
+ [msys*], [
+ if test x"$enable_shared" = xyes; then
+ LIBRUBY_SO='msys-$(RUBY_SO_NAME)'.dll
+ LIBRUBY_DLDFLAGS="${LIBRUBY_DLDFLAGS}"' $(RUBYDEF)'
+ fi
+ ],
[mingw*], [
AS_IF([test x"$enable_shared" = xyes], [
LIBRUBY_SO='$(RUBY_SO_NAME)'.dll
diff -Naur ruby-2.6.0-orig/cygwin/GNUmakefile.in ruby-2.6.0/cygwin/GNUmakefile.in
--- ruby-2.6.0-orig/cygwin/GNUmakefile.in 2017-02-10 09:12:22.000000000 +0300
+++ ruby-2.6.0/cygwin/GNUmakefile.in 2018-12-26 09:15:55.625476600 +0300
@@ -7,6 +7,8 @@
ifeq (@target_os@,cygwin)
DLL_BASE_NAME := $(LIBRUBY_SO:.dll=)
+else ifeq (@target_os@,msys)
+ DLL_BASE_NAME := $(LIBRUBY_SO:.dll=)
else
DLL_BASE_NAME := $(RUBY_SO_NAME)
DLLWRAP += -mno-cygwin
@@ -100,6 +102,12 @@
$(ECHO) generating $@
$(Q) @DLLWRAP@ -s --def=$(RUBYDEF) -o $@
endif
+
+ifeq (@target_os@,msys)
+msys2-$(RUBY_INSTALL_NAME)$(MAJOR)$(MINOR)0.dll: $(LIBRUBY_A) $(RUBYDEF)
+ $(ECHO) generating $@
+ $(Q) @DLLWRAP@ -s --def=$(RUBYDEF) -o $@
+endif
clean-local::
@$(RM) $(RUBY_EXP) $(RCFILES:.rc=.res.@OBJEXT@)
diff -Naur ruby-2.6.0-orig/ext/bigdecimal/util/extconf.rb ruby-2.6.0/ext/bigdecimal/util/extconf.rb
--- ruby-2.6.0-orig/ext/bigdecimal/util/extconf.rb 2018-12-05 14:30:26.000000000 +0300
+++ ruby-2.6.0/ext/bigdecimal/util/extconf.rb 2018-12-26 09:16:54.188979500 +0300
@@ -3,7 +3,7 @@
checking_for(checking_message("Windows")) do
case RUBY_PLATFORM
- when /cygwin|mingw/
+ when /cygwin|msys|mingw/
if defined?($extlist)
build_dir = "$(TARGET_SO_DIR)../"
else
diff -Naur ruby-2.6.0-orig/ext/etc/extconf.rb ruby-2.6.0/ext/etc/extconf.rb
--- ruby-2.6.0-orig/ext/etc/extconf.rb 2018-10-20 13:30:42.000000000 +0300
+++ ruby-2.6.0/ext/etc/extconf.rb 2018-12-26 09:14:01.339675800 +0300
@@ -36,7 +36,7 @@
$defs.push("-DPW_AGE2VAL="+f)
end
have_struct_member('struct passwd', 'pw_class', 'pwd.h')
-have_struct_member('struct passwd', 'pw_comment', 'pwd.h') unless /cygwin/ === RUBY_PLATFORM
+have_struct_member('struct passwd', 'pw_comment', 'pwd.h') unless /cygwin|msys/ === RUBY_PLATFORM
have_struct_member('struct passwd', 'pw_expire', 'pwd.h')
have_struct_member('struct passwd', 'pw_passwd', 'pwd.h')
have_struct_member('struct group', 'gr_passwd', 'grp.h')
diff -Naur ruby-2.6.0-orig/ext/extmk.rb ruby-2.6.0/ext/extmk.rb
--- ruby-2.6.0-orig/ext/extmk.rb 2018-12-01 12:29:14.000000000 +0300
+++ ruby-2.6.0/ext/extmk.rb 2018-12-26 09:14:01.292875700 +0300
@@ -469,7 +469,7 @@
exts = $static_ext.sort_by {|t, i| i}.collect {|t, i| t}
default_exclude_exts =
case
- when $cygwin
+ when $cygwin, $msys
%w''
when $mswin, $mingw
%w'pty syslog'
diff -Naur ruby-2.6.0-orig/ext/readline/extconf.rb ruby-2.6.0/ext/readline/extconf.rb
--- ruby-2.6.0-orig/ext/readline/extconf.rb 2018-09-03 02:27:08.000000000 +0300
+++ ruby-2.6.0/ext/readline/extconf.rb 2018-12-26 09:14:01.370875900 +0300
@@ -30,7 +30,7 @@
dir_config("readline")
enable_libedit = enable_config("libedit")
-have_library("user32", nil) if /cygwin/ === RUBY_PLATFORM
+have_library("user32", nil) if /cygwin|msys/ === RUBY_PLATFORM
have_library("ncurses", "tgetnum") ||
have_library("termcap", "tgetnum") ||
have_library("curses", "tgetnum")
diff -Naur ruby-2.6.0-orig/ext/Setup.nt ruby-2.6.0/ext/Setup.nt
--- ruby-2.6.0-orig/ext/Setup.nt 2016-08-09 09:44:45.000000000 +0300
+++ ruby-2.6.0/ext/Setup.nt 2018-12-26 09:14:01.402075900 +0300
@@ -1,4 +1,4 @@
-#option platform cygwin|mingw|mswin
+#option platform cygwin|msys|mingw|mswin
#option nodynamic
Win32API
diff -Naur ruby-2.6.0-orig/ext/socket/extconf.rb ruby-2.6.0/ext/socket/extconf.rb
--- ruby-2.6.0-orig/ext/socket/extconf.rb 2018-03-02 07:36:14.000000000 +0300
+++ ruby-2.6.0/ext/socket/extconf.rb 2018-12-26 09:14:01.402075900 +0300
@@ -254,7 +254,7 @@
# [ruby-dev:44189]
# http://bugs.ruby-lang.org/issues/5075
close_fds = false
- when /cygwin/
+ when /cygwin|msys/
# Cygwin doesn't support fd passing.
# http://cygwin.com/ml/cygwin/2003-09/msg01808.html
close_fds = false
@@ -435,7 +435,7 @@
test_func = "WSACleanup"
have_library("iphlpapi")
have_library("ws2_32", "WSACleanup", headers)
-when /cygwin/
+when /cygwin|msys/
test_func = "socket(0,0,0)"
when /haiku/
test_func = "socket(0,0,0)"
diff -Naur ruby-2.6.0-orig/ext/win32/extconf.rb ruby-2.6.0/ext/win32/extconf.rb
--- ruby-2.6.0-orig/ext/win32/extconf.rb 2016-11-18 07:34:26.000000000 +0300
+++ ruby-2.6.0/ext/win32/extconf.rb 2018-12-26 09:14:01.433276000 +0300
@@ -1,4 +1,4 @@
# frozen_string_literal: false
-if $mswin||$mingw||$cygwin
+if $mswin||$mingw||$cygwin||$msys
create_makefile('win32')
end
diff -Naur ruby-2.6.0-orig/ext/win32ole/extconf.rb ruby-2.6.0/ext/win32ole/extconf.rb
--- ruby-2.6.0-orig/ext/win32ole/extconf.rb 2015-12-16 08:31:54.000000000 +0300
+++ ruby-2.6.0/ext/win32ole/extconf.rb 2018-12-26 09:14:01.433276000 +0300
@@ -6,7 +6,7 @@
require 'mkmf'
case RUBY_PLATFORM
-when /cygwin/
+when /cygwin|msys/
inc = nil
lib = '/usr/lib/w32api'
end
diff -Naur ruby-2.6.0-orig/gems/rake-12.3.2/lib/rake/application.rb ruby-2.6.0/gems/rake-12.3.2/lib/rake/application.rb
--- ruby-2.6.0-orig/gems/rake-12.3.2/lib/rake/application.rb 2018-12-25 09:29:15.000000000 +0300
+++ ruby-2.6.0/gems/rake-12.3.2/lib/rake/application.rb 2018-12-26 09:14:01.448876000 +0300
@@ -360,7 +360,7 @@
def unix? # :nodoc:
RbConfig::CONFIG["host_os"] =~
- /(aix|darwin|linux|(net|free|open)bsd|cygwin|solaris|irix|hpux)/i
+ /(aix|darwin|linux|(net|free|open)bsd|cygwin|msys|solaris|irix|hpux)/i
end
def windows? # :nodoc:
diff -Naur ruby-2.6.0-orig/lib/mkmf.rb ruby-2.6.0/lib/mkmf.rb
--- ruby-2.6.0-orig/lib/mkmf.rb 2018-12-04 11:22:10.000000000 +0300
+++ ruby-2.6.0/lib/mkmf.rb 2018-12-26 09:14:01.480076100 +0300
@@ -137,6 +137,7 @@
$mswin = /mswin/ =~ RUBY_PLATFORM
$mingw = /mingw/ =~ RUBY_PLATFORM
$cygwin = /cygwin/ =~ RUBY_PLATFORM
+ $msys = /msys/ =~ RUBY_PLATFORM
$netbsd = /netbsd/ =~ RUBY_PLATFORM
$haiku = /haiku/ =~ RUBY_PLATFORM
$solaris = /solaris/ =~ RUBY_PLATFORM
@@ -1895,6 +1896,12 @@
IO.popen(["cygpath", "-u", path], &:read).chomp
end
end
+ when 'msys'
+ if CONFIG['target_os'] != 'msys'
+ def mkintpath(path)
+ IO.popen(["cygpath", "-u", path], &:read).chomp
+ end
+ end
end
end
unless method_defined?(:mkintpath)
@@ -1911,7 +1918,7 @@
SHELL = /bin/sh
# V=0 quiet, V=1 verbose. other values don't work.
-V = 0
+V = 1
Q1 = $(V:1=)
Q = $(Q1:0=@)
ECHO1 = $(V:1=@ #{CONFIG['NULLCMD']})
diff -Naur ruby-2.6.0-orig/lib/resolv.rb ruby-2.6.0/lib/resolv.rb
--- ruby-2.6.0-orig/lib/resolv.rb 2018-03-06 06:31:46.000000000 +0300
+++ ruby-2.6.0/lib/resolv.rb 2018-12-26 09:14:01.745276500 +0300
@@ -167,7 +167,7 @@
class Hosts
begin
- raise LoadError unless /mswin|mingw|cygwin/ =~ RUBY_PLATFORM
+ raise LoadError unless /mswin/ =~ RUBY_PLATFORM
require 'win32/resolv'
DefaultFileName = Win32::Resolv.get_hosts_path || IO::NULL
rescue LoadError
@@ -984,7 +984,7 @@
if File.exist? filename
config_hash = Config.parse_resolv_conf(filename)
else
- if /mswin|cygwin|mingw|bccwin/ =~ RUBY_PLATFORM
+ if /mswin|bccwin/ =~ RUBY_PLATFORM
require 'win32/resolv'
search, nameserver = Win32::Resolv.get_resolv_info
config_hash = {}
diff -Naur ruby-2.6.0-orig/lib/rubygems/platform.rb ruby-2.6.0/lib/rubygems/platform.rb
--- ruby-2.6.0-orig/lib/rubygems/platform.rb 2018-11-21 13:20:47.000000000 +0300
+++ ruby-2.6.0/lib/rubygems/platform.rb 2018-12-26 09:14:02.228877400 +0300
@@ -79,6 +79,7 @@
@os, @version = case os
when /aix(\d+)?/ then [ 'aix', $1 ]
when /cygwin/ then [ 'cygwin', nil ]
+ when /msys/ then [ 'msys', nil ]
when /darwin(\d+)?/ then [ 'darwin', $1 ]
when /^macruby$/ then [ 'macruby', nil ]
when /freebsd(\d+)?/ then [ 'freebsd', $1 ]
diff -Naur ruby-2.6.0-orig/test/dbm/test_dbm.rb ruby-2.6.0/test/dbm/test_dbm.rb
--- ruby-2.6.0-orig/test/dbm/test_dbm.rb 2018-08-07 15:47:11.000000000 +0300
+++ ruby-2.6.0/test/dbm/test_dbm.rb 2018-12-26 09:14:02.447277800 +0300
@@ -15,7 +15,7 @@
def TestDBM_RDONLY.uname_s
require 'rbconfig'
case RbConfig::CONFIG['target_os']
- when 'cygwin'
+ when 'cygwin', 'msys'
require 'etc'
Etc.uname[:sysname]
else
diff -Naur ruby-2.6.0-orig/test/fiddle/helper.rb ruby-2.6.0/test/fiddle/helper.rb
--- ruby-2.6.0-orig/test/fiddle/helper.rb 2017-09-12 14:52:23.000000000 +0300
+++ ruby-2.6.0/test/fiddle/helper.rb 2018-12-26 09:14:02.260077400 +0300
@@ -10,6 +10,9 @@
when /cygwin/
libc_so = "cygwin1.dll"
libm_so = "cygwin1.dll"
+when /msys/
+ libc_so = "msys-2.0.dll"
+ libm_so = "msys-2.0.dll"
when /linux/
libdir = '/lib'
case [0].pack('L!').size
diff -Naur ruby-2.6.0-orig/test/fiddle/test_handle.rb ruby-2.6.0/test/fiddle/test_handle.rb
--- ruby-2.6.0-orig/test/fiddle/test_handle.rb 2017-12-28 23:09:24.000000000 +0300
+++ ruby-2.6.0/test/fiddle/test_handle.rb 2018-12-26 09:14:02.275677500 +0300
@@ -187,7 +187,7 @@
assert_no_memory_leak(%w[-W0 -rfiddle.so], '', '100_000.times {Fiddle::Handle.allocate}; GC.start', rss: true)
end
- if /cygwin|mingw|mswin/ =~ RUBY_PLATFORM
+ if /cygwin|msys|mingw|mswin/ =~ RUBY_PLATFORM
def test_fallback_to_ansi
k = Fiddle::Handle.new("kernel32.dll")
ansi = k["GetFileAttributesA"]
diff -Naur ruby-2.6.0-orig/test/gdbm/test_gdbm.rb ruby-2.6.0/test/gdbm/test_gdbm.rb
--- ruby-2.6.0-orig/test/gdbm/test_gdbm.rb 2018-08-07 15:47:11.000000000 +0300
+++ ruby-2.6.0/test/gdbm/test_gdbm.rb 2018-12-26 09:14:02.306877500 +0300
@@ -16,6 +16,9 @@
case RbConfig::CONFIG['target_os']
when 'cygwin'
require 'etc'
+ Etc.uname[:sysname
+ when 'msys'
+ require 'etc'
Etc.uname[:sysname]
else
RbConfig::CONFIG['target_os']
diff -Naur ruby-2.6.0-orig/test/ruby/test_argf.rb ruby-2.6.0/test/ruby/test_argf.rb
--- ruby-2.6.0-orig/test/ruby/test_argf.rb 2018-08-09 12:36:03.000000000 +0300
+++ ruby-2.6.0/test/ruby/test_argf.rb 2018-12-26 09:14:02.416077700 +0300
@@ -54,7 +54,7 @@
end
def no_safe_rename
- /cygwin|mswin|mingw|bccwin/ =~ RUBY_PLATFORM
+ /cygwin|msys|mswin|mingw|bccwin/ =~ RUBY_PLATFORM
end
def assert_src_expected(src, args = nil, line: caller_locations(1, 1)[0].lineno+1)
diff -Naur ruby-2.6.0-orig/test/ruby/test_dir_m17n.rb ruby-2.6.0/test/ruby/test_dir_m17n.rb
--- ruby-2.6.0-orig/test/ruby/test_dir_m17n.rb 2017-08-16 00:33:43.000000000 +0300
+++ ruby-2.6.0/test/ruby/test_dir_m17n.rb 2018-12-26 09:14:02.462877800 +0300
@@ -22,7 +22,7 @@
assert_include(ents, filename)
EOS
- return if /cygwin/ =~ RUBY_PLATFORM
+ return if /cygwin|msys/ =~ RUBY_PLATFORM
assert_separately(%w[-EASCII-8BIT], <<-EOS, :chdir=>dir)
filename = #{code}.chr('UTF-8').force_encoding("ASCII-8BIT")
opts = {:encoding => Encoding.default_external} if /mswin|mingw/ =~ RUBY_PLATFORM
@@ -59,7 +59,7 @@
end
def test_filename_extutf8_invalid
- return if /cygwin/ =~ RUBY_PLATFORM
+ return if /cygwin|msys/ =~ RUBY_PLATFORM
# High Sierra's APFS cannot use invalid filenames
return if Bug::File::Fs.fsname(Dir.tmpdir) == "apfs"
with_tmpdir {|d|
@@ -177,7 +177,7 @@
## others
def test_filename_bytes_euc_jp
- return if /cygwin/ =~ RUBY_PLATFORM
+ return if /cygwin|msys/ =~ RUBY_PLATFORM
with_tmpdir {|d|
assert_separately(%w[-EEUC-JP], <<-'EOS', :chdir=>d)
filename = "\xA4\xA2".force_encoding("euc-jp")
@@ -194,7 +194,7 @@
end
def test_filename_euc_jp
- return if /cygwin/ =~ RUBY_PLATFORM
+ return if /cygwin|msys/ =~ RUBY_PLATFORM
with_tmpdir {|d|
assert_separately(%w[-EEUC-JP], <<-'EOS', :chdir=>d)
filename = "\xA4\xA2".force_encoding("euc-jp")
@@ -240,7 +240,7 @@
end
def test_filename_ext_euc_jp_and_int_utf_8
- return if /cygwin/ =~ RUBY_PLATFORM
+ return if /cygwin|msys/ =~ RUBY_PLATFORM
with_tmpdir {|d|
assert_separately(%w[-EEUC-JP], <<-'EOS', :chdir=>d)
filename = "\xA4\xA2".force_encoding("euc-jp")
diff -Naur ruby-2.6.0-orig/test/ruby/test_file_exhaustive.rb ruby-2.6.0/test/ruby/test_file_exhaustive.rb
--- ruby-2.6.0-orig/test/ruby/test_file_exhaustive.rb 2018-12-17 07:58:50.000000000 +0300
+++ ruby-2.6.0/test/ruby/test_file_exhaustive.rb 2018-12-26 09:14:02.494077900 +0300
@@ -7,7 +7,7 @@
class TestFileExhaustive < Test::Unit::TestCase
DRIVE = Dir.pwd[%r'\A(?:[a-z]:|//[^/]+/[^/]+)'i]
- POSIX = /cygwin|mswin|bccwin|mingw|emx/ !~ RUBY_PLATFORM
+ POSIX = /cygwin|msys|mswin|bccwin|mingw|emx/ !~ RUBY_PLATFORM
NTFS = !(/mingw|mswin|bccwin/ !~ RUBY_PLATFORM)
def assert_incompatible_encoding
@@ -1488,7 +1488,7 @@
assert_equal(true, test(?=, fn1, fn1))
assert_equal(false, test(?>, fn1, fn1))
assert_equal(false, test(?<, fn1, fn1))
- unless /cygwin/ =~ RUBY_PLATFORM
+ unless /cygwin|msys/ =~ RUBY_PLATFORM
assert_equal(false, test(?=, fn1, fn2))
assert_equal(false, test(?>, fn1, fn2))
assert_equal(true, test(?>, fn2, fn1))
diff -Naur ruby-2.6.0-orig/test/ruby/test_io.rb ruby-2.6.0/test/ruby/test_io.rb
--- ruby-2.6.0-orig/test/ruby/test_io.rb 2018-11-30 14:44:21.000000000 +0300
+++ ruby-2.6.0/test/ruby/test_io.rb 2018-12-26 09:20:13.917130300 +0300
@@ -1399,7 +1399,7 @@
t.value
assert_equal("", s)
end
- end if /cygwin/ !~ RUBY_PLATFORM
+ end if /cygwin|msys/ !~ RUBY_PLATFORM
def test_read
pipe(proc do |w|
@@ -1452,7 +1452,7 @@
t.value
assert_equal("xxx", s)
end
- end if /cygwin/ !~ RUBY_PLATFORM
+ end if /cygwin|msys/ !~ RUBY_PLATFORM
def test_write_nonblock
pipe(proc do |w|
@@ -3435,7 +3435,7 @@
assert_nothing_raised(RuntimeError, bug8669) { str.clear }
t.join
}
- end if /cygwin/ !~ RUBY_PLATFORM
+ end if /cygwin|msys/ !~ RUBY_PLATFORM
def test_readpartial_unlocktmp_ensure
bug8669 = '[ruby-core:56121] [Bug #8669]'
@@ -3453,7 +3453,7 @@
assert_nothing_raised(RuntimeError, bug8669) { str.clear }
t.join
}
- end if /cygwin/ !~ RUBY_PLATFORM
+ end if /cygwin|msys/ !~ RUBY_PLATFORM
def test_readpartial_bad_args
IO.pipe do |r, w|
@@ -3482,7 +3482,7 @@
assert_nothing_raised(RuntimeError, bug8669) { str.clear }
t.join
}
- end if /cygwin/ !~ RUBY_PLATFORM
+ end if /cygwin|msys/ !~ RUBY_PLATFORM
def test_exception_at_close
bug10153 = '[ruby-core:64463] [Bug #10153] exception in close at the end of block'
@@ -3523,7 +3523,7 @@
assert_equal("foo", t1_value)
EOS
}
- end if /mswin|mingw|bccwin|cygwin/ !~ RUBY_PLATFORM
+ end if /mswin|mingw|bccwin|cygwin|msys/ !~ RUBY_PLATFORM
def test_open_flag
make_tempfile do |t|
diff -Naur ruby-2.6.0-orig/test/ruby/test_path.rb ruby-2.6.0/test/ruby/test_path.rb
--- ruby-2.6.0-orig/test/ruby/test_path.rb 2015-12-16 08:07:31.000000000 +0300
+++ ruby-2.6.0/test/ruby/test_path.rb 2018-12-26 09:14:02.587678000 +0300
@@ -48,7 +48,7 @@
end
def test_dirname
- if /(bcc|ms)win\d|mingw|cygwin|emx/ =~ RUBY_PLATFORM
+ if /(bcc|ms)win\d|mingw|cygwin|msys|emx/ =~ RUBY_PLATFORM
# DOSISH_DRIVE_LETTER
assert_equal('C:.', File.dirname('C:'))
assert_equal('C:.', File.dirname('C:a'))
@@ -104,7 +104,7 @@
assert_equal('/', File.dirname('/a/'))
assert_equal('/a', File.dirname('/a/b'))
- if /(bcc|ms|cyg)win|mingw|emx/ =~ RUBY_PLATFORM
+ if /(bcc|ms|cyg)win|msys|mingw|emx/ =~ RUBY_PLATFORM
# DOSISH_UNC
assert_equal('//', File.dirname('//'))
assert_equal('//a', File.dirname('//a'))
@@ -138,7 +138,7 @@
end
def test_basename
- if /(bcc|ms)win\d|mingw|cygwin|emx/ =~ RUBY_PLATFORM
+ if /(bcc|ms)win\d|mingw|cygwin|msys|emx/ =~ RUBY_PLATFORM
# DOSISH_DRIVE_LETTER
assert_equal('', File.basename('C:'))
assert_equal('a', File.basename('C:a'))
@@ -194,7 +194,7 @@
assert_equal("..", File.basename("..", ".*"))
- if /(bcc|ms|cyg)win|mingw|emx/ =~ RUBY_PLATFORM
+ if /(bcc|ms|cyg)win|msys|mingw|emx/ =~ RUBY_PLATFORM
# DOSISH_UNC
assert_equal('/', File.basename('//'))
assert_equal('/', File.basename('//a'))
diff -Naur ruby-2.6.0-orig/test/ruby/test_require.rb ruby-2.6.0/test/ruby/test_require.rb
--- ruby-2.6.0-orig/test/ruby/test_require.rb 2017-12-28 23:09:24.000000000 +0300
+++ ruby-2.6.0/test/ruby/test_require.rb 2018-12-26 09:14:02.665678200 +0300
@@ -95,7 +95,7 @@
end
case RUBY_PLATFORM
- when /cygwin/, /mswin/, /mingw/, /darwin/
+ when /cygwin/, /msys/, /mswin/, /mingw/, /darwin/
def self.ospath_encoding(path)
Encoding::UTF_8
end
diff -Naur ruby-2.6.0-orig/test/ruby/test_rubyoptions.rb ruby-2.6.0/test/ruby/test_rubyoptions.rb
--- ruby-2.6.0-orig/test/ruby/test_rubyoptions.rb 2018-10-26 06:10:02.000000000 +0300
+++ ruby-2.6.0/test/ruby/test_rubyoptions.rb 2018-12-26 09:14:02.509677900 +0300
@@ -910,7 +910,7 @@
assert_e_script_encoding(s, %W[-E#{locale.name}])
end
end
- when /cygwin/
+ when /cygwin|msys/
def test_command_line_non_ascii
assert_separately([{"LC_ALL"=>"ja_JP.SJIS"}, "-", "\u{3042}".encode("SJIS")], <<-"end;")
bug12184 = '[ruby-dev:49519] [Bug #12184]'
diff -Naur ruby-2.6.0-orig/test/rubygems/test_gem_platform.rb ruby-2.6.0/test/rubygems/test_gem_platform.rb
--- ruby-2.6.0-orig/test/rubygems/test_gem_platform.rb 2018-11-21 13:20:47.000000000 +0300
+++ ruby-2.6.0/test/rubygems/test_gem_platform.rb 2018-12-26 09:14:02.806078400 +0300
@@ -46,6 +46,7 @@
'universal-darwin9' => ['universal', 'darwin', '9'],
'universal-macruby' => ['universal', 'macruby', nil],
'i386-cygwin' => ['x86', 'cygwin', nil],
+ 'i386-msys' => ['x86', 'msys', nil],
'i686-darwin' => ['x86', 'darwin', nil],
'i686-darwin8.4.1' => ['x86', 'darwin', '8'],
'i386-freebsd4.11' => ['x86', 'freebsd', '4'],
@@ -76,6 +77,7 @@
'i386-solaris2.8' => ['x86', 'solaris', '2.8'],
'mswin32' => ['x86', 'mswin32', nil],
'x86_64-linux' => ['x86_64', 'linux', nil],
+ 'x86_64-msys' => ['x86_64', 'msys', nil],
'x86_64-openbsd3.9' => ['x86_64', 'openbsd', '3.9'],
'x86_64-openbsd4.0' => ['x86_64', 'openbsd', '4.0'],
'x86_64-openbsd' => ['x86_64', 'openbsd', nil],
diff -Naur ruby-2.6.0-orig/test/socket/test_addrinfo.rb ruby-2.6.0/test/socket/test_addrinfo.rb
--- ruby-2.6.0-orig/test/socket/test_addrinfo.rb 2018-01-23 18:31:22.000000000 +0300
+++ ruby-2.6.0/test/socket/test_addrinfo.rb 2018-12-26 09:14:02.837278500 +0300
@@ -8,7 +8,7 @@
require "test/unit"
class TestSocketAddrinfo < Test::Unit::TestCase
- HAS_UNIXSOCKET = defined?(UNIXSocket) && /cygwin/ !~ RUBY_PLATFORM
+ HAS_UNIXSOCKET = defined?(UNIXSocket) && /cygwin|msys/ !~ RUBY_PLATFORM
def tcp_unspecified_to_loopback(addrinfo)
if addrinfo.ipv4? && addrinfo.ip_address == "0.0.0.0"
diff -Naur ruby-2.6.0-orig/test/socket/test_unix.rb ruby-2.6.0/test/socket/test_unix.rb
--- ruby-2.6.0-orig/test/socket/test_unix.rb 2018-03-28 13:08:57.000000000 +0300
+++ ruby-2.6.0/test/socket/test_unix.rb 2018-12-26 09:14:02.915278600 +0300
@@ -708,4 +708,4 @@
assert_equal :wait_readable, serv.accept_nonblock(exception: false)
}
end
-end if defined?(UNIXSocket) && /cygwin/ !~ RUBY_PLATFORM
+end if defined?(UNIXSocket) && /cygwin|msys/ !~ RUBY_PLATFORM
diff -Naur ruby-2.6.0-orig/test/webrick/test_cgi.rb ruby-2.6.0/test/webrick/test_cgi.rb
--- ruby-2.6.0-orig/test/webrick/test_cgi.rb 2016-07-22 19:43:12.000000000 +0300
+++ ruby-2.6.0/test/webrick/test_cgi.rb 2018-12-26 09:14:02.946478700 +0300
@@ -26,7 +26,7 @@
end
},
}
- if RUBY_PLATFORM =~ /mswin|mingw|cygwin|bccwin32/
+ if RUBY_PLATFORM =~ /mswin|mingw|cygwin|msys|bccwin32/
config[:CGIPathEnv] = ENV['PATH'] # runtime dll may not be in system dir.
end
TestWEBrick.start_httpserver(config, log_tester){|server, addr, port, log|
@@ -43,7 +43,7 @@
http.request(req){|res| assert_equal("/path/info", res.body, log.call)}
req = Net::HTTP::Get.new("/webrick.cgi/%3F%3F%3F?foo=bar")
http.request(req){|res| assert_equal("/???", res.body, log.call)}
- unless RUBY_PLATFORM =~ /mswin|mingw|cygwin|bccwin32/
+ unless RUBY_PLATFORM =~ /mswin|mingw|cygwin|msys|bccwin32/
# Path info of res.body is passed via ENV.
# ENV[] returns different value on Windows depending on locale.
req = Net::HTTP::Get.new("/webrick.cgi/%A4%DB%A4%B2/%A4%DB%A4%B2")
diff -Naur ruby-2.6.0-orig/tool/config.guess ruby-2.6.0/tool/config.guess
--- ruby-2.6.0-orig/tool/config.guess 2018-12-25 09:20:53.000000000 +0300
+++ ruby-2.6.0/tool/config.guess 2018-12-26 09:21:26.254457400 +0300
@@ -883,6 +883,9 @@
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
+ amd64:MSYS*:*:* | x86_64:MSYS*:*:*)
+ echo x86_64-unknown-msys
+ exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
diff -Naur ruby-2.6.0-orig/tool/downloader.rb ruby-2.6.0/tool/downloader.rb
--- ruby-2.6.0-orig/tool/downloader.rb 2018-12-19 07:08:46.000000000 +0300
+++ ruby-2.6.0/tool/downloader.rb 2018-12-26 09:22:53.443010500 +0300
@@ -237,7 +237,7 @@
def self.link_cache(cache, file, name, verbose = false)
return false unless cache and cache.exist?
return true if cache.eql?(file)
- if /cygwin/ !~ RUBY_PLATFORM or /winsymlink:nativestrict/ =~ ENV['CYGWIN']
+ if /cygwin|msys/ !~ RUBY_PLATFORM or /winsymlink:nativestrict/ =~ ENV['CYGWIN']
begin
file.make_symlink(cache.relative_path_from(file.parent))
rescue SystemCallError
diff -Naur ruby-2.6.0-orig/tool/m4/ruby_mingw32.m4 ruby-2.6.0/tool/m4/ruby_mingw32.m4
--- ruby-2.6.0-orig/tool/m4/ruby_mingw32.m4 2018-09-04 11:39:14.000000000 +0300
+++ ruby-2.6.0/tool/m4/ruby_mingw32.m4 2018-12-26 09:22:11.104536200 +0300
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
AC_DEFUN([RUBY_MINGW32],
[AS_CASE(["$host_os"],
-[cygwin*], [
+[cygwin*|msys*], [
AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
[AC_TRY_CPP([
#ifndef __MINGW32__
diff -Naur ruby-2.6.0-orig/tool/m4/ruby_setjmp_type.m4 ruby-2.6.0/tool/m4/ruby_setjmp_type.m4
--- ruby-2.6.0-orig/tool/m4/ruby_setjmp_type.m4 2018-01-20 10:14:59.000000000 +0300
+++ ruby-2.6.0/tool/m4/ruby_setjmp_type.m4 2018-12-26 09:22:31.587372100 +0300
@@ -35,7 +35,7 @@
setjmp_prefix=_
setjmp_suffix=
], [test "$ac_cv_func_sigsetjmp" = yes], [
- AS_CASE([$target_os],[solaris*|cygwin*],[setjmp_prefix=],[setjmp_prefix=sig])
+ AS_CASE([$target_os],[solaris*|cygwin*|msys*],[setjmp_prefix=],[setjmp_prefix=sig])
setjmp_suffix=
], [
setjmp_prefix=
diff -Naur ruby-2.6.0-orig/win32/mkexports.rb ruby-2.6.0/win32/mkexports.rb
--- ruby-2.6.0-orig/win32/mkexports.rb 2018-07-29 03:09:08.000000000 +0300
+++ ruby-2.6.0/win32/mkexports.rb 2018-12-26 09:14:02.977678700 +0300
@@ -167,6 +167,30 @@
end
end
+class Exports::Msys < Exports
+ def self.nm
+ @@nm ||= RbConfig::CONFIG["NM"]
+ end
+
+ def exports(*)
+ super()
+ end
+
+ def each_line(objs, &block)
+ IO.foreach("|#{self.class.nm} --extern --defined #{objs.join(' ')}", &block)
+ end
+
+ def each_export(objs)
+ symprefix = RbConfig::CONFIG["SYMBOL_PREFIX"]
+ symprefix.strip! if symprefix
+ re = /\s(?:(T)|[[:upper:]])\s#{symprefix}((?!Init_|.*_threadptr_|DllMain\b).*)$/
+ objdump(objs) do |l|
+ next if /@.*@/ =~ l
+ yield $2, !$1 if re =~ l
+ end
+ end
+end
+
class Exports::Mingw < Exports::Cygwin
def each_export(objs)
super