2022-04-12 05:21:55 -06:00
|
|
|
#!/usr/bin/env python3
|
2014-01-30 21:18:30 -07:00
|
|
|
|
2015-04-11 03:58:19 -06:00
|
|
|
import os
|
2014-06-04 09:24:38 -06:00
|
|
|
import sys
|
|
|
|
|
2015-04-11 03:30:52 -06:00
|
|
|
PLATFORM = {
|
2014-06-04 09:24:38 -06:00
|
|
|
'cygwin': 'win32',
|
2021-06-02 01:29:19 -06:00
|
|
|
'msys': 'win32',
|
2014-06-04 09:24:38 -06:00
|
|
|
'darwin': 'darwin',
|
2019-11-19 07:08:20 -07:00
|
|
|
'linux': 'linux',
|
2014-06-04 09:24:38 -06:00
|
|
|
'linux2': 'linux',
|
|
|
|
'win32': 'win32',
|
|
|
|
}[sys.platform]
|
2014-12-08 10:00:35 -07:00
|
|
|
|
|
|
|
verbose_mode = False
|
|
|
|
|
2015-04-11 03:58:19 -06:00
|
|
|
|
2015-09-28 20:59:52 -06:00
|
|
|
def get_platform_key():
|
2020-10-30 04:05:38 -06:00
|
|
|
if 'MAS_BUILD' in os.environ:
|
2015-09-28 20:59:52 -06:00
|
|
|
return 'mas'
|
2022-03-20 20:11:21 -06:00
|
|
|
|
|
|
|
return PLATFORM
|
2015-09-28 20:59:52 -06:00
|
|
|
|
|
|
|
|
2015-04-11 03:58:19 -06:00
|
|
|
def get_target_arch():
|
2018-09-28 22:13:17 -06:00
|
|
|
arch = os.environ.get('TARGET_ARCH')
|
|
|
|
if arch is None:
|
|
|
|
return 'x64'
|
|
|
|
return arch
|
2015-04-11 03:58:19 -06:00
|
|
|
|
|
|
|
|
2014-12-08 10:00:35 -07:00
|
|
|
def enable_verbose_mode():
|
2019-06-15 11:26:09 -06:00
|
|
|
print('Running in verbose mode')
|
2014-12-08 10:00:35 -07:00
|
|
|
global verbose_mode
|
|
|
|
verbose_mode = True
|
|
|
|
|
2015-04-11 03:58:19 -06:00
|
|
|
|
2014-12-08 10:00:35 -07:00
|
|
|
def is_verbose_mode():
|
|
|
|
return verbose_mode
|
2016-08-25 18:50:12 -06:00
|
|
|
|
|
|
|
|
|
|
|
def get_zip_name(name, version, suffix=''):
|
2016-08-25 18:51:37 -06:00
|
|
|
arch = get_target_arch()
|
2016-09-01 06:00:29 -06:00
|
|
|
if arch == 'arm':
|
2016-08-25 18:51:37 -06:00
|
|
|
arch += 'v7l'
|
2024-03-21 07:48:23 -06:00
|
|
|
zip_name = f'{name}-{version}-{get_platform_key()}-{arch}'
|
2016-08-25 18:50:12 -06:00
|
|
|
if suffix:
|
|
|
|
zip_name += '-' + suffix
|
|
|
|
return zip_name + '.zip'
|