/
appveyor.bat
285 lines (258 loc) · 11.3 KB
/
appveyor.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
@echo off
:: Batch file for building/testing Vim on AppVeyor
if /i "%ARCH%.%appveyor_repo_tag%"=="x86.false" (
echo Skip this build.
exit 0
)
if /I "%1"=="" (
set target=build
) else (
set target=%1
)
goto %target%_%ARCH%
echo Unknown build target.
exit 1
:install_x86
:: ----------------------------------------------------------------------
@echo on
:: Work around for Python 2.7.11
reg copy HKLM\SOFTWARE\Python\PythonCore\2.7 HKLM\SOFTWARE\Python\PythonCore\2.7-32 /s /reg:32
:: Lua
:: Appveyor command doesn't seem to work well when downloading from sf.net.
curl -f -L "http://downloads.sourceforge.net/project/luabinaries/5.3.2/Windows%%20Libraries/Dynamic/lua-5.3.2_Win32_dllw4_lib.zip" -o lua.zip
7z x lua.zip -oC:\Lua > nul
:: Perl
appveyor DownloadFile http://downloads.activestate.com/ActivePerl/releases/5.22.0.2200/ActivePerl-5.22.0.2200-MSWin32-x86-64int-299195.zip -FileName perl.zip
7z x perl.zip -oC:\ > nul
for /d %%i in (C:\ActivePerl*) do move %%i C:\Perl522
:: Tcl
appveyor DownloadFile http://downloads.activestate.com/ActiveTcl/releases/8.6.4.1/ActiveTcl8.6.4.1.299124-win32-ix86-threaded.exe -FileName tcl.exe
start /wait tcl.exe --directory C:\Tcl
:: Ruby
:: RubyInstaller is built by MinGW, so we cannot use header files from it.
:: Download the source files and generate config.h for MSVC.
git clone https://github.com/ruby/ruby.git -b ruby_2_2 --depth 1 -q ../ruby
pushd ..\ruby
call win32\configure.bat
echo on
nmake .config.h.time
xcopy /s .ext\include C:\Ruby22\include\ruby-2.2.0
popd
:: Racket
:: Need a patch to install gvim with dynamic racket
:: Patch from Yukihiro Nakadaira https://groups.google.com/d/msg/vim_dev/qg7R7HeGq50/u96qEzQeBgAJ
curl -f -L "https://groups.google.com/group/vim_dev/attach/61e3413aadebb/if_mzscheme6.diff?part=0.1&authuser=0" -o fix_mzscheme.diff
git apply --check fix_mzscheme.diff && git apply fix_mzscheme.diff || exit 1
curl -f -L https://mirror.racket-lang.org/releases/6.3/installers/racket-minimal-6.3-i386-win32.exe -o racket.exe
start /wait racket.exe /S
if /i "%appveyor_repo_tag%"=="true" (
:: Install binary diff.exe and libintl.dll and iconv.dll
curl -f -L -O ftp://ftp.vim.org/pub/vim/pc/gvim74.exe
7z e gvim74.exe $0\diff.exe -o..
curl -f -L "https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.19.6-v1.14/gettext0.19.6-iconv1.14-shared-32.exe" -o gettext.exe
start /wait gettext.exe /verysilent /dir=c:\gettext
copy c:\gettext\libintl-8.dll c:\gettext\libintl.dll
:: Install NSIS and UPX
curl -f -L -O http://downloads.sourceforge.net/project/nsis/NSIS%%202/2.50/nsis-2.50.zip
7z x nsis-2.50.zip -oc:\ > nul
curl -f -L http://upx.sourceforge.net/download/upx391w.zip -o upx.zip
7z e upx.zip *\upx.exe -onsis > nul
)
:: Update PATH
path C:\Perl522\perl\bin;%path%;C:\Lua;C:\Tcl\bin;C:\Ruby22\bin;C:\Program Files (x86)\Racket;C:\Program Files (x86)\Racket\lib
:: Install additional packages for Racket
raco pkg install --auto r5rs-lib
@echo off
goto :eof
:install_x64
:: ----------------------------------------------------------------------
@echo on
:: Work around for Python 2.7.11
reg copy HKLM\SOFTWARE\Python\PythonCore\2.7 HKLM\SOFTWARE\Python\PythonCore\2.7-32 /s /reg:64
:: Lua
:: Appveyor command doesn't seem to work well when downloading from sf.net.
curl -f -L "http://downloads.sourceforge.net/project/luabinaries/5.3.2/Windows%%20Libraries/Dynamic/lua-5.3.2_Win64_dllw4_lib.zip" -o lua.zip
7z x lua.zip -oC:\Lua > nul
:: Perl
appveyor DownloadFile http://downloads.activestate.com/ActivePerl/releases/5.22.0.2200/ActivePerl-5.22.0.2200-MSWin32-x64-299195.zip -FileName perl.zip
7z x perl.zip -oC:\ > nul
for /d %%i in (C:\ActivePerl*) do move %%i C:\Perl522
:: Tcl
appveyor DownloadFile http://downloads.activestate.com/ActiveTcl/releases/8.6.4.1/ActiveTcl8.6.4.1.299124-win32-x86_64-threaded.exe -FileName tcl.exe
start /wait tcl.exe --directory C:\Tcl
:: Ruby
:: RubyInstaller is built by MinGW, so we cannot use header files from it.
:: Download the source files and generate config.h for MSVC.
git clone https://github.com/ruby/ruby.git -b ruby_2_2 --depth 1 -q ../ruby
pushd ..\ruby
call win32\configure.bat
echo on
nmake .config.h.time
xcopy /s .ext\include C:\Ruby22-x64\include\ruby-2.2.0
popd
:: Racket
:: Need a patch to install gvim with dynamic racket
:: Patch from Yukihiro Nakadaira https://groups.google.com/d/msg/vim_dev/qg7R7HeGq50/u96qEzQeBgAJ
curl -f -L "https://groups.google.com/group/vim_dev/attach/61e3413aadebb/if_mzscheme6.diff?part=0.1&authuser=0" -o fix_mzscheme.diff
git apply --check fix_mzscheme.diff && git apply fix_mzscheme.diff || exit 1
curl -f -L https://mirror.racket-lang.org/releases/6.3/installers/racket-minimal-6.3-x86_64-win32.exe -o racket.exe
start /wait racket.exe /S
if /i "%appveyor_repo_tag%"=="true" (
:: Install binary diff.exe and libintl.dll and iconv.dll
curl -f -L -O ftp://ftp.vim.org/pub/vim/pc/gvim74.exe
7z e gvim74.exe $0\diff.exe -o..
curl -f -L "https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.19.6-v1.14/gettext0.19.6-iconv1.14-shared-64.exe" -o gettext.exe
start /wait gettext.exe /verysilent /dir=c:\gettext
copy c:\gettext\libintl-8.dll c:\gettext\libintl.dll
:: libwinpthread is needed on Win64 for localizing messages
::copy c:\gettext\libwinpthread-1.dll ..\runtime
:: Install NSIS and UPX
curl -f -L -O http://downloads.sourceforge.net/project/nsis/NSIS%%202/2.50/nsis-2.50.zip
7z x nsis-2.50.zip -oc:\ > nul
curl -f -L http://upx.sourceforge.net/download/upx391w.zip -o upx.zip
7z e upx.zip *\upx.exe -onsis > nul
)
:: Update PATH
path C:\Perl522\perl\bin;%path%;C:\Lua;C:\Tcl\bin;C:\Ruby22-x64\bin;C:\Program Files\Racket;C:\Program Files\Racket\lib
:: Install additional packages for Racket
raco pkg install --auto r5rs-lib
@echo off
goto :eof
:build_x86
:: ----------------------------------------------------------------------
@echo on
:: Remove progress bar from the build log
sed -e "s/\$(LINKARGS2)/\$(LINKARGS2) | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak
:: Build GUI version
nmake -f Make_mvc2.mak CPU=i386 ^
GUI=yes OLE=yes DIRECTX=yes ^
FEATURES=HUGE IME=yes MBYTE=yes ICONV=yes DEBUG=no ^
PERL_VER=522 DYNAMIC_PERL=yes PERL=C:\Perl522\perl ^
PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27 ^
PYTHON3_VER=34 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python34 ^
LUA_VER=53 DYNAMIC_LUA=yes LUA=C:\Lua ^
TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes TCL=C:\Tcl ^
RUBY=C:\Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0 ^
RUBY_MSVCRT_NAME=msvcrt ^
"MZSCHEME=C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes MZSCHEME_VER=3m_9z0ds0 ^
WINVER=0x500 ^
|| exit 1
@if /i "%appveyor_repo_tag%"=="false" goto check_executable
:: Build CUI version
nmake -f Make_mvc2.mak CPU=i386 ^
GUI=no OLE=no DIRECTX=no ^
FEATURES=HUGE IME=yes MBYTE=yes ICONV=yes DEBUG=no ^
PERL_VER=522 DYNAMIC_PERL=yes PERL=C:\Perl522\perl ^
PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27 ^
PYTHON3_VER=34 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python34 ^
LUA_VER=53 DYNAMIC_LUA=yes LUA=C:\Lua ^
TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes TCL=C:\Tcl ^
RUBY=C:\Ruby22 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0 ^
RUBY_MSVCRT_NAME=msvcrt ^
"MZSCHEME=C:\Program Files (x86)\Racket" DYNAMIC_MZSCHEME=yes MZSCHEME_VER=3m_9z0ds0 ^
WINVER=0x500 ^
|| exit 1
:: Build translations
pushd po
nmake -f Make_mvc.mak GETTEXT_PATH=C:\cygwin\bin VIMRUNTIME=..\..\runtime install-all || exit 1
popd
goto check_executable
@echo off
goto :eof
:build_x64
:: ----------------------------------------------------------------------
@echo on
:: Remove progress bar from the build log
sed -e "s/\$(LINKARGS2)/\$(LINKARGS2) | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak
:: Build GUI version
nmake -f Make_mvc2.mak CPU=AMD64 ^
GUI=yes OLE=yes DIRECTX=yes ^
FEATURES=HUGE IME=yes MBYTE=yes ICONV=yes DEBUG=no ^
PERL_VER=522 DYNAMIC_PERL=yes PERL=C:\Perl522\perl ^
PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^
PYTHON3_VER=34 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python34-x64 ^
LUA_VER=53 DYNAMIC_LUA=yes LUA=C:\Lua ^
TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes TCL=C:\Tcl ^
RUBY=C:\Ruby22-x64 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0 ^
RUBY_MSVCRT_NAME=msvcrt ^
"MZSCHEME=C:\Program Files\Racket" DYNAMIC_MZSCHEME=yes MZSCHEME_VER=3m_9z0ds0 ^
WINVER=0x500 ^
|| exit 1
@if /i "%appveyor_repo_tag%"=="false" goto check_executable
:: Build CUI version
nmake -f Make_mvc2.mak CPU=AMD64 ^
GUI=no OLE=no DIRECTX=no ^
FEATURES=HUGE IME=yes MBYTE=yes ICONV=yes DEBUG=no ^
PERL_VER=522 DYNAMIC_PERL=yes PERL=C:\Perl522\perl ^
PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^
PYTHON3_VER=34 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python34-x64 ^
LUA_VER=53 DYNAMIC_LUA=yes LUA=C:\Lua ^
TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes TCL=C:\Tcl ^
RUBY=C:\Ruby22-x64 DYNAMIC_RUBY=yes RUBY_VER=22 RUBY_VER_LONG=2.2.0 ^
RUBY_MSVCRT_NAME=msvcrt ^
"MZSCHEME=C:\Program Files\Racket" DYNAMIC_MZSCHEME=yes MZSCHEME_VER=3m_9z0ds0 ^
WINVER=0x500 ^
|| exit 1
:: Build translations
pushd po
nmake -f Make_mvc.mak GETTEXT_PATH=C:\cygwin\bin VIMRUNTIME=..\..\runtime install-all || exit 1
popd
goto check_executable
:check_executable
:: ----------------------------------------------------------------------
.\gvim -silent -register
.\gvim -u NONE -c "redir @a | ver | 0put a | wq!" ver.txt
type ver.txt
if /i "%appveyor_repo_tag%"=="true" (
.\vim --version
)
@echo off
goto :eof
:package_x86
:package_x64
:: ----------------------------------------------------------------------
if /i "%appveyor_repo_tag%"=="false" goto :eof
@echo on
:: Build both 64- and 32-bit versions of gvimext.dll for the installer
start /wait cmd /c "setenv /x64 && cd GvimExt && nmake clean all"
move GvimExt\gvimext.dll GvimExt\gvimext64.dll
start /wait cmd /c "setenv /x86 && cd GvimExt && nmake clean all"
:: Create zip packages
copy /Y ..\README.txt ..\runtime
copy /Y ..\vimtutor.bat ..\runtime
copy /Y *.exe ..\runtime\
copy /Y xxd\*.exe ..\runtime
mkdir ..\runtime\GvimExt
copy /Y GvimExt\gvimext*.dll ..\runtime\GvimExt\
copy /Y GvimExt\README.txt ..\runtime\GvimExt\
copy /Y GvimExt\*.inf ..\runtime\GvimExt\
copy /Y GvimExt\*.reg ..\runtime\GvimExt\
copy /Y c:\projects\diff.exe ..\runtime\
copy /Y c:\gettext\libiconv*.dll ..\runtime\
copy /Y c:\gettext\libintl.dll ..\runtime\
:: libwinpthread is needed on Win64 for localizing messages
if exist c:\gettext\libwinpthread-1.dll copy /Y c:\gettext\libwinpthread-1.dll ..\runtime\
7z a ..\gvim_%ARCH%.zip ..\runtime\*
:: Create x86 installer
if /i "%ARCH%"=="x64" goto :eof
c:\cygwin\bin\bash -lc "cd /cygdrive/c/projects/vim/runtime/doc && touch ../../src/auto/config.mk && make uganda.nsis.txt"
copy gvim.exe gvim_ole.exe
copy vim.exe vimw32.exe
copy xxd\xxd.exe xxdw32.exe
copy install.exe installw32.exe
copy uninstal.exe uninstalw32.exe
pushd ..\nsis && c:\nsis-2.50\makensis /DVIMRT=..\runtime gvim.nsi "/XOutFile ..\gvim_%ARCH%.exe" && popd
@echo off
goto :eof
:test_x86
:test_x64
:: ----------------------------------------------------------------------
@echo on
cd testdir
nmake -f Make_dos.mak VIMPROG=..\gvim || exit 1
if /i "%appveyor_repo_tag%"=="true" (
nmake -f Make_dos.mak clean
nmake -f Make_dos.mak VIMPROG=..\vim || exit 1
)
@echo off
goto :eof