From 4d75a8b912e0715148cb7c0c72239afcf7645c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hong=20Minhee=20=28=E6=B4=AA=20=E6=B0=91=E6=86=99=29?= Date: Thu, 10 Nov 2022 14:32:59 +0900 Subject: [PATCH] python: Add arm64 architecture (#4106) --- bucket/python.json | 15 ++++++++++++++- scripts/python/install-pep-514.reg | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/bucket/python.json b/bucket/python.json index 5313d2c5b5..8de5b9dadd 100644 --- a/bucket/python.json +++ b/bucket/python.json @@ -12,12 +12,21 @@ "32bit": { "url": "https://www.python.org/ftp/python/3.11.0/python-3.11.0.exe#/setup.exe", "hash": "2d7b87eacdd5925af4e0db0ec155dd2b765aa27efe609c0684cacc6fbf46f104" + }, + "arm64": { + "url": "https://www.python.org/ftp/python/3.11.0/python-3.11.0-arm64.exe#/setup.exe", + "hash": "5638e4339eb320cee1fcc7c2722252fc6a6b0855b517a7ea72b01a0c57767091" } }, "pre_install": [ "$py_root = \"$dir\".Replace('\\', '\\\\')", + "$py_archLabel = '64-bit'", "$bit = '64'", - "if ($architecture -eq '32bit') { $bit = '32' }", + "if ($architecture -eq '32bit') {", + " $py_archLabel = '32-bit'", + " $bit = '32'", + "}", + "if ($architecture -eq 'arm64') { $py_archLabel = 'ARM64' }", "'install-pep-514.reg', 'uninstall-pep-514.reg' | ForEach-Object {", " $py_version = ($version -split '\\.')[0..1] -join '.'", " $content = Get-Content \"$bucketsdir\\main\\scripts\\python\\$_\"", @@ -25,6 +34,7 @@ " $content = $content.Replace('$py_version', $py_version)", " $content = $content.Replace('$py_fullversion', $version)", " $content = $content.Replace('$py_cleanVersion', $version -replace '\\.')", + " $content = $content.Replace('$py_archLabel', $py_archLabel)", " $content = $content.Replace('$py_arch', \"$bit\")", " if ($global) {", " $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE')", @@ -92,6 +102,9 @@ }, "32bit": { "url": "https://www.python.org/ftp/python/$version/python-$version.exe#/setup.exe" + }, + "arm64": { + "url": "https://www.python.org/ftp/python/$version/python-$version-arm64.exe#/setup.exe" } }, "hash": { diff --git a/scripts/python/install-pep-514.reg b/scripts/python/install-pep-514.reg index 4dac45bb16..d5a3b96201 100644 --- a/scripts/python/install-pep-514.reg +++ b/scripts/python/install-pep-514.reg @@ -5,7 +5,7 @@ Windows Registry Editor Version 5.00 "SupportUrl"="https://www.python.org/" [HKEY_CURRENT_USER\Software\Python\PythonCore\$py_version] -"DisplayName"="Python $py_version ($py_arch-bit)" +"DisplayName"="Python $py_version ($py_archLabel)" "SupportUrl"="https://www.python.org/" "Version"="$py_fullversion" "SysVersion"="$py_version"