Simple Directmedia Layer

Update build-scripts/build-release.py

Changed files
+20 -2
build-scripts
+20 -2
build-scripts/build-release.py
··· 339 339 def add_file(self, file: NodeInArchive): 340 340 self._tree[file.arcpath] = file 341 341 342 + def __iter__(self) -> typing.Iterable[NodeInArchive]: 343 + yield from self._tree.values() 344 + 345 + def __contains__(self, value: str) -> bool: 346 + return value in self._tree 347 + 342 348 def get_latest_mod_time(self) -> datetime.datetime: 343 349 return max(item.time for item in self._tree.values() if item.time) 344 350 ··· 353 359 target = dest_dir + s.symtarget 354 360 while True: 355 361 new_target, n = re.subn(r"([^/]+/+[.]{2}/)", "", target) 356 - print(f"{target=} {new_target=}") 357 362 target = new_target 358 363 if not n: 359 364 break ··· 587 592 def create_source_archives(self) -> None: 588 593 source_collector = SourceCollector(root=self.root, commit=self.commit, executer=self.executer, filter=self._path_filter) 589 594 print(f"Collecting sources of {self.project}...") 590 - archive_tree = source_collector.get_archive_file_tree() 595 + archive_tree: ArchiveFileTree = source_collector.get_archive_file_tree() 591 596 latest_mod_time = archive_tree.get_latest_mod_time() 592 597 archive_tree.add_file(NodeInArchive.from_text(arcpath=REVISION_TXT, text=f"{self.revision}\n", time=latest_mod_time)) 593 598 archive_tree.add_file(NodeInArchive.from_text(arcpath=f"{GIT_HASH_FILENAME}", text=f"{self.commit}\n", time=latest_mod_time)) 594 599 archive_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["source"].get("files", {}), file_mapping_root=self.root, context=self.get_context(), time=latest_mod_time) 600 + 601 + if "Makefile.am" in archive_tree: 602 + patched_time = latest_mod_time + datetime.timedelta(minutes=1) 603 + print(f"Makefile.am detected -> touching aclocal.m4, */Makefile.in, configure") 604 + for node_data in archive_tree: 605 + arc_name = os.path.basename(node_data.arcpath) 606 + arc_name_we, arc_name_ext = os.path.splitext(arc_name) 607 + if arc_name in ("aclocal.m4", "configure", "Makefile.in"): 608 + print(f"Bumping time of {node_data.arcpath}") 609 + node_data.time = patched_time 595 610 596 611 archive_base = f"{self.project}-{self.version}" 597 612 zip_path = self.dist_path / f"{archive_base}.zip" ··· 767 782 f"--bindir=${{prefix}}/bin", 768 783 f"--host={triplet}", 769 784 f"--build=x86_64-none-linux-gnu", 785 + "CFLAGS=-O2", 786 + "CXXFLAGS=-O2", 787 + "LDFLAGS=-Wl,-s", 770 788 ] + extra_args, cwd=build_path, env=new_env) 771 789 with self.section_printer.group(f"Build MinGW {triplet} (autotools)"): 772 790 self.executer.run(["make", f"-j{self.cpu_count}"], cwd=build_path, env=new_env)