-
Notifications
You must be signed in to change notification settings - Fork 242
/
Copy pathappveyor.bat
executable file
·562 lines (457 loc) · 19.4 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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
@echo off
:: Batch file for building/testing Vim on AppVeyor
SetLocal
cd %APPVEYOR_BUILD_FOLDER%
if not defined APPVEYOR_REPO_TAG_NAME (
for /F %%I in ('git describe --tags --abbrev^=0') do set "TAG_NAME=%%I"
) else (
set "TAG_NAME=%APPVEYOR_REPO_TAG_NAME%"
)
:: Strip the first "v" from the tag name.
set "VER_NUM=%TAG_NAME:~1%"
:: Split the version into each component.
for /F "delims=.-+ tokens=1-3" %%I in ("%VER_NUM%") do (
set "MAJOR=%%I"
set "MINOR=%%J"
set "PATCHLEVEL=%%K"
)
if /I "%ARCH%"=="x64" (
set "BIT=64"
) else (
set "BIT=32"
)
set "DEPENDENCIES=%APPVEYOR_BUILD_FOLDER%\dependencies"
:: -------- setting variables ----------------------------------------------
:: Download URLs, local dirs and versions
@rem Lua
set "LUA_VER=54"
set "LUA_RELEASE=5.4.2"
set "LUA_URL=https://downloads.sourceforge.net/luabinaries/lua-%LUA_RELEASE%_Win%BIT%_dllw6_lib.zip"
set "LUA_DIR=%DEPENDENCIES%\Lua%LUA_VER%-%ARCH%"
@rem Perl
set "PERL_VER=532"
set "PERL_RELEASE=5.32.1.1"
set "PERL_URL=https://strawberryperl.com/download/%PERL_RELEASE%/strawberry-perl-%PERL_RELEASE%-%BIT%bit-portable.zip"
set "PERL_DIR=%DEPENDENCIES%\perl%PERL_VER%-%ARCH%"
@rem Python2
set "PYTHON_VER=27"
set "PYTHON_RELEASE=2.7.18"
@rem To test on a local machine if Python 2.7 is not installed
rem set "PYTHON_32_URL=https://www.python.org/ftp/python/%PYTHON_RELEASE%/python-%PYTHON_RELEASE%.msi"
rem set "PYTHON_64_URL=https://www.python.org/ftp/python/%PYTHON_RELEASE%/python-%PYTHON_RELEASE%.amd64.msi"
set "PYTHON_32_DIR=C:\python%PYTHON_VER%"
set "PYTHON_64_DIR=C:\python%PYTHON_VER%-x64"
SetLocal EnableDelayedExpansion
rem set "PYTHON_URL=!PYTHON_%BIT%_URL!"
set "PYTHON_DIR=!PYTHON_%BIT%_DIR!"
EndLocal & (
rem set "PYTHON_URL=%PYTHON_URL%"
set "PYTHON_DIR=%PYTHON_DIR%"
)
@rem Python3
set "PYTHON3_VER=312"
set "PYTHON3_RELEASE=3.12.0"
set "PY3CORE_32_URL=https://www.python.org/ftp/python/%PYTHON3_RELEASE%/win32/core.msi"
set "PY3DEV_32_URL=https://www.python.org/ftp/python/%PYTHON3_RELEASE%/win32/dev.msi"
set "PY3EXE_32_URL=https://www.python.org/ftp/python/%PYTHON3_RELEASE%/win32/exe.msi"
set "PY3LIB_32_URL=https://www.python.org/ftp/python/%PYTHON3_RELEASE%/win32/lib.msi"
set "PY3CORE_64_URL=https://www.python.org/ftp/python/%PYTHON3_RELEASE%/amd64/core.msi"
set "PY3DEV_64_URL=https://www.python.org/ftp/python/%PYTHON3_RELEASE%/amd64/dev.msi"
set "PY3EXE_64_URL=https://www.python.org/ftp/python/%PYTHON3_RELEASE%/amd64/exe.msi"
set "PY3LIB_64_URL=https://www.python.org/ftp/python/%PYTHON3_RELEASE%/amd64/lib.msi"
set "PYTHON3_32_DIR=C:\python%PYTHON3_VER%"
set "PYTHON3_64_DIR=C:\python%PYTHON3_VER%-x64"
SetLocal EnableDelayedExpansion
set "PY3CORE_URL=!PY3CORE_%BIT%_URL!"
set "PY3DEV_URL=!PY3DEV_%BIT%_URL!"
set "PY3EXE_URL=!PY3EXE_%BIT%_URL!"
set "PY3LIB_URL=!PY3LIB_%BIT%_URL!"
set "PYTHON3_DIR=!PYTHON3_%BIT%_DIR!"
EndLocal & (
set "PY3CORE_URL=%PY3CORE_URL%"
set "PY3DEV_URL=%PY3DEV_URL%"
set "PY3EXE_URL=%PY3EXE_URL%"
set "PY3LIB_URL=%PY3LIB_URL%"
set "PYTHON3_DIR=%PYTHON3_DIR%"
)
@rem Racket
set "RACKET_VER=3m_dcgt6o"
set "RACKET_RELEASE=8.7"
set "RACKET_32_URL=https://users.cs.utah.edu/plt/installers/%RACKET_RELEASE%/racket-minimal-%RACKET_RELEASE%-i386-win32-bc.tgz"
set "RACKET_64_URL=https://users.cs.utah.edu/plt/installers/%RACKET_RELEASE%/racket-minimal-%RACKET_RELEASE%-x86_64-win32-bc.tgz"
SetLocal EnableDelayedExpansion
set "RACKET_URL=!RACKET_%BIT%_URL!"
EndLocal & set "RACKET_URL=%RACKET_URL%"
set "RACKET_DIR=%DEPENDENCIES%\racket%RACKET_VER%-%ARCH%"
set "MZSCHEME_VER=%RACKET_VER%"
@rem Ruby
set "RUBY_VER=32"
set "RUBY_API_VER_LONG=3.2.0"
set "RUBY_BRANCH=ruby_3_2"
set "RUBY_RELEASE=3.2.2-1"
set "RUBY_SRC_URL=https://github.com/ruby/ruby/archive/%RUBY_BRANCH%.zip"
set "RUBY_URL=https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-%RUBY_RELEASE%/rubyinstaller-%RUBY_RELEASE%-%ARCH%.7z"
set "RUBY_DIR=%DEPENDENCIES%\Ruby%RUBY_VER%-%ARCH%"
@rem Tcl
set "TCL_VER_LONG=8.6"
set "TCL_VER=%TCL_VER_LONG:.=%"
@rem See the “:install” section
rem set "TCL_32_URL=https://sourceforge.net/projects/magicsplat/files/barebones-tcl/tcltk-%TCL_VER_LONG%.10-barebones-x86.zip/download"
rem set "TCL_64_URL=https://sourceforge.net/projects/magicsplat/files/barebones-tcl/tcltk-%TCL_VER_LONG%.10-barebones-x64.zip/download"
rem SetLocal EnableDelayedExpansion
rem set "TCL_URL=!TCL_%BIT%_URL!"
rem EndLocal & set "TCL_URL=%TCL_URL%"
set "TCL_DIR=%DEPENDENCIES%\Tcl%TCL_VER%-%ARCH%"
set "TCL_DLL=tcl%TCL_VER%t.dll"
set "TCL_LIBRARY=%TCL_DIR%\lib\tcl%TCL_VER_LONG%"
@rem Gettext
set "GETTEXT_32_URL=https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.23-v1.17/gettext0.23-iconv1.17-shared-32.zip"
set "GETTEXT_64_URL=https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.23-v1.17/gettext0.23-iconv1.17-shared-64.zip"
@rem winpty
set "WINPTY_URL=https://github.com/rprichard/winpty/releases/download/0.4.3/winpty-0.4.3-msvc2015.zip"
set "WINPTY_DIR=%DEPENDENCIES%\winpty"
@rem UPX
@rem set "UPX_URL=https://github.com/upx/upx/releases/download/v3.94/upx394w.zip"
@rem ShellExecAsUser
set "SHELLEXECASUSER_URL=https://nsis.sourceforge.io/mediawiki/images/1/1d/ShellExecAsUserUnicodeUpdate.zip"
@rem Libsodium
set "LIBSODIUM_URL=https://github.com/jedisct1/libsodium/releases/download/1.0.20-RELEASE/libsodium-1.0.20-msvc.zip"
set "SODIUM_DIR=%DEPENDENCIES%\libsodium"
@rem Cygwin
set "CYGWIN_URL=https://cygwin.com/setup-x86_64.exe"
set "CYGWIN_DIR=c:\cygwin64"
:: ----------------------------------------------------------------------
@rem Update PATH
path %PYTHON_DIR%;%PYTHON3_DIR%;%PERL_DIR%\bin;%LUA_DIR%;%RUBY_DIR%\bin;^
%RUBY_DIR%\bin\ruby_builtin_dlls;%RACKET_DIR%;%RACKET_DIR%\lib;%TCL_DIR%;^
%TCL_LIBRARY%;%Path%
if /I "%1"=="" (
set "target=build"
) else (
set "target=%1"
)
goto %target%_%ARCH%
echo:Unknown build target.
exit 1
:install_x86
:install_x64
:: ----------- installing dependencies ------------------------------------------
echo TAG_NAME: %TAG_NAME%
@echo on
@rem Get Vim source code
git submodule update --init --depth 20
git submodule update --remote
@rem Apply experimental patches
pushd vim
for %%I in (..\patch\*.patch) do git apply -v %%I
popd
if not exist downloads mkdir downloads
if not exist dependencies mkdir dependencies
goto :skipcygwin
@rem It's not necessary right now
@rem Update cygwin and add dependencies
rem if not exist %CYGWIN_DIR% mkdir %CYGWIN_DIR%
rem call :downloadfile %CYGWIN_URL% %CYGWIN_DIR%\setup-x86_64.exe
rem %CYGWIN_DIR%\setup-x86_64.exe -qnNdO -P jq,make,gettext-devel
@rem Initialise the new bash profile, just in case it is a new install.
rem %CYGWIN_DIR%\bin\bash -lc true > nul
:skipcygwin
@rem Lua
call :downloadfile "%LUA_URL%" downloads\lua-%BIT%.zip
7z.exe x -y downloads\lua-%BIT%.zip -o%LUA_DIR%\ > nul || exit 1
@rem Perl
call :downloadfile "%PERL_URL%" downloads\perl-%BIT%.zip
@rem Extract only the "perl" folder.
7z.exe x -y downloads\perl-%BIT%.zip perl -o%DEPENDENCIES%\ > nul || exit 1
move /Y %DEPENDENCIES%\perl %PERL_DIR%
goto :skiptcl
@rem Tcl
@rem In VS2019 and VS2022 32-bit builds normally.
@rem In VS2022 64-bit one generates an error:
@rem "fatal error C1047: The object or library file
@rem 'C:\VimInstaller\dependencies\Tcl86-x64\lib\tclstub86.lib' was created by
@rem a different version of the compiler..."
@rem It's necessary to figure out what to do about it.
@rem It's possible, for example, to remove the “/GL” switch when building the
@rem 64-bit one.
@rem In general, it must be solved somehow.
rem call :downloadfile "%TCL_URL%" downloads\tcl-%BIT%.zip
rem 7z.exe x downloads\tcl-%BIT%.zip -o%DEPENDENCIES%\ > nul || exit 1
rem move /Y %DEPENDENCIES%\tcltk-%TCL_VER_LONG%.10-barebones-%ARCH% %TCL_DIR%
rem mklink /H vim\src\%TCL_DLL% %TCL_DIR%\bin\%TCL_DLL%
:skiptcl
goto :skippython2
@rem Python2
@rem To test on a local machine if Python 2.7 is not installed
rem call :downloadfile "%PYTHON_URL%" downloads\python-%BIT%.msi
rem start "" /W downloads\python-%BIT%.msi ^
rem /qn TARGETDIR=%PYTHON_DIR% ADDLOCAL=DefaultFeature,PrependPath
:skippython2
@rem Python3
call :downloadfile "%PY3CORE_URL%" downloads\python3core-%BIT%.msi
call :downloadfile "%PY3EXE_URL%" downloads\python3exe-%BIT%.msi
call :downloadfile "%PY3LIB_URL%" downloads\python3lib-%BIT%.msi
call :downloadfile "%PY3DEV_URL%" downloads\python3dev-%BIT%.msi
start "" /W downloads\python3core-%BIT%.msi /qn TARGETDIR=%PYTHON3_DIR%
start "" /W downloads\python3exe-%BIT%.msi /qn TARGETDIR=%PYTHON3_DIR%
start "" /W downloads\python3lib-%BIT%.msi /qn TARGETDIR=%PYTHON3_DIR%
start "" /W downloads\python3dev-%BIT%.msi /qn TARGETDIR=%PYTHON3_DIR%
@rem Ruby
@rem Download RubyInstaller binary
call :downloadfile "%RUBY_URL%" downloads\ruby-%BIT%.7z
7z.exe x -y downloads\ruby-%BIT%.7z -o%DEPENDENCIES%\ > nul || exit 1
move %DEPENDENCIES%\rubyinstaller-%RUBY_RELEASE%-%ARCH% %RUBY_DIR% > nul || exit 1
@rem RubyInstaller is built by MinGW, so we cannot use header files from it.
@rem Download the source files and generate config.h for MSVC.
call :downloadfile "%RUBY_SRC_URL%" downloads\ruby_src.zip
@rem Extract the files only we needed to reduce the building time.
7z.exe x -y downloads\ruby_src.zip */bin */include */enc/Makefile.in */win32 ^
*/common.mk -ir!version.h -xr!README.* -xr!*/win32/*.c -xr!*/win32/*.h ^
-o.. > nul || exit 1
move ..\ruby-%RUBY_BRANCH% ..\ruby > nul || exit 1
pushd ..\ruby
call win32\configure.bat
@echo on
nmake.exe -l .config.h.time || exit 1
xcopy /S /Y .ext\include %RUBY_DIR%\include\ruby-%RUBY_API_VER_LONG%
popd
@rem Racket
call :downloadfile "%RACKET_URL%" downloads\racket-%BIT%.tgz
7z.exe x -tgzip -so downloads\racket-%BIT%.tgz | 7z.exe x -y -aoa -si -ttar ^
-o%DEPENDENCIES%\
move %DEPENDENCIES%\racket %RACKET_DIR%
type NUL > %RACKET_DIR%\include\bc_suffix.h
@rem Install libintl.dll and iconv.dll
call :downloadfile "%GETTEXT_32_URL%" downloads\gettext32.zip
7z.exe e -y downloads\gettext32.zip ^
-o%DEPENDENCIES%\gettext32 > nul || exit 1
call :downloadfile "%GETTEXT_64_URL%" downloads\gettext64.zip
7z.exe e -y downloads\gettext64.zip ^
-o%DEPENDENCIES%\gettext64 > nul || exit 1
@rem Install winpty
call :downloadfile "%WINPTY_URL%" downloads\winpty.zip
7z.exe x -y downloads\winpty.zip -o%WINPTY_DIR% > nul || exit 1
if /I "%ARCH%"=="x64" (
mklink /H vim\src\winpty64.dll %WINPTY_DIR%\x64\bin\winpty.dll
mklink /H vim\src\winpty-agent.exe %WINPTY_DIR%\x64\bin\winpty-agent.exe
) else (
mklink /H vim\src\winpty32.dll %WINPTY_DIR%\ia32\bin\winpty.dll
mklink /H vim\src\winpty-agent.exe %WINPTY_DIR%\ia32\bin\winpty-agent.exe
)
@rem Install UPX
@rem This is disabled, because UPX is known to be flagged as
@rem supsicious by AV vendors
rem call :downloadfile %UPX_URL% downloads\upx.zip
rem 7z.exe e -y downloads\upx.zip *\upx.exe -ovim\nsis > nul || exit 1
@rem Install ShellExecAsUser
call :downloadfile "%SHELLEXECASUSER_URL%" downloads\shellexecasuser.zip
7z.exe x -y downloads\shellexecasuser.zip ^
-o%DEPENDENCIES%\shellexecasuser > nul || exit 1
mklink /H "%ProgramFiles(x86)%\NSIS\Plugins\x86-unicode\ShellExecAsUser.dll" ^
%DEPENDENCIES%\shellexecasuser\unicode\ShellExecAsUser.dll
@rem Install Libsodium
call :downloadfile "%LIBSODIUM_URL%" downloads\libsodium.zip
7z.exe x -y downloads\libsodium.zip -o%DEPENDENCIES%\ > nul || exit 1
if /I "%ARCH%"=="x64" (
mklink /H vim\src\libsodium.dll ^
%SODIUM_DIR%\x64\Release\v143\dynamic\libsodium.dll
) else (
mklink /H vim\src\libsodium.dll ^
%SODIUM_DIR%\Win32\Release\v143\dynamic\libsodium.dll
)
@rem Show PATH for debugging
@ echo:%Path:;=&echo:%
@rem Install additional packages for Racket
raco.exe pkg install -i --auto r5rs-lib
@echo off
goto :eof
:build_x86
:build_x64
:: -------- building the program -------------------------------------------
@echo on
cd vim\src
@ if not exist .\auto\nmake mkdir .\auto\nmake
@ copy /Y ..\..\vimdll-huge.cfg .\auto\nmake\
@ echo:"PERL_VER=%PERL_VER%">> .\auto\nmake\vimdll-huge.cfg
@ echo:"PERL=%PERL_DIR%">> .\auto\nmake\vimdll-huge.cfg
@ echo:"PYTHON=%PYTHON_DIR%">> .\auto\nmake\vimdll-huge.cfg
@ echo:"PYTHON3_VER=%PYTHON3_VER%">> .\auto\nmake\vimdll-huge.cfg
@ echo:"PYTHON3=%PYTHON3_DIR%">> .\auto\nmake\vimdll-huge.cfg
@ echo:"LUA_VER=%LUA_VER%">> .\auto\nmake\vimdll-huge.cfg
@ echo:"LUA=%LUA_DIR%">> .\auto\nmake\vimdll-huge.cfg
@ echo:"RUBY_VER=%RUBY_VER%">> .\auto\nmake\vimdll-huge.cfg
@ echo:"RUBY_API_VER_LONG=%RUBY_API_VER_LONG%">> .\auto\nmake\vimdll-huge.cfg
@ echo:"RUBY=%RUBY_DIR%">> .\auto\nmake\vimdll-huge.cfg
@ echo:"MZSCHEME_VER=%MZSCHEME_VER%">> .\auto\nmake\vimdll-huge.cfg
@ echo:"MZSCHEME=%RACKET_DIR%">> .\auto\nmake\vimdll-huge.cfg
@ echo:"SODIUM=%SODIUM_DIR%">> .\auto\nmake\vimdll-huge.cfg
@ echo:>> .\auto\nmake\vimdll-huge.cfg
@rem Build GUI/CUI version
nmake.exe -lf Make_mvc.mak @auto\nmake\vimdll-huge.cfg || exit 1
@rem Build translations
pushd po
nmake.exe -lf Make_mvc.mak "GETTEXT_PATH=%DEPENDENCIES%\gettext%BIT%" ^
"VIMRUNTIME=..\..\runtime" install-all || exit 1
popd
:check_executable
:: ----------------------------------------------------------------------
start "" /W .\gvim.exe -silent -register
start "" /W .\gvim.exe -u NONE -c "redir @a | ver | 0put a | wq!" ver.txt
type ver.txt
.\vim.exe --version
@rem Print interface versions
start "" /W .\gvim.exe -u NONE -S ..\..\if_ver.vim -c quit
type if_ver.txt
@echo off
goto :eof
:package_x86
:package_x64
:: -------- creating packages ----------------------------------------------
@echo on
cd %APPVEYOR_BUILD_FOLDER%
@rem Check if we need to copy libgcc_s_sjlj-1.dll.
"%VCToolsInstallDir%bin\HostX86\x86\dumpbin.exe" ^
/DEPENDENTS %DEPENDENCIES%\gettext32\libintl-8.dll | findstr ^
/LC:"libgcc_s_sjlj-1.dll" && set "INCLUDE_LIBGCC=1" || set "INCLUDE_LIBGCC=0"
mkdir vim\runtime\GvimExt64
mkdir vim\runtime\GvimExt32
@rem Build both 64- and 32-bit versions of gvimext.dll for the installer
start "" /W cmd /C "%VCVARSALL% x64 && cd vim\src\GvimExt && nmake.exe -lf Make_mvc.mak CPU=AMD64 clean all > ..\gvimext.log"
type vim\src\gvimext.log
mklink /H vim\runtime\GvimExt64\gvimext.dll vim\src\GvimExt\gvimext.dll
mklink /H vim\runtime\GvimExt64\README.txt vim\src\GvimExt\README.txt
mklink /H vim\runtime\GvimExt64\gvimext.inf vim\src\GvimExt\gvimext.inf
mklink /H vim\runtime\GvimExt64\GvimExt.reg vim\src\GvimExt\GvimExt.reg
ren vim\src\GvimExt\gvimext.dll gvimext64.dll
start "" /W cmd /C "%VCVARSALL% x86 && cd vim\src\GvimExt && nmake.exe -lf Make_mvc.mak CPU=i386 clean all > ..\gvimext.log"
type vim\src\gvimext.log
mklink /H vim\runtime\GvimExt32\gvimext.dll vim\src\GvimExt\gvimext.dll
mklink /H vim\runtime\GvimExt32\README.txt vim\src\GvimExt\README.txt
mklink /H vim\runtime\GvimExt32\gvimext.inf vim\src\GvimExt\gvimext.inf
mklink /H vim\runtime\GvimExt32\GvimExt.reg vim\src\GvimExt\GvimExt.reg
mklink /H vim\runtime\README.txt vim\README.txt
mklink /H vim\runtime\LICENSE.txt vim\LICENSE
mklink /H vim\runtime\uninstall.txt vim\uninstall.txt
mklink /H vim\runtime\vimtutor.bat vim\vimtutor.bat
mklink /H vim\runtime\vim.ico vim\src\vim.ico
mklink /H vim\runtime\gvim.exe vim\src\gvim.exe
mklink /H vim\runtime\install.exe vim\src\install.exe
mklink /H vim\runtime\tee.exe vim\src\tee\tee.exe
mklink /H vim\runtime\vim%BIT%.dll vim\src\vim%BIT%.dll
mklink /H vim\runtime\vim.exe vim\src\vim.exe
mklink /H vim\runtime\vimrun.exe vim\src\vimrun.exe
mklink /H vim\runtime\uninstall.exe vim\src\uninstall.exe
mklink /H vim\runtime\xxd.exe vim\src\xxd\xxd.exe
mklink /H vim\runtime\libiconv-2.dll %DEPENDENCIES%\gettext%BIT%\libiconv-2.dll
mklink /H vim\runtime\libintl-8.dll %DEPENDENCIES%\gettext%BIT%\libintl-8.dll
if "%INCLUDE_LIBGCC%-%BIT%"=="1-32" (
mklink /H vim\runtime\libgcc_s_sjlj-1.dll ^
%DEPENDENCIES%\gettext32\libgcc_s_sjlj-1.dll
)
mklink /H vim\runtime\GvimExt64\libiconv-2.dll ^
%DEPENDENCIES%\gettext64\libiconv-2.dll
mklink /H vim\runtime\GvimExt64\libintl-8.dll ^
%DEPENDENCIES%\gettext64\libintl-8.dll
mklink /H vim\runtime\GvimExt32\libiconv-2.dll ^
%DEPENDENCIES%\gettext32\libiconv-2.dll
mklink /H vim\runtime\GvimExt32\libintl-8.dll ^
%DEPENDENCIES%\gettext32\libintl-8.dll
if "%INCLUDE_LIBGCC%"=="1" (
mklink /H vim\runtime\GvimExt32\libgcc_s_sjlj-1.dll ^
%DEPENDENCIES%\gettext32\libgcc_s_sjlj-1.dll
)
mklink /H vim\runtime\libsodium.dll vim\src\libsodium.dll
mklink /H vim\runtime\diff.exe .\diff.exe
mklink /H vim\runtime\winpty%BIT%.dll vim\src\winpty%BIT%.dll
mklink /H vim\runtime\winpty-agent.exe vim\src\winpty-agent.exe
set "VIM_DIR=vim%MAJOR%%MINOR%"
ren vim\runtime %VIM_DIR%
@rem Create zip packages
7z.exe a -mx=9 gvim_%VER_NUM%_%ARCH%_pdb.zip vim\src\*.pdb
7z.exe a -r -mx=9 [email protected] gvim_%VER_NUM%_%ARCH%.zip vim\%VIM_DIR%
ren vim\%VIM_DIR% runtime
@rem Create installer
mklink /J vim\runtime\GvimExt vim\src\GvimExt
pushd vim\nsis
if /I "%ARCH%"=="x64" (
set WIN64=1
) else (
set WIN64=0
)
nmake.exe -lf Make_mvc.mak "X=OutFile ..\..\gvim_%VER_NUM%_%ARCH%.exe" ^
"GETTEXT=%DEPENDENCIES%" "VIMSRC=..\runtime" "VIMRT=..\runtime" ^
"INCLUDE_LIBGCC=%INCLUDE_LIBGCC%" "SRC=..\runtime" "WIN64=%WIN64%" ^
"VIMTOOLS=..\runtime" || exit 1
popd
@rem Create zipfile for signing with signpath.io
@rem This will create a single zip file that should be uploaded to signpath
@rem signpath can then sign each artifact inside the zip file
@rem (the Vim zip archive as well as the installer)
echo:Creating Signpath Zip Archive
7z.exe a -mx=1 unsigned-gvim_%VER_NUM%_%ARCH%.zip ^
gvim_%VER_NUM%_%ARCH%.zip gvim*.exe
@echo off
goto :eof
:test_x86
:test_x64
:: -------- testing the build ----------------------------------------------
@echo on
set "PLTCOLLECTS=%RACKET_DIR%\collects"
set "PLTCONFIGDIR=%RACKET_DIR%\etc"
cd vim\src\testdir
nmake.exe -lf Make_mvc.mak "VIMPROG=..\gvim.exe" || exit 1
nmake.exe -lf Make_mvc.mak clean
nmake.exe -lf Make_mvc.mak "VIMPROG=..\vim.exe" || exit 1
@echo off
goto :eof
:onsuccess_x64
goto :eof
:onsuccess_x86
:: ----------------------------------------------------------------------
@rem Turn off the draft status of the release when x86 is successfully finished.
if not defined APPVEYOR_REPO_TAG_NAME goto :eof
call :get_release_id
@rem Turn off the draft status.
curl -# -X PATCH -H "Authorization: token %auth_token%" ^
-H "Accept: application/vnd.github.v3+json" ^
"https://api.github.com/repos/%APPVEYOR_REPO_NAME%/releases/%REL_ID%" ^
-d "{\"draft\": false}"
goto :eof
:onfailure_x64
goto :eof
:onfailure_x86
:: ----------------------------------------------------------------------
@rem Delete the release when x86 is failed.
if not defined APPVEYOR_REPO_TAG_NAME goto :eof
call :get_release_id
@rem Delete the release.
curl -# -X DELETE -H "Authorization: token %auth_token%" ^
-H "Accept: application/vnd.github.v3+json" ^
"https://api.github.com/repos/%APPVEYOR_REPO_NAME%/releases/%REL_ID%"
goto :eof
:get_release_id
:: ----------------------------------------------------------------------
@rem Get the ID of the release. Set the result to %REL_ID%.
set "PS=powershell.exe"
set "PSFLAGS=-NoLogo -NoProfile -Command"
curl -# -H "Authorization: token %auth_token%" ^
-H "Accept: application/vnd.github.v3+json" ^
"https://api.github.com/repos/%APPVEYOR_REPO_NAME%/releases" > releases.json
1> nul %PS% %PSFLAGS% ((Get-Content .\releases.json -Raw ^| ^
ConvertFrom-Json) ^| Where-Object name -EQ '%TAG_NAME%').id ^| ^
New-Item .\release_id.txt -Force"
type release_id.txt
for /F "delims=" %%I in (release_id.txt) do set "REL_ID=%%I"
goto :eof
:downloadfile
:: ----------------------------------------------------------------------
@rem call :downloadfile <URL> <localfile>
if exist %2 exit /B
curl -# -f -L %~1 -o %2 && exit /B
if ERRORLEVEL 1 (
rem Retry once.
curl -f -L %~1 -o %2 || exit 1
)
@goto :eof
EndLocal
@rem vim:ft=dosbatch:ts=8:sts=2:sw=2:noet: