-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild-deps-unified.ps1
53 lines (42 loc) · 1.84 KB
/
build-deps-unified.ps1
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
param ([string] $workdir,
[string] $configfiles,
[string] $openvpn_build_ref = "master",
[switch] $debug)
if ($debug -eq $true) {
. $PSScriptRoot\ps_support.ps1
}
Write-Host "Setting up openvpn build dependencies with vcpkg"
if (-Not (Test-Path $workdir)) {
New-Item -Type directory $workdir
if ($debug -eq $true) { CheckLastExitCode }
}
Add-MpPreference -ExclusionPath $workdir
if ($debug -eq $true) { CheckLastExitCode }
$openvpn_build = "${workdir}\openvpn-build"
if (-Not (Test-Path $openvpn_build)) {
& git.exe clone -b $openvpn_build_ref https://github.com/OpenVPN/openvpn-build.git $openvpn_build
if ($debug -eq $true) { CheckLastExitCode }
& git.exe -C $openvpn_build submodule update --init
if ($debug -eq $true) { CheckLastExitCode }
}
& $PSScriptRoot\vcpkg.ps1 -workdir "${openvpn_build}\src" -debug:$debug
cd "${openvpn_build}\src\vcpkg"
# Make sure environment is consistent with actual build
$Env:PATH = "C:\Program Files\Amazon\AWSCLIV2\;$Env:PATH"
. "${configfiles}\build-and-package-env.ps1"
# Install OpenVPN build dependencies
$architectures = @('x64','x86','arm64')
ForEach ($arch in $architectures) {
& .\vcpkg.exe `
--overlay-ports "${openvpn_build}\src\openvpn\contrib\vcpkg-ports" `
--overlay-ports "${openvpn_build}\windows-msi\vcpkg-ports" `
--overlay-triplets "${openvpn_build}\src\openvpn\contrib\vcpkg-triplets" `
install --triplet "${arch}-windows-ovpn" json-c lz4 lzo openssl pkcs11-helper tap-windows6
& .\vcpkg.exe `
--overlay-ports "${openvpn_build}\src\openvpn\contrib\vcpkg-ports" `
--overlay-ports "${openvpn_build}\windows-msi\vcpkg-ports" `
--overlay-triplets "${openvpn_build}\src\openvpn\contrib\vcpkg-triplets" `
upgrade --no-dry-run
}
# Ensure that we can convert the man page from rst to html
& pip.exe --no-cache-dir install docutils