Skip to content

Commit 8a80efd

Browse files
committed
Add ucrt64 build
ucrt currently requires patching of configure.ac and win32.c .
1 parent 36dd4b2 commit 8a80efd

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
diff --git a/configure.ac b/configure.ac
2+
index fa62b5fa85..a563115033 100644
3+
--- a/configure.ac
4+
+++ b/configure.ac
5+
@@ -443,10 +443,15 @@ AS_CASE(["$target_os"],
6+
[[FILE* volatile f = stdin; return 0;]])],
7+
[rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
8+
tr A-Z a-z |
9+
- sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`],
10+
+ sed -n '/^[[ ]]*dll name: \(msvc.*\)\.dll$/{s//\1/p;q;}'`
11+
+ test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=`$OBJDUMP -p conftest$ac_exeext |
12+
+ tr A-Z a-z |
13+
+ sed -n '/^[[ ]]*dll name: \(api-ms-win-crt.*\)\.dll$/{s//ucrt/p;q;}'`
14+
+ test "$rb_cv_msvcrt" = "ucrt" && RT_VER=140
15+
+ ],
16+
[rb_cv_msvcrt=msvcrt])
17+
test "$rb_cv_msvcrt" = "" && rb_cv_msvcrt=msvcrt])
18+
- RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]`
19+
+ test "$RT_VER" = "" && RT_VER=`echo "$rb_cv_msvcrt" | tr -cd [0-9]`
20+
test "$RT_VER" = "" && RT_VER=60
21+
AC_DEFINE_UNQUOTED(RUBY_MSVCRT_VERSION, $RT_VER)
22+
sysconfdir=
23+
diff --git a/win32/win32.c b/win32/win32.c
24+
index 940a85a4de..b7fcd666f1 100644
25+
--- a/win32/win32.c
26+
+++ b/win32/win32.c
27+
@@ -888,6 +888,12 @@ socklist_delete(SOCKET *sockp, int *flagp)
28+
}
29+
30+
static int w32_cmdvector(const WCHAR *, char ***, UINT, rb_encoding *);
31+
+
32+
+#if RUBY_MSVCRT_VERSION >= 80
33+
+#include <crtdbg.h>
34+
+static void set_pioinfo_extra(void);
35+
+#endif
36+
+
37+
//
38+
// Initialization stuff
39+
//
40+
@@ -896,11 +902,11 @@ void
41+
rb_w32_sysinit(int *argc, char ***argv)
42+
{
43+
#if RUBY_MSVCRT_VERSION >= 80
44+
- static void set_pioinfo_extra(void);
45+
-
46+
_CrtSetReportMode(_CRT_ASSERT, 0);
47+
_set_invalid_parameter_handler(invalid_parameter);
48+
+#if !defined(__MINGW32__)
49+
_RTC_SetErrorFunc(rtc_error_handler);
50+
+#endif
51+
set_pioinfo_extra();
52+
#endif
53+
SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOGPFAULTERRORBOX);

mingw-w64-ruby-head/PKGBUILD

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
_realname=ruby
22
pkgbase=mingw-w64-ruby-head
33
pkgname="${MINGW_PACKAGE_PREFIX}-ruby-head"
4-
pkgver=r20210301
4+
pkgver=r20210502
55
pkgver() {
66
echo r`date +%Y%m%d`
77
}
88
pkgrel=1
99
pkgdesc="An object-oriented language for quick and easy programming (mingw-w64)"
1010
arch=('any')
11+
mingw_arch=('mingw32' 'mingw64' 'ucrt64')
1112
url="https://www.ruby-lang.org/en"
1213
license=("BSD, custom")
1314
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
@@ -20,6 +21,7 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
2021
"${MINGW_PACKAGE_PREFIX}-zlib")
2122
options=('staticlibs' 'strip')
2223
source=("https://cache.ruby-lang.org/pub/ruby/snapshot/snapshot-master.tar.xz"
24+
0001-ucrt-v2.patch
2325
ruby.ico
2426
rubyw.ico)
2527
noextract=("snapshot-master.tar.xz")
@@ -28,12 +30,14 @@ noextract=("snapshot-master.tar.xz")
2830
# and set first entry to 'SKIP'
2931

3032
sha256sums=('SKIP'
33+
'654c4db8cd554db34616148cf92fd9e60c429d68925b22aa1ec0ab0e1d58722b'
3134
'6c80ba2ca49840e387a08b7fedc6e7acd298ac2ec853155209efb2af20397b22'
3235
'c30fb04ac0e88ba634daaa811a81ea5a75027646617b895acd14df9518a4a55a')
3336

3437
prepare() {
3538
bsdtar -xf snapshot-master.tar.xz || true
3639
cd ${srcdir}/snapshot-master
40+
patch -p1 -i ${srcdir}/0001-ucrt-v2.patch
3741

3842
autoreconf -fi
3943
}

0 commit comments

Comments
 (0)