45 lines
1.1 KiB
Python
45 lines
1.1 KiB
Python
import os
|
|
|
|
ARCHIVE = '.tar.xz'
|
|
ARCHITECTURE = 'x86_64'
|
|
CATALOG = '.files'
|
|
CHARSET = 'u8'
|
|
CRT = 'mingw'
|
|
DISTRIBUTION = 'distrib'
|
|
REPOSITORY = 'https://repo.msys2.org'
|
|
SIGNATURE = '.sig'
|
|
SUBSYSTEM = 'msys'
|
|
|
|
ARCHITECTURES = [ARCHITECTURE, 'i686']
|
|
ARCHITECTURES_BITS = {
|
|
ARCHITECTURE: 64,
|
|
'i686': 32,
|
|
}
|
|
ARCHITECTURES_SUBSYSTEMS = {
|
|
ARCHITECTURE: [SUBSYSTEM, 'clang64', 'mingw64', 'ucrt64'],
|
|
'i686': [SUBSYSTEM, 'clang32', 'mingw32'],
|
|
}
|
|
SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt']
|
|
|
|
|
|
def get_subsystems(architecture, families):
|
|
list = []
|
|
bits = ARCHITECTURES_BITS[architecture]
|
|
for family in families:
|
|
if family == SUBSYSTEM:
|
|
subsystem = family
|
|
else:
|
|
subsystem = f'{family}{bits}'
|
|
if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]:
|
|
list.append(subsystem)
|
|
return list
|
|
|
|
|
|
def get_subsystem(architecture, subsystem):
|
|
list = []
|
|
if subsystem != SUBSYSTEM:
|
|
list.append(CRT)
|
|
list.append(subsystem)
|
|
if subsystem == SUBSYSTEM:
|
|
list.append(architecture)
|
|
return os.sep.join(list)
|