@@ -151,6 +151,36 @@ class macOSPythonBuilder : NixPythonBuilder {
151
151
return $pkgLocation
152
152
}
153
153
154
+ [string ] GetFrameworkName() {
155
+ <#
156
+ . SYNOPSIS
157
+ Get the Python installation Package name.
158
+ #>
159
+
160
+ if ($this.IsFreeThreaded ()) {
161
+ return " PythonT.framework"
162
+ } else {
163
+ return " Python.framework"
164
+ }
165
+ }
166
+
167
+ [string ] GetPkgChoices() {
168
+ <#
169
+ . SYNOPSIS
170
+ Reads the configuration XML file for the Python installer
171
+ #>
172
+
173
+ $config = if ($this.IsFreeThreaded ()) { " freethreaded" } else { " default" }
174
+ $choicesFile = Join-Path $PSScriptRoot " ../config/macos-pkg-choices-$ ( $config ) .xml"
175
+ $choicesTemplate = Get-Content - Path $choicesFile - Raw
176
+
177
+ $variablesToReplace = @ {
178
+ " {{__VERSION_MAJOR_MINOR__}}" = " $ ( $this.Version.Major ) .$ ( $this.Version.Minor ) " ;
179
+ }
180
+
181
+ $variablesToReplace.keys | ForEach-Object { $choicesTemplate = $choicesTemplate.Replace ($_ , $variablesToReplace [$_ ]) }
182
+ return $choicesTemplate
183
+ }
154
184
[void ] CreateInstallationScriptPkg() {
155
185
<#
156
186
. SYNOPSIS
@@ -165,6 +195,8 @@ class macOSPythonBuilder : NixPythonBuilder {
165
195
" {{__VERSION_FULL__}}" = $this.Version ;
166
196
" {{__PKG_NAME__}}" = $this.GetPkgName ();
167
197
" {{__ARCH__}}" = $this.Architecture ;
198
+ " {{__FRAMEWORK_NAME__}}" = $this.GetFrameworkName ();
199
+ " {{__PKG_CHOICES__}}" = $this.GetPkgChoices ();
168
200
}
169
201
170
202
$variablesToReplace.keys | ForEach-Object { $installationTemplateContent = $installationTemplateContent.Replace ($_ , $variablesToReplace [$_ ]) }
0 commit comments