diff --git a/mingw-w64-ruby/0006-autoconf-set-msvcrt-ver-for-ucrt.patch b/mingw-w64-ruby/0006-autoconf-set-msvcrt-ver-for-ucrt.patch new file mode 100644 index 0000000000..0c2fac11b0 --- /dev/null +++ b/mingw-w64-ruby/0006-autoconf-set-msvcrt-ver-for-ucrt.patch @@ -0,0 +1,35 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -407,7 +407,7 @@ + [rb_cv_msvcrt=msvcrt]) + test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt]) + RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]` +- test "$RT_VER" = "" && RT_VER=60 ++ test "$RT_VER" = "" && RT_VER=140 + AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER) + sysconfdir= + ]) +--- a/win32/win32.c ++++ b/win32/win32.c +@@ -854,11 +854,9 @@ + rb_w32_sysinit(int *argc, char ***argv) + { + #if RUBY_MSVCRT_VERSION >= 80 +- static void set_pioinfo_extra(void); ++ void set_pioinfo_extra(void); + +- _CrtSetReportMode(_CRT_ASSERT, 0); + _set_invalid_parameter_handler(invalid_parameter); +- _RTC_SetErrorFunc(rtc_error_handler); + set_pioinfo_extra(); + #endif + SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOGPFAULTERRORBOX); +@@ -2506,7 +2504,7 @@ + static size_t pioinfo_extra = 0; /* workaround for VC++8 SP1 */ + + /* License: Ruby's */ +-static void ++ void + set_pioinfo_extra(void) + { + #if RUBY_MSVCRT_VERSION >= 140 diff --git a/mingw-w64-ruby/PKGBUILD b/mingw-w64-ruby/PKGBUILD index 49242250aa..22a9f391e8 100644 --- a/mingw-w64-ruby/PKGBUILD +++ b/mingw-w64-ruby/PKGBUILD @@ -10,7 +10,7 @@ _realname=ruby pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=3.0.1 -pkgrel=1 +pkgrel=2 pkgdesc="An object-oriented language for quick and easy programming (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64') @@ -32,7 +32,8 @@ source=("https://cache.ruby-lang.org/pub/ruby/${pkgver%.*}/${_realname}-${pkgver 0001-mingw-w64-time-functions.patch 0003-fix-check-types.patch 0004-rbinstall-destdir.patch - 0005-rbinstall-rake-bash.patch) + 0005-rbinstall-rake-bash.patch + 0006-autoconf-set-msvcrt-ver-for-ucrt.patch) ## Populated by the updpkgprovs script provides=( "${MINGW_PACKAGE_PREFIX}-ruby-did_you_mean=1.3.0" @@ -86,7 +87,8 @@ sha256sums=('369825db2199f6aeef16b408df6a04ebaddb664fb9af0ec8c686b0ce7ab77727' '329994d3bf7e692e18c1faffbedfbd076e5d00257b2100387a773b59b81ccd4e' 'cbb083aece8e284fb1ae625e689f044a608aa9750bba9f7d399e895547eee39b' '02382ec3b9e42d7dbb58edad3e41c361d98871711bb2f0320082c2acc6a82e2e' - '9fb5acb995255eedde0f0b0bf5cf2c02f00dc088d2538ff9ebb69627aafd1e42') + '9fb5acb995255eedde0f0b0bf5cf2c02f00dc088d2538ff9ebb69627aafd1e42' + '0af38d2c4e2cd2cd7ec20ed19ed9b2641946a6c9f0289160340e92eef4c70c26') noextract=(${_realname}-${pkgver}.tar.gz) apply_patch_with_msg() { @@ -119,6 +121,13 @@ prepare() { 0003-fix-check-types.patch \ 0005-rbinstall-rake-bash.patch # patch -p1 -i ${srcdir}/0004-rbinstall-destdir.patch + + # Set msvcrt version to 140 which brings hidden ucrt I/O structs + if [[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]] || \ + [[ ${MINGW_PACKAGE_PREFIX} == *-ucrt-* ]]; then + patch -Nbp1 -i "${srcdir}/0006-autoconf-set-msvcrt-ver-for-ucrt.patch" + fi + autoreconf -fi }