11@ echo off
22rem SPDX-License-Identifier: MIT
3- rem Copyright (C) 2019-2021 WireGuard LLC. All Rights Reserved.
3+ rem Copyright (C) 2019-2022 WireGuard LLC. All Rights Reserved.
44
55setlocal enabledelayedexpansion
66set BUILDDIR = %~dp0
@@ -13,19 +13,15 @@ if exist .deps\prepared goto :render
1313 rmdir /s /q .deps 2 > NUL
1414 mkdir .deps || goto :error
1515 cd .deps || goto :error
16- call :download go.zip https://go.dev/dl/go1.17.4. windows-amd64.zip 903cffeb7c6ab7490b9101086a2b978076bd9356e56369404b9c45dff866da77 || goto :error
16+ call :download go.zip https://go.dev/dl/go1.18beta1. windows-amd64.zip 3a43ab4ec28eee6b10fd412a055724d962227f1c27a78960d6d229d741f8353d || goto :error
1717 rem Mirror of https://github.com/mstorsjo/llvm-mingw/releases/download/20201020/llvm-mingw-20201020-msvcrt-x86_64.zip
1818 call :download llvm-mingw-msvcrt.zip https://download.wireguard.com/windows-toolchain/distfiles/llvm-mingw-20201020-msvcrt-x86_64.zip 2e46593245090df96d15e360e092f0b62b97e93866e0162dca7f93b16722b844 || goto :error
1919 rem Mirror of https://imagemagick.org/download/binaries/ImageMagick-7.0.8-42-portable-Q16-x64.zip
2020 call :download imagemagick.zip https://download.wireguard.com/windows-toolchain/distfiles/ImageMagick-7.0.8-42-portable-Q16-x64.zip 584e069f56456ce7dde40220948ff9568ac810688c892c5dfb7f6db902aa05aa " convert.exe colors.xml delegates.xml" || goto :error
2121 rem Mirror of https://sourceforge.net/projects/ezwinports/files/make-4.2.1-without-guile-w32-bin.zip
2222 call :download make.zip https://download.wireguard.com/windows-toolchain/distfiles/make-4.2.1-without-guile-w32-bin.zip 30641be9602712be76212b99df7209f4f8f518ba764cf564262bc9d6e4047cc7 " --strip-components 1 bin" || goto :error
2323 call :download wireguard-tools.zip https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-1ee37b8e4833a25efe6f1fc0d5bdcb476148f4ba.zip ed0739bc3e5a7021a59d4cc4fc63e5fb60a0cb8628d30515a747bfbdcf1fdb0a " --exclude wg-quick --strip-components 1" || goto :error
24- rem Mirror of https://sourceforge.net/projects/gnuwin32/files/patch/2.5.9-7/patch-2.5.9-7-bin.zip with fixed manifest
25- call :download patch.zip https://download.wireguard.com/windows-toolchain/distfiles/patch-2.5.9-7-bin-fixed-manifest.zip 25977006ca9713f2662a5d0a2ed3a5a138225b8be3757035bd7da9dcf985d0a1 " --strip-components 1 bin" || goto :error
2624 call :download wireguard-nt.zip https://download.wireguard.com/wireguard-nt/wireguard-nt-0.10.1.zip 772c0b1463d8d2212716f43f06f4594d880dea4f735165bd68e388fc41b81605 || goto :error
27- echo [+] Patching go
28- for %%a in (" ..\go-patches\*.patch" ) do .\patch.exe -f -N -r- -d go -p1 --binary < " %%a " || goto :error
2925 copy /y NUL prepared > NUL || goto :error
3026 cd .. || goto :error
3127
@@ -77,7 +73,7 @@ if exist .deps\prepared goto :render
7773 echo [+] Assembling resources %1
7874 %~2 -w64-mingw32-windres -I " .deps\wireguard-nt\bin\%~1 " -DWIREGUARD_VERSION_ARRAY=%WIREGUARD_VERSION_ARRAY% -DWIREGUARD_VERSION_STR=%WIREGUARD_VERSION% -i resources.rc -o " resources_%~3 .syso" -O coff -c 65001 || exit /b %errorlevel%
7975 echo [+] Building program %1
80- go build -tags load_wgnt_from_rsrc -ldflags=" -H windowsgui -s -w" -trimpath -v -o " %~1 \wireguard.exe" || exit /b 1
76+ go build -tags load_wgnt_from_rsrc -ldflags=" -H windowsgui -s -w" -trimpath -buildinfo=false -buildvcs=false - v -o " %~1 \wireguard.exe" || exit /b 1
8177 if not exist " %~1 \wg.exe" (
8278 echo [+] Building command line tools %1
8379 del .deps\src\*.exe .deps\src\*.o .deps\src\wincompat\*.o .deps\src\wincompat\*.lib 2 > NUL
0 commit comments