Commit 91420a38 authored by me-no-dev's avatar me-no-dev

Update get.py to support Apple ARM64

parent 165595b7
...@@ -177,20 +177,34 @@ def load_tools_list(filename, platform): ...@@ -177,20 +177,34 @@ def load_tools_list(filename, platform):
for t in tools_info: for t in tools_info:
tool_platform = [p for p in t['systems'] if p['host'] == platform] tool_platform = [p for p in t['systems'] if p['host'] == platform]
if len(tool_platform) == 0: if len(tool_platform) == 0:
continue # Fallback to x86 on Apple ARM
if platform == 'arm64-apple-darwin':
tool_platform = [p for p in t['systems'] if p['host'] == 'x86_64-apple-darwin']
if len(tool_platform) == 0:
continue
# Fallback to 32bit on 64bit x86 Windows
elif platform == 'x86_64-mingw32':
tool_platform = [p for p in t['systems'] if p['host'] == 'i686-mingw32']
if len(tool_platform) == 0:
continue
else:
continue
tools_to_download.append(tool_platform[0]) tools_to_download.append(tool_platform[0])
return tools_to_download return tools_to_download
def identify_platform(): def identify_platform():
arduino_platform_names = {'Darwin' : {32 : 'i386-apple-darwin', 64 : 'x86_64-apple-darwin'}, arduino_platform_names = {'Darwin' : {32 : 'i386-apple-darwin', 64 : 'x86_64-apple-darwin'},
'Linux' : {32 : 'i686-pc-linux-gnu', 64 : 'x86_64-pc-linux-gnu'}, 'DarwinARM': {32 : 'arm64-apple-darwin', 64 : 'arm64-apple-darwin'},
'LinuxARM': {32 : 'arm-linux-gnueabihf', 64 : 'aarch64-linux-gnu'}, 'Linux' : {32 : 'i686-pc-linux-gnu', 64 : 'x86_64-pc-linux-gnu'},
'Windows' : {32 : 'i686-mingw32', 64 : 'i686-mingw32'}} 'LinuxARM' : {32 : 'arm-linux-gnueabihf', 64 : 'aarch64-linux-gnu'},
'Windows' : {32 : 'i686-mingw32', 64 : 'x86_64-mingw32'}}
bits = 32 bits = 32
if sys.maxsize > 2**32: if sys.maxsize > 2**32:
bits = 64 bits = 64
sys_name = platform.system() sys_name = platform.system()
sys_platform = platform.platform() sys_platform = platform.platform()
if 'Darwin' in sys_name and (sys_platform.find('arm') > 0 or sys_platform.find('arm64') > 0):
sys_name = 'DarwinARM'
if 'Linux' in sys_name and (sys_platform.find('arm') > 0 or sys_platform.find('aarch64') > 0): if 'Linux' in sys_name and (sys_platform.find('arm') > 0 or sys_platform.find('aarch64') > 0):
sys_name = 'LinuxARM' sys_name = 'LinuxARM'
if 'CYGWIN_NT' in sys_name: if 'CYGWIN_NT' in sys_name:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment