Build binaries for Linux ARM64
This commit is contained in:
parent
a4cd10c6fb
commit
a938b01246
@ -19,7 +19,11 @@ from bypy.freeze import (
|
|||||||
from bypy.utils import get_dll_path, mkdtemp, py_compile, walk
|
from bypy.utils import get_dll_path, mkdtemp, py_compile, walk
|
||||||
|
|
||||||
j = os.path.join
|
j = os.path.join
|
||||||
arch = 'x86_64' if is64bit else 'i686'
|
machine = (os.uname()[4] or '').lower()
|
||||||
|
if machine.startswith('arm64') or machine.startswith('aarch64'):
|
||||||
|
arch = 'arm64'
|
||||||
|
else:
|
||||||
|
arch = 'x86_64' if is64bit else 'i686'
|
||||||
self_dir = os.path.dirname(os.path.abspath(__file__))
|
self_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
py_ver = '.'.join(map(str, python_major_minor_version()))
|
py_ver = '.'.join(map(str, python_major_minor_version()))
|
||||||
iv = globals()['init_env']
|
iv = globals()['init_env']
|
||||||
|
|||||||
@ -20,10 +20,16 @@ import tempfile
|
|||||||
py3 = sys.version_info[0] > 2
|
py3 = sys.version_info[0] > 2
|
||||||
is64bit = platform.architecture()[0] == '64bit'
|
is64bit = platform.architecture()[0] == '64bit'
|
||||||
is_macos = 'darwin' in sys.platform.lower()
|
is_macos = 'darwin' in sys.platform.lower()
|
||||||
|
is_linux_arm = is_linux_arm64 = False
|
||||||
if is_macos:
|
if is_macos:
|
||||||
mac_ver = tuple(map(int, platform.mac_ver()[0].split('.')))
|
mac_ver = tuple(map(int, platform.mac_ver()[0].split('.')))
|
||||||
if mac_ver[:2] < (10, 12):
|
if mac_ver[:2] < (10, 12):
|
||||||
raise SystemExit('Your version of macOS is too old, at least 10.12 is required')
|
raise SystemExit('Your version of macOS is too old, at least 10.12 is required')
|
||||||
|
else:
|
||||||
|
machine = (os.uname()[4] or '').lower()
|
||||||
|
if machine.startswith('arm') or machine.startswith('aarch64'):
|
||||||
|
is_linux_arm = True
|
||||||
|
is_linux_arm64 = machine.startswith('arm64') or machine.startswith('aarch64')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
__file__
|
__file__
|
||||||
@ -92,7 +98,8 @@ def get_release_data(relname='latest'):
|
|||||||
else:
|
else:
|
||||||
if name.endswith('.txz'):
|
if name.endswith('.txz'):
|
||||||
if is64bit:
|
if is64bit:
|
||||||
if name.endswith('-x86_64.txz'):
|
q = '-arm64.txz' if is_linux_arm64 else '-x86_64.txz'
|
||||||
|
if name.endswith(q):
|
||||||
return html_url + '/' + name, asset['size']
|
return html_url + '/' + name, asset['size']
|
||||||
else:
|
else:
|
||||||
if name.endswith('-i686.txz'):
|
if name.endswith('-i686.txz'):
|
||||||
@ -186,11 +193,10 @@ def main(dest=None, launch=True, installer=None):
|
|||||||
dest = '/Applications'
|
dest = '/Applications'
|
||||||
else:
|
else:
|
||||||
dest = os.path.expanduser('~/.local')
|
dest = os.path.expanduser('~/.local')
|
||||||
machine = os.uname()[4]
|
if is_linux_arm and not is_linux_arm64:
|
||||||
if not is_macos and machine and machine.lower().startswith('arm'):
|
|
||||||
raise SystemExit(
|
raise SystemExit(
|
||||||
'You are running on an ARM system. The kitty binaries are only'
|
'You are running on a 32-bit ARM system. The kitty binaries are only'
|
||||||
' available for x86 systems. You will have to build from'
|
' available for 64 bit ARM systems. You will have to build from'
|
||||||
' source.')
|
' source.')
|
||||||
if not installer:
|
if not installer:
|
||||||
url, size = get_release_data()
|
url, size = get_release_data()
|
||||||
|
|||||||
@ -47,10 +47,16 @@ import tempfile
|
|||||||
py3 = sys.version_info[0] > 2
|
py3 = sys.version_info[0] > 2
|
||||||
is64bit = platform.architecture()[0] == '64bit'
|
is64bit = platform.architecture()[0] == '64bit'
|
||||||
is_macos = 'darwin' in sys.platform.lower()
|
is_macos = 'darwin' in sys.platform.lower()
|
||||||
|
is_linux_arm = is_linux_arm64 = False
|
||||||
if is_macos:
|
if is_macos:
|
||||||
mac_ver = tuple(map(int, platform.mac_ver()[0].split('.')))
|
mac_ver = tuple(map(int, platform.mac_ver()[0].split('.')))
|
||||||
if mac_ver[:2] < (10, 12):
|
if mac_ver[:2] < (10, 12):
|
||||||
raise SystemExit('Your version of macOS is too old, at least 10.12 is required')
|
raise SystemExit('Your version of macOS is too old, at least 10.12 is required')
|
||||||
|
else:
|
||||||
|
machine = (os.uname()[4] or '').lower()
|
||||||
|
if machine.startswith('arm') or machine.startswith('aarch64'):
|
||||||
|
is_linux_arm = True
|
||||||
|
is_linux_arm64 = machine.startswith('arm64') or machine.startswith('aarch64')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
__file__
|
__file__
|
||||||
@ -119,7 +125,8 @@ def get_release_data(relname='latest'):
|
|||||||
else:
|
else:
|
||||||
if name.endswith('.txz'):
|
if name.endswith('.txz'):
|
||||||
if is64bit:
|
if is64bit:
|
||||||
if name.endswith('-x86_64.txz'):
|
q = '-arm64.txz' if is_linux_arm64 else '-x86_64.txz'
|
||||||
|
if name.endswith(q):
|
||||||
return html_url + '/' + name, asset['size']
|
return html_url + '/' + name, asset['size']
|
||||||
else:
|
else:
|
||||||
if name.endswith('-i686.txz'):
|
if name.endswith('-i686.txz'):
|
||||||
@ -213,11 +220,10 @@ def main(dest=None, launch=True, installer=None):
|
|||||||
dest = '/Applications'
|
dest = '/Applications'
|
||||||
else:
|
else:
|
||||||
dest = os.path.expanduser('~/.local')
|
dest = os.path.expanduser('~/.local')
|
||||||
machine = os.uname()[4]
|
if is_linux_arm and not is_linux_arm64:
|
||||||
if not is_macos and machine and machine.lower().startswith('arm'):
|
|
||||||
raise SystemExit(
|
raise SystemExit(
|
||||||
'You are running on an ARM system. The kitty binaries are only'
|
'You are running on a 32-bit ARM system. The kitty binaries are only'
|
||||||
' available for x86 systems. You will have to build from'
|
' available for 64 bit ARM systems. You will have to build from'
|
||||||
' source.')
|
' source.')
|
||||||
if not installer:
|
if not installer:
|
||||||
url, size = get_release_data()
|
url, size = get_release_data()
|
||||||
|
|||||||
@ -373,6 +373,7 @@ def files_for_upload() -> Dict[str, str]:
|
|||||||
'macos/dist/kitty-{}.dmg': 'macOS dmg',
|
'macos/dist/kitty-{}.dmg': 'macOS dmg',
|
||||||
'linux/64/dist/kitty-{}-x86_64.txz': 'Linux amd64 binary bundle',
|
'linux/64/dist/kitty-{}-x86_64.txz': 'Linux amd64 binary bundle',
|
||||||
'linux/32/dist/kitty-{}-i686.txz': 'Linux x86 binary bundle',
|
'linux/32/dist/kitty-{}-i686.txz': 'Linux x86 binary bundle',
|
||||||
|
'linux/arm64/dist/kitty-{}-arm64.txz': 'Linux arm64 binary bundle',
|
||||||
}.items():
|
}.items():
|
||||||
path = os.path.join('bypy', 'b', f.format(version))
|
path = os.path.join('bypy', 'b', f.format(version))
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
|
|||||||
1
setup.py
1
setup.py
@ -1438,6 +1438,7 @@ def main() -> None:
|
|||||||
subprocess.check_call(cmd + ['linux'] + dest)
|
subprocess.check_call(cmd + ['linux'] + dest)
|
||||||
subprocess.check_call(cmd + ['macos'] + dest)
|
subprocess.check_call(cmd + ['macos'] + dest)
|
||||||
subprocess.check_call(cmd + ['linux', '32'] + dest)
|
subprocess.check_call(cmd + ['linux', '32'] + dest)
|
||||||
|
subprocess.check_call(cmd + ['linux', 'arm64'] + dest)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user