Simple Directmedia Layer
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add build-release.py updates from satellite libraries

[ci skip]

+58 -21
-1
.github/workflows/release.yml
··· 600 600 -DCMAKE_PREFIX_PATH="${{ steps.sdk.outputs.prefix }}" \ 601 601 -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \ 602 602 -DANDROID_ABI=${android_abi} \ 603 - -Werror=dev \ 604 603 -DCMAKE_BUILD_TYPE=Release \ 605 604 -B "${android_abi}" 606 605 echo "Building ${android_abi}..."
+51 -13
build-scripts/build-release.py
··· 328 328 return text 329 329 330 330 331 + def configure_text_list(text_list: list[str], context: dict[str, str]) -> list[str]: 332 + return [configure_text(text=e, context=context) for e in text_list] 333 + 334 + 331 335 class ArchiveFileTree: 332 336 def __init__(self): 333 337 self._tree: dict[str, NodeInArchive] = {} ··· 343 347 added_files = dict() 344 348 345 349 def calculate_symlink_target(s: NodeInArchive) -> str: 346 - dest_dir = os.path.dirname(s.path) 350 + dest_dir = os.path.dirname(s.arcpath) 347 351 if dest_dir: 348 352 dest_dir += "/" 349 353 target = dest_dir + s.symtarget ··· 357 361 358 362 # Add files in first pass 359 363 for arcpath, node in self._tree.items(): 364 + assert node is not None, f"{arcpath} -> node" 360 365 if node.data is not None: 361 366 archiver.add_file_data(arcpath=arc_join(archive_base, arcpath), data=node.data, time=node.time, mode=node.mode) 362 - added_files[node.path] = node 367 + assert node.arcpath is not None, f"{node=}" 368 + added_files[node.arcpath] = node 363 369 elif node.path is not None: 364 370 archiver.add_file_path(arcpath=arc_join(archive_base, arcpath), path=node.path) 365 - added_files[node.path] = node 371 + assert node.arcpath is not None, f"{node=}" 372 + added_files[node.arcpath] = node 366 373 elif node.symtarget is not None: 367 374 remaining_symlinks.add(node) 368 375 elif node.directory: 369 376 pass 370 377 else: 371 378 raise ValueError(f"Invalid Archive Node: {repr(node)}") 379 + 380 + assert None not in added_files 372 381 373 382 # Resolve symlinks in second pass: zipfile does not support symlinks, so add files to zip archive 374 383 while True: ··· 380 389 symlink_files_for_zip = {} 381 390 symlink_target_path = calculate_symlink_target(symlink) 382 391 if symlink_target_path in added_files: 383 - symlink_files_for_zip[symlink.path] = added_files[symlink_target_path] 392 + symlink_files_for_zip[symlink.arcpath] = added_files[symlink_target_path] 384 393 else: 385 394 symlink_target_path_slash = symlink_target_path + "/" 386 395 for added_file in added_files: 387 396 if added_file.startswith(symlink_target_path_slash): 388 - path_in_symlink = symlink.path + "/" + added_file.removeprefix(symlink_target_path_slash) 397 + path_in_symlink = symlink.arcpath + "/" + added_file.removeprefix(symlink_target_path_slash) 389 398 symlink_files_for_zip[path_in_symlink] = added_files[added_file] 390 399 if symlink_files_for_zip: 391 400 symlinks_this_time.add(symlink) 392 401 extra_added_files.update(symlink_files_for_zip) 393 402 files_for_zip = [{"arcpath": f"{archive_base}/{sym_path}", "data": sym_info.data, "mode": sym_info.mode} for sym_path, sym_info in symlink_files_for_zip.items()] 394 - archiver.add_symlink(arcpath=f"{archive_base}/{symlink.path}", target=symlink.symtarget, time=symlink.time, files_for_zip=files_for_zip) 403 + archiver.add_symlink(arcpath=f"{archive_base}/{symlink.arcpath}", target=symlink.symtarget, time=symlink.time, files_for_zip=files_for_zip) 395 404 # if not symlinks_this_time: 396 405 # logger.info("files added: %r", set(path for path in added_files.keys())) 397 406 assert symlinks_this_time, f"No targets found for symlinks: {remaining_symlinks}" ··· 545 554 "PROJECT_VERSION": self.version, 546 555 "PROJECT_COMMIT": self.commit, 547 556 "PROJECT_REVISION": self.revision, 557 + "PROJECT_ROOT": str(self.root), 548 558 } 549 559 if extra_context: 550 560 ctx.update(extra_context) ··· 741 751 install_path = build_parent_dir / f"install-{triplet}" 742 752 shutil.rmtree(install_path, ignore_errors=True) 743 753 build_path.mkdir(parents=True, exist_ok=True) 754 + context = self.get_context({ 755 + "ARCH": arch, 756 + "DEP_PREFIX": str(mingw_deps_path / triplet), 757 + }) 758 + extra_args = configure_text_list(text_list=self.release_info["mingw"]["autotools"]["args"], context=context) 759 + 744 760 with self.section_printer.group(f"Configuring MinGW {triplet} (autotools)"): 745 - extra_args = [arg.replace("@DEP_PREFIX@", str(mingw_deps_path / triplet)) for arg in self.release_info["mingw"]["autotools"]["args"]] 746 761 assert "@" not in " ".join(extra_args), f"@ should not be present in extra arguments ({extra_args})" 747 762 self.executer.run([ 748 763 self.root / "configure", 749 764 f"--prefix={install_path}", 750 - f"--includedir={install_path}/include", 751 - f"--libdir={install_path}/lib", 752 - f"--bindir={install_path}/bin", 765 + f"--includedir=${{prefix}}/include", 766 + f"--libdir=${{prefix}}/lib", 767 + f"--bindir=${{prefix}}/bin", 753 768 f"--host={triplet}", 754 769 f"--build=x86_64-none-linux-gnu", 755 770 ] + extra_args, cwd=build_path, env=new_env) ··· 757 772 self.executer.run(["make", f"-j{self.cpu_count}"], cwd=build_path, env=new_env) 758 773 with self.section_printer.group(f"Install MinGW {triplet} (autotools)"): 759 774 self.executer.run(["make", "install"], cwd=build_path, env=new_env) 760 - archive_file_tree.add_directory_tree(arc_dir=arc_join(arc_root, triplet), path=install_path) 775 + archive_file_tree.add_directory_tree(arc_dir=arc_join(arc_root, triplet), path=install_path, time=self.arc_time) 776 + 777 + print("Recording arch-dependent extra files for MinGW development archive ...") 778 + extra_context = { 779 + "TRIPLET": ARCH_TO_TRIPLET[arch], 780 + } 781 + archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["mingw"]["autotools"].get("files", {}), file_mapping_root=self.root, context=self.get_context(extra_context=extra_context), time=self.arc_time) 761 782 762 783 if "cmake" in self.release_info["mingw"]: 763 784 assert self.release_info["mingw"]["cmake"]["shared-static"] in ("args", "both") ··· 770 791 assert arch not in mingw_archs 771 792 mingw_archs.add(arch) 772 793 794 + context = self.get_context({ 795 + "ARCH": arch, 796 + "DEP_PREFIX": str(mingw_deps_path / triplet), 797 + }) 798 + extra_args = configure_text_list(text_list=self.release_info["mingw"]["cmake"]["args"], context=context) 799 + 773 800 build_path = build_parent_dir / f"build-{triplet}" 774 801 install_path = build_parent_dir / f"install-{triplet}" 775 802 shutil.rmtree(install_path, ignore_errors=True) ··· 780 807 args_for_shared_static = (["-DBUILD_SHARED_LIBS=ON"], ["-DBUILD_SHARED_LIBS=OFF"]) 781 808 for arg_for_shared_static in args_for_shared_static: 782 809 with self.section_printer.group(f"Configuring MinGW {triplet} (CMake)"): 783 - extra_args = [arg.replace("@DEP_PREFIX@", str(mingw_deps_path / triplet)) for arg in self.release_info["mingw"]["cmake"]["args"]] 784 810 assert "@" not in " ".join(extra_args), f"@ should not be present in extra arguments ({extra_args})" 785 811 self.executer.run([ 786 812 f"cmake", ··· 802 828 with self.section_printer.group(f"Install MinGW {triplet} (CMake)"): 803 829 self.executer.run(["cmake", "--install", str(build_path)], cwd=build_path, env=new_env) 804 830 archive_file_tree.add_directory_tree(arc_dir=arc_join(arc_root, triplet), path=install_path, time=self.arc_time) 831 + 832 + print("Recording arch-dependent extra files for MinGW development archive ...") 833 + extra_context = { 834 + "TRIPLET": ARCH_TO_TRIPLET[arch], 835 + } 836 + archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["mingw"]["cmake"].get("files", {}), file_mapping_root=self.root, context=self.get_context(extra_context=extra_context), time=self.arc_time) 837 + print("... done") 805 838 806 839 print("Recording extra files for MinGW development archive ...") 807 840 archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["mingw"].get("files", {}), file_mapping_root=self.root, context=self.get_context(), time=self.arc_time) ··· 1231 1264 zip_path = self.dist_path / f"{self.project}-devel-{self.version}-VC.zip" 1232 1265 arc_root = f"{self.project}-{self.version}" 1233 1266 1267 + def copy_files_devel(ctx): 1268 + archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["msvc"]["files-devel"], file_mapping_root=self.root, context=ctx, time=self.arc_time) 1269 + 1270 + 1234 1271 logger.info("Collecting files...") 1235 1272 archive_file_tree = ArchiveFileTree() 1236 1273 if "msbuild" in self.release_info["msvc"]: ··· 1238 1275 arch_platform = self._arch_to_vs_platform(arch=arch) 1239 1276 platform_context = self.get_context(arch_platform.extra_context()) 1240 1277 archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["msvc"]["msbuild"]["files-devel"], file_mapping_root=self.root, context=platform_context, time=self.arc_time) 1278 + copy_files_devel(ctx=platform_context) 1241 1279 if "cmake" in self.release_info["msvc"]: 1242 1280 for arch in self.release_info["msvc"]["cmake"]["archs"]: 1243 1281 arch_platform = self._arch_to_vs_platform(arch=arch) 1244 1282 platform_context = self.get_context(arch_platform.extra_context()) 1245 1283 archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["msvc"]["cmake"]["files-devel"], file_mapping_root=self._arch_platform_to_install_path(arch_platform), context=platform_context, time=self.arc_time) 1246 - archive_file_tree.add_file_mapping(arc_dir=arc_root, file_mapping=self.release_info["msvc"]["files-devel"], file_mapping_root=self.root, context=self.get_context(), time=self.arc_time) 1284 + copy_files_devel(ctx=platform_context) 1247 1285 1248 1286 with Archiver(zip_path=zip_path) as archiver: 1249 1287 archive_file_tree.add_to_archiver(archive_base="", archiver=archiver)
+1 -1
build-scripts/pkg-support/android/cmake/SDL3Config.cmake
··· 1 1 # SDL CMake configuration file: 2 2 # This file is meant to be placed in lib/cmake/SDL3 subfolder of a reconstructed Android SDL3 SDK 3 3 4 - cmake_minimum_required(VERSION 3.0...3.5) 4 + cmake_minimum_required(VERSION 3.0...3.28) 5 5 6 6 include(FeatureSummary) 7 7 set_package_properties(SDL3 PROPERTIES
+1 -1
build-scripts/pkg-support/msvc/cmake/SDL3Config.cmake.in
··· 1 1 # @<@PROJECT_NAME@>@ CMake configuration file: 2 2 # This file is meant to be placed in a cmake subfolder of @<@PROJECT_NAME@>@-devel-@<@PROJECT_VERSION@>@-VC.zip 3 3 4 - cmake_minimum_required(VERSION 3.0...3.5) 4 + cmake_minimum_required(VERSION 3.0...3.28) 5 5 6 6 include(FeatureSummary) 7 7 set_package_properties(SDL3 PROPERTIES
+1 -1
cmake/android/FindSdlAndroid.cmake
··· 61 61 62 62 #]=======================================================================] 63 63 64 - cmake_minimum_required(VERSION 3.7) 64 + cmake_minimum_required(VERSION 3.7...3.28) 65 65 66 66 if(NOT PROJECT_NAME MATCHES "^SDL.*") 67 67 message(WARNING "This module is internal to SDL and is currently not supported.")
+1 -1
cmake/android/FindSdlAndroidBuildTools.cmake
··· 52 52 53 53 #]=======================================================================] 54 54 55 - cmake_minimum_required(VERSION 3.7) 55 + cmake_minimum_required(VERSION 3.7...3.28) 56 56 57 57 if(NOT PROJECT_NAME MATCHES "^SDL.*") 58 58 message(WARNING "This module is internal to SDL and is currently not supported.")
+1 -1
cmake/android/FindSdlAndroidPlatform.cmake
··· 55 55 56 56 #]=======================================================================] 57 57 58 - cmake_minimum_required(VERSION 3.7) 58 + cmake_minimum_required(VERSION 3.7...3.28) 59 59 60 60 if(NOT PROJECT_NAME MATCHES "^SDL.*") 61 61 message(WARNING "This module is internal to SDL and is currently not supported.")
+1 -1
cmake/android/SdlAndroidFunctions.cmake
··· 5 5 6 6 #]=======================================================================] 7 7 8 - cmake_minimum_required(VERSION 3.7) 8 + cmake_minimum_required(VERSION 3.7...3.28) 9 9 10 10 if(NOT PROJECT_NAME MATCHES "^SDL.*") 11 11 message(WARNING "This module is internal to SDL and is currently not supported.")
+1 -1
cmake/android/SdlAndroidScript.cmake
··· 6 6 7 7 #]=======================================================================] 8 8 9 - cmake_minimum_required(VERSION 3.16) 9 + cmake_minimum_required(VERSION 3.16...3.28) 10 10 11 11 if(NOT CMAKE_SCRIPT_MODE_FILE) 12 12 message(FATAL_ERROR "This file can only be used in CMake script mode")