@@ -47,6 +47,7 @@ set MZSCHEME_VER=%RACKET_VER%
4747set RUBY_VER = 24
4848set RUBY_API_VER_LONG = 2.4.0
4949set RUBY_BRANCH = ruby_2_4
50+ set RUBY_URL = https://github.com/ruby/ruby/archive/%RUBY_BRANCH% .zip
5051set RUBY32_DIR = C:\Ruby%RUBY_VER%
5152set RUBY64_DIR = C:\Ruby%RUBY_VER% -x64
5253set RUBY_DIR = !RUBY%BIT%_DIR!
@@ -120,11 +121,16 @@ copy %TCL_DIR%\bin\%TCL_DLL% vim\src\
120121:: Ruby
121122:: RubyInstaller is built by MinGW, so we cannot use header files from it.
122123:: Download the source files and generate config.h for MSVC.
123- git clone https://github.com/ruby/ruby.git -b %RUBY_BRANCH% --depth 1 -q ../ruby
124+ rem git clone https://github.com/ruby/ruby.git -b %RUBY_BRANCH% --depth 1 -q ../ruby
125+ call :downloadfile %RUBY_URL% downloads\ruby.zip
126+ :: Extract the files only we needed to reduce the building time.
127+ :: We need to use `^^` to escape `!` because we enable delayed expansion.
128+ 7z x downloads\ruby.zip */bin */enc/Makefile.in */win32 */common.mk -ir^^! version.h -xr^^! README.* -xr^^! */win32/*.c -xr^^! */win32/*.h -o.. > nul || exit 1
129+ move ..\ruby-%RUBY_BRANCH% ..\ruby > nul || exit 1
124130pushd ..\ruby
125131call win32\configure.bat
126132echo on
127- nmake .config.h.time
133+ nmake .config.h.time || exit 1
128134xcopy /s .ext\include %RUBY_DIR% \include\ruby-%RUBY_API_VER_LONG%
129135popd
130136
@@ -134,13 +140,13 @@ start /wait downloads\racket.exe /S
134140
135141:: Install libintl.dll and iconv.dll
136142call :downloadfile %GETTEXT32_URL% downloads\gettext32.zip
137- 7z e -y downloads\gettext32.zip -oc:\gettext32
143+ 7z e -y downloads\gettext32.zip -oc:\gettext32 > nul || exit 1
138144call :downloadfile %GETTEXT64_URL% downloads\gettext64.zip
139- 7z e -y downloads\gettext64.zip -oc:\gettext64
145+ 7z e -y downloads\gettext64.zip -oc:\gettext64 > nul || exit 1
140146
141147:: Install winpty
142148call :downloadfile %WINPTY_URL% downloads\winpty.zip
143- 7z x -y downloads\winpty.zip -oc:\winpty
149+ 7z x -y downloads\winpty.zip -oc:\winpty > nul || exit 1
144150if /i " %ARCH% " == " x64" (
145151 copy /Y c:\winpty\x64_xp\bin\winpty.dll vim\src\winpty64.dll
146152 copy /Y c:\winpty\x64_xp\bin\winpty-agent.exe vim\src\
@@ -309,4 +315,4 @@ goto :eof
309315if not exist %2 (
310316 curl -f -L %1 -o %2 || exit 1
311317)
312- goto :eof
318+ @ goto :eof
0 commit comments