Switch to using mes/nyacc tar packages.

This commit is contained in:
Andrius Štikonas 2021-06-11 22:39:50 +01:00
parent 7ff2de94c5
commit 40f40ea850
10 changed files with 77 additions and 104 deletions

57
sysa.py
View file

@ -167,10 +167,6 @@ class SysA:
mescc_tools_extra_dir = os.path.join(stage0_posix_base_dir, 'mescc-tools-extra')
copytree(mescc_tools_extra_dir, self.tmp_dir)
# At the moment not useful for bootstrap but easier to keep it
mes_m2_dir = os.path.join(stage0_posix_base_dir, 'mes-m2')
copytree(mes_m2_dir, self.tmp_dir)
# bootstrap seeds
bootstrap_seeds_dir = os.path.join(self.sysa_dir, 'stage0-posix', 'src', 'bootstrap-seeds')
copytree(bootstrap_seeds_dir, self.tmp_dir)
@ -185,6 +181,10 @@ class SysA:
# create directories needed
os.mkdir(os.path.join(self.tmp_dir, 'bin'))
# stage0-posix checksums
shutil.copy2(os.path.join(stage0_posix_base_dir, self.arch + '.answers'),
os.path.join(self.tmp_dir, self.arch + '.answers'))
def after(self):
"""
Prepare sources in /after directory.
@ -192,11 +192,8 @@ class SysA:
the stage0-posix one is hella messy.
"""
self.create_after_dirs()
self.create_configuration_file()
self.stage0_posix_checksum()
self.deploy_extra_files()
self.mes()
self.tcc_0_9_26()
self.get_packages()
@ -205,43 +202,11 @@ class SysA:
Creates bootstrap.cfg file which would contain options used to
customize bootstrap.
"""
os.mkdir(self.after_dir)
config_path = os.path.join(self.after_dir, "bootstrap.cfg")
with open(config_path, "w") as config:
config.write("FORCE_TIMESTAMPS=" + str(self.force_timestamps))
def create_after_dirs(self):
"""
Create some empty directories for early bootstrap
This list can be eventually reduced if we include a small
mkdir implementation written for M2-Planet.
"""
bin_dir = os.path.join(self.after_dir, 'bin')
lib_dir = os.path.join(self.after_dir, 'lib')
include_dir = os.path.join(self.after_dir, 'include')
os.mkdir(self.after_dir)
os.mkdir(bin_dir)
os.mkdir(lib_dir)
os.mkdir(include_dir)
os.mkdir(os.path.join(lib_dir, self.arch+'-mes'))
os.mkdir(os.path.join(lib_dir, 'tcc'))
os.mkdir(os.path.join(lib_dir, 'linux'))
os.mkdir(os.path.join(lib_dir, 'linux', self.arch+'-mes'))
os.mkdir(os.path.join(include_dir, 'mes'))
os.mkdir(os.path.join(include_dir, 'gnu'))
os.mkdir(os.path.join(include_dir, 'linux'))
os.mkdir(os.path.join(include_dir, 'linux', self.arch))
os.mkdir(os.path.join(include_dir, 'sys'))
os.mkdir(os.path.join(include_dir, 'mach'))
# Needed for patch to work, although can be fixed with TMPDIR
os.mkdir(os.path.join(self.tmp_dir, 'tmp'))
def stage0_posix_checksum(self):
"""Early checksum files"""
shutil.copy2(os.path.join(self.sysa_dir, 'stage0-posix', 'checksums'),
os.path.join(self.after_dir, 'stage0-posix-checksums'))
def deploy_extra_files(self):
"""Deploy misc files"""
extra_files = ['helpers.sh', 'run.sh', 'run2.sh']
@ -250,13 +215,6 @@ class SysA:
shutil.copy2(os.path.join(self.git_dir, 'SHA256SUMS.sources'), self.after_dir)
def mes(self):
"""GNU Mes"""
copytree(os.path.join(self.sysa_dir, 'mes'), self.after_dir)
mes_dir = os.path.join(self.after_dir, 'mes', 'src', 'mes')
os.mkdir(os.path.join(mes_dir, 'bin'))
os.mkdir(os.path.join(mes_dir, 'm2'))
def tcc_0_9_26(self):
"""TinyCC 0.9.26 (patched by janneke)"""
copytree(os.path.join(self.sysa_dir, 'tcc-0.9.26'), self.after_dir)
@ -265,6 +223,11 @@ class SysA:
def get_packages(self):
"""Prepare remaining sources"""
# mes-0.22 snapshot with m2 fixes
self.get_file(["https://github.com/oriansj/mes-m2/archive/a7522f26ee020dc498219d0122ea1b7d345bcdd5.tar.gz",
"https://download.savannah.gnu.org/releases/nyacc/nyacc-1.00.2.tar.gz"],
output=["mes.tar.gz", "nyacc-1.00.2.tar.gz"])
# gzip 1.2.4
self.get_file("https://mirrors.kernel.org/gnu/gzip/gzip-1.2.4.tar", mkbuild=True)