Skip to content

Commit 5d33b0c

Browse files
committed
(CAT-1789) Add Windows 11 platform definition
Required for the PDK to support Windows 11 To start with I have imitated the settings used with the windows server 2019.
1 parent b653211 commit 5d33b0c

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

configs/platforms/windows-11-x64.rb

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
platform "windows-11-x64" do |plat|
2+
plat.vmpooler_template "win-11-ent-x86_64"
3+
4+
plat.servicetype "windows"
5+
visual_studio_version = '2017'
6+
visual_studio_sdk_version = 'win8.1'
7+
8+
# We need to ensure we install chocolatey prior to adding any nuget repos. Otherwise, everything will fall over
9+
plat.add_build_repository "https://artifactory.delivery.puppetlabs.net/artifactory/generic/buildsources/windows/chocolatey/install-chocolatey-1.4.0.ps1"
10+
plat.add_build_repository "https://artifactory.delivery.puppetlabs.net/artifactory/api/nuget/nuget"
11+
12+
# C:\tools is likely added by mingw, however because we also want to use that
13+
# dir for vsdevcmd.bat we create it for safety
14+
plat.provision_with "mkdir C:/tools"
15+
# We don't want to install any packages from the chocolatey repo by accident
16+
plat.provision_with "C:/ProgramData/chocolatey/bin/choco.exe sources remove -name chocolatey"
17+
18+
packages = [
19+
"cmake",
20+
"pl-gdbm-#{self._platform.architecture}",
21+
"pl-iconv-#{self._platform.architecture}",
22+
"pl-libffi-#{self._platform.architecture}",
23+
"pl-pdcurses-#{self._platform.architecture}",
24+
"pl-toolchain-#{self._platform.architecture}",
25+
"pl-zlib-#{self._platform.architecture}",
26+
"mingw-w64 -version 5.2.0 -debug",
27+
"Wix310 -version 3.10.2 -debug -x86"
28+
]
29+
30+
packages.each do |name|
31+
plat.provision_with("C:/ProgramData/chocolatey/bin/choco.exe install -y --no-progress #{name}")
32+
end
33+
# We use cache-location in the following install because msvc has several long paths
34+
# if we do not update the cache location choco will fail because paths get too long
35+
plat.provision_with "C:/ProgramData/chocolatey/bin/choco.exe install msvc.#{visual_studio_version}-#{visual_studio_sdk_version}.sdk.en-us -y --cache-location=\"C:\\msvc\" --no-progress"
36+
# The following creates a batch file that will execute the vsdevcmd batch file located within visual studio.
37+
# We create the following batch file under C:\tools\vsdevcmd.bat so we can avoid using both the %ProgramFiles(x86)%
38+
# evironment var, as well as any spaces in the path when executing things with cygwin. This makes command execution
39+
# through cygwin much easier.
40+
#
41+
# Note that the unruly \'s in the following string escape the following sequence to literal chars: "\" and then \""
42+
plat.provision_with "touch C:/tools/vsdevcmd.bat && echo \"\\\"%ProgramFiles(x86)%\\Microsoft Visual Studio\\#{visual_studio_version}\\BuildTools\\Common7\\Tools\\vsdevcmd\\\"\" >> C:/tools/vsdevcmd.bat"
43+
44+
plat.install_build_dependencies_with "C:/ProgramData/chocolatey/bin/choco.exe install -y --no-progress"
45+
46+
plat.make "/usr/bin/make"
47+
plat.patch "TMP=/var/tmp /usr/bin/patch.exe --binary"
48+
49+
plat.platform_triple "x86_64-w64-mingw32"
50+
51+
plat.package_type "archive"
52+
plat.output_dir "windows"
53+
end

0 commit comments

Comments
 (0)