diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c42905a6..3e5fff72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,6 +51,14 @@ jobs: with: name: sources path: '${{ github.workspace}}/dist' + - name: 'Generate summary' + run: | + echo "Run the following commands to download all artifacts:" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + echo "mkdir -p /tmp/${{ steps.releaser.outputs.project }}-${{ steps.releaser.outputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "cd /tmp/${{ steps.releaser.outputs.project }}-${{ steps.releaser.outputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "gh run -R ${{ github.repository }} download ${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY linux-verify: needs: [src] @@ -104,6 +112,22 @@ jobs: --root "${{ steps.tar.outputs.path }}" \ --github \ --debug + - name: 'Install Linux dependencies' + run: | + sudo apt-get update -y + sudo apt-get install -y \ + gnome-desktop-testing libasound2-dev libpulse-dev libaudio-dev libjack-dev libsndio-dev \ + libusb-1.0-0-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev \ + libxss-dev libwayland-dev libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev \ + libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev fcitx-libs-dev \ + libflac-dev \ + fluidsynth libfluidsynth-dev \ + libgme-dev \ + libmpg123-dev \ + libopusfile-dev \ + libvorbis-dev \ + libxmp-dev \ + libwavpack-dev - name: 'Extract dependencies, build and install them' id: deps-build run: | @@ -235,7 +259,7 @@ jobs: echo "mount-point=${mount_point}">>$GITHUB_OUTPUT - name: 'Verify presence of optional frameworks' run: | - OPTIONAL_FRAMEWORKS="FLAC gme mpg123 ogg opus vorbis wavpack xmp" + OPTIONAL_FRAMEWORKS="gme opus wavpack xmp" rc=0 for opt in $OPTIONAL_FRAMEWORKS; do fw_path="${{ steps.mount.outputs.mount-point }}/optional/${opt}.xcframework" @@ -695,7 +719,9 @@ jobs: - name: 'Extract Android SDK from AAR' id: sdk run: | - python "${{ github.workspace }}/${{ needs.android.outputs.android-aar }}" -o /tmp/deps-android + unzip -o "${{ github.workspace }}/${{ needs.android.outputs.android-aar }}" + python "${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}.aar" -o /tmp/SDL3_mixer-android + echo "prefix=/tmp/SDL3_mixer-android" >>$GITHUB_OUTPUT - name: 'Download dependencies' id: deps env: @@ -710,7 +736,9 @@ jobs: - name: 'Extract dependencies' id: deps-extract run: | - python "${{ steps.deps.outputs.dep-path }}/SDL3-${{ steps.deps.outputs.dep-sdl-version }}.aar" -o /tmp/deps-android + unzip -o "${{ steps.deps.outputs.dep-path }}/SDL3-devel-${{ steps.deps.outputs.dep-sdl-version }}-android.zip" + python "SDL3-${{ steps.deps.outputs.dep-sdl-version }}.aar" -o /tmp/SDL3-android + echo "sdl3-prefix=/tmp/SDL3-android" >>$GITHUB_OUTPUT - name: 'Install ninja' run: | sudo apt-get update -y @@ -724,10 +752,9 @@ jobs: -GNinja \ -DTEST_FULL=TRUE \ -DTEST_STATIC=FALSE \ - -DCMAKE_PREFIX_PATH="/tmp/deps-android" \ + -DCMAKE_PREFIX_PATH="${{ steps.sdk.outputs.prefix }};${{ steps.deps-extract.outputs.sdl3-prefix }}" \ -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \ -DANDROID_ABI=${android_abi} \ - -Werror=dev \ -DCMAKE_BUILD_TYPE=Release \ -B "${android_abi}" echo "Building ${android_abi}..." diff --git a/CMakeLists.txt b/CMakeLists.txt index ed1b20be..9c4ccaa7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.16...3.28) if(NOT DEFINED CMAKE_BUILD_TYPE) set(cmake_build_type_undefined 1) @@ -321,7 +321,7 @@ if(NOT ANDROID) VERSION "${SO_VERSION}" ) if(APPLE) - cmake_minimum_required(VERSION 3.17) + cmake_minimum_required(VERSION 3.17...3.28) set_target_properties(${sdl3_mixer_target_name} PROPERTIES MACHO_COMPATIBILITY_VERSION "${DYLIB_COMPAT_VERSION}" MACHO_CURRENT_VERSION "${DYLIB_CURRENT_VERSION}" @@ -702,7 +702,9 @@ if(SDLMIXER_GME) sdl_check_project_in_subfolder(external/libgme libgme SDLMIXER_VENDORED) enable_language(CXX) add_subdirectory(external/libgme EXCLUDE_FROM_ALL) - add_library(gme::gme ALIAS gme) + if(NOT TARGET gme::gme) + add_library(gme::gme ALIAS gme) + endif() if(SDLMIXER_GME_SHARED OR NOT SDLMIXER_BUILD_SHARED_LIBS) list(APPEND INSTALL_EXTRA_TARGETS gme) endif() diff --git a/VisualC/native_midi/native_midi.vcxproj b/VisualC/native_midi/native_midi.vcxproj index 6ef2a1ec..2c03554a 100644 --- a/VisualC/native_midi/native_midi.vcxproj +++ b/VisualC/native_midi/native_midi.vcxproj @@ -102,7 +102,7 @@ ..\..\include;..\..\src\codecs\native_midi;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreaded Level3 StreamingSIMDExtensions @@ -116,7 +116,7 @@ Disabled ..\..\include;..\..\src\codecs\native_midi;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebug Level3 OldStyle StreamingSIMDExtensions @@ -133,7 +133,7 @@ ..\..\include;..\..\src\codecs\native_midi;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreaded Level3 StreamingSIMDExtensions @@ -150,7 +150,7 @@ Disabled ..\..\include;..\..\src\codecs\native_midi;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebug Level3 OldStyle StreamingSIMDExtensions diff --git a/VisualC/timidity/timidity.vcxproj b/VisualC/timidity/timidity.vcxproj index 20eed668..3c4d695f 100644 --- a/VisualC/timidity/timidity.vcxproj +++ b/VisualC/timidity/timidity.vcxproj @@ -126,7 +126,7 @@ $(ProjectDir)..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreaded Level3 StreamingSIMDExtensions @@ -140,7 +140,7 @@ Disabled $(ProjectDir)..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebug Level3 OldStyle StreamingSIMDExtensions @@ -157,7 +157,7 @@ $(ProjectDir)..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreaded Level3 StreamingSIMDExtensions @@ -174,7 +174,7 @@ Disabled $(ProjectDir)..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - MultiThreadedDLL + MultiThreadedDebug Level3 OldStyle StreamingSIMDExtensions diff --git a/Xcode/pkg-support/resources/CMake/SDL3_mixerConfig.cmake b/Xcode/pkg-support/resources/CMake/SDL3_mixerConfig.cmake index 2194d704..2fc55846 100644 --- a/Xcode/pkg-support/resources/CMake/SDL3_mixerConfig.cmake +++ b/Xcode/pkg-support/resources/CMake/SDL3_mixerConfig.cmake @@ -2,7 +2,7 @@ # This file is meant to be placed in Resources/CMake of a SDL3_mixer framework # INTERFACE_LINK_OPTIONS needs CMake 3.12 -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.12...3.28) include(FeatureSummary) set_package_properties(SDL3_mixer PROPERTIES diff --git a/Xcode/pkg-support/share/cmake/SDL3_mixer/SDL3_mixerConfig.cmake b/Xcode/pkg-support/share/cmake/SDL3_mixer/SDL3_mixerConfig.cmake index b524e4b8..d6474c3d 100644 --- a/Xcode/pkg-support/share/cmake/SDL3_mixer/SDL3_mixerConfig.cmake +++ b/Xcode/pkg-support/share/cmake/SDL3_mixer/SDL3_mixerConfig.cmake @@ -2,7 +2,7 @@ # This file is meant to be placed in share/cmake/SDL3_mixer, next to SDL3_mixer.xcframework # INTERFACE_LINK_OPTIONS needs CMake 3.12 -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.12...3.28) include(FeatureSummary) set_package_properties(SDL3_mixer PROPERTIES diff --git a/Xcode/pkg-support/share/cmake/SDL3_mixer/SDL3_mixerConfigVersion.cmake b/Xcode/pkg-support/share/cmake/SDL3_mixer/SDL3_mixerConfigVersion.cmake index 71c45bf1..9449e6f1 100644 --- a/Xcode/pkg-support/share/cmake/SDL3_mixer/SDL3_mixerConfigVersion.cmake +++ b/Xcode/pkg-support/share/cmake/SDL3_mixer/SDL3_mixerConfigVersion.cmake @@ -3,7 +3,7 @@ # SDL CMake version configuration file: # This file is meant to be placed in share/cmake/SDL3_mixer, next to SDL3_mixer.xcframework -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.12...3.28) get_filename_component(_sdl3_mixer_xcframework_parent_path "${CMAKE_CURRENT_LIST_DIR}" REALPATH) # /share/cmake/SDL3_mixer/ get_filename_component(_sdl3_mixer_xcframework_parent_path "${_sdl3_mixer_xcframework_parent_path}" REALPATH) # /share/cmake/SDL3_mixer/ diff --git a/Xcode/xmp/xmp.xcodeproj/project.pbxproj b/Xcode/xmp/xmp.xcodeproj/project.pbxproj index 52a58b18..6557f0ab 100644 --- a/Xcode/xmp/xmp.xcodeproj/project.pbxproj +++ b/Xcode/xmp/xmp.xcodeproj/project.pbxproj @@ -199,8 +199,8 @@ F33AA32D2881F70D00F836D8 /* it_load.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = it_load.c; path = ../../external/libxmp/src/loaders/it_load.c; sourceTree = ""; }; F33AA32E2881F70D00F836D8 /* xm_load.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = xm_load.c; path = ../../external/libxmp/src/loaders/xm_load.c; sourceTree = ""; }; F33AA3302881F70D00F836D8 /* s3m_load.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = s3m_load.c; path = ../../external/libxmp/src/loaders/s3m_load.c; sourceTree = ""; }; - F341229E2D406C2000D6C2B7 /* rng.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = rng.c; path = /Users/valve/projects/SDL_mixer/external/libxmp/src/rng.c; sourceTree = ""; }; - F34122A02D406C6500D6C2B7 /* flow.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = flow.c; path = /Users/valve/projects/SDL_mixer/external/libxmp/src/flow.c; sourceTree = ""; }; + F341229E2D406C2000D6C2B7 /* rng.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = rng.c; path = ../../external/libxmp/src/rng.c; sourceTree = ""; }; + F34122A02D406C6500D6C2B7 /* flow.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = flow.c; path = ../../external/libxmp/src/flow.c; sourceTree = ""; }; F3968D85281FBB1900661875 /* xmp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = xmp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; F3E29CE52881FB370006D108 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README; path = ../../external/libxmp/README; sourceTree = ""; }; F3E29CE72881FB610006D108 /* format.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = format.c; path = ../../external/libxmp/src/format.c; sourceTree = ""; }; diff --git a/build-scripts/build-release.py b/build-scripts/build-release.py index fe4db21f..f3faa06c 100755 --- a/build-scripts/build-release.py +++ b/build-scripts/build-release.py @@ -330,6 +330,10 @@ def configure_text(text: str, context: dict[str, str]) -> str: return text +def configure_text_list(text_list: list[str], context: dict[str, str]) -> list[str]: + return [configure_text(text=e, context=context) for e in text_list] + + class ArchiveFileTree: def __init__(self): self._tree: dict[str, NodeInArchive] = {} @@ -337,6 +341,12 @@ def __init__(self): def add_file(self, file: NodeInArchive): self._tree[file.arcpath] = file + def __iter__(self) -> typing.Iterable[NodeInArchive]: + yield from self._tree.values() + + def __contains__(self, value: str) -> bool: + return value in self._tree + def get_latest_mod_time(self) -> datetime.datetime: return max(item.time for item in self._tree.values() if item.time) @@ -345,13 +355,12 @@ def add_to_archiver(self, archive_base: str, archiver: Archiver): added_files = dict() def calculate_symlink_target(s: NodeInArchive) -> str: - dest_dir = os.path.dirname(s.path) + dest_dir = os.path.dirname(s.arcpath) if dest_dir: dest_dir += "/" target = dest_dir + s.symtarget while True: new_target, n = re.subn(r"([^/]+/+[.]{2}/)", "", target) - print(f"{target=} {new_target=}") target = new_target if not n: break @@ -359,12 +368,15 @@ def calculate_symlink_target(s: NodeInArchive) -> str: # Add files in first pass for arcpath, node in self._tree.items(): + assert node is not None, f"{arcpath} -> node" if node.data is not None: archiver.add_file_data(arcpath=arc_join(archive_base, arcpath), data=node.data, time=node.time, mode=node.mode) - added_files[node.path] = node + assert node.arcpath is not None, f"{node=}" + added_files[node.arcpath] = node elif node.path is not None: archiver.add_file_path(arcpath=arc_join(archive_base, arcpath), path=node.path) - added_files[node.path] = node + assert node.arcpath is not None, f"{node=}" + added_files[node.arcpath] = node elif node.symtarget is not None: remaining_symlinks.add(node) elif node.directory: @@ -372,6 +384,8 @@ def calculate_symlink_target(s: NodeInArchive) -> str: else: raise ValueError(f"Invalid Archive Node: {repr(node)}") + assert None not in added_files + # Resolve symlinks in second pass: zipfile does not support symlinks, so add files to zip archive while True: if not remaining_symlinks: @@ -382,18 +396,18 @@ def calculate_symlink_target(s: NodeInArchive) -> str: symlink_files_for_zip = {} symlink_target_path = calculate_symlink_target(symlink) if symlink_target_path in added_files: - symlink_files_for_zip[symlink.path] = added_files[symlink_target_path] + symlink_files_for_zip[symlink.arcpath] = added_files[symlink_target_path] else: symlink_target_path_slash = symlink_target_path + "/" for added_file in added_files: if added_file.startswith(symlink_target_path_slash): - path_in_symlink = symlink.path + "/" + added_file.removeprefix(symlink_target_path_slash) + path_in_symlink = symlink.arcpath + "/" + added_file.removeprefix(symlink_target_path_slash) symlink_files_for_zip[path_in_symlink] = added_files[added_file] if symlink_files_for_zip: symlinks_this_time.add(symlink) extra_added_files.update(symlink_files_for_zip) 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()] - archiver.add_symlink(arcpath=f"{archive_base}/{symlink.path}", target=symlink.symtarget, time=symlink.time, files_for_zip=files_for_zip) + archiver.add_symlink(arcpath=f"{archive_base}/{symlink.arcpath}", target=symlink.symtarget, time=symlink.time, files_for_zip=files_for_zip) # if not symlinks_this_time: # logger.info("files added: %r", set(path for path in added_files.keys())) assert symlinks_this_time, f"No targets found for symlinks: {remaining_symlinks}" @@ -520,6 +534,15 @@ def _get_file_times(self, paths: tuple[str, ...]) -> dict[str, datetime.datetime return path_times +class AndroidApiVersion: + def __init__(self, name: str, ints: tuple[int, ...]): + self.name = name + self.ints = ints + + def __repr__(self) -> str: + return f"<{self.name} ({'.'.join(str(v) for v in self.ints)})>" + + class Releaser: def __init__(self, release_info: dict, commit: str, revision: str, root: Path, dist_path: Path, section_printer: SectionPrinter, executer: Executer, cmake_generator: str, deps_path: Path, overwrite: bool, github: bool, fast: bool): self.release_info = release_info @@ -547,6 +570,7 @@ def get_context(self, extra_context: typing.Optional[dict[str, str]]=None) -> di "PROJECT_VERSION": self.version, "PROJECT_COMMIT": self.commit, "PROJECT_REVISION": self.revision, + "PROJECT_ROOT": str(self.root), } if extra_context: ctx.update(extra_context) @@ -579,12 +603,22 @@ def _external_repo_path_filter(cls, path: str) -> bool: def create_source_archives(self) -> None: source_collector = SourceCollector(root=self.root, commit=self.commit, executer=self.executer, filter=self._path_filter) print(f"Collecting sources of {self.project}...") - archive_tree = source_collector.get_archive_file_tree() + archive_tree: ArchiveFileTree = source_collector.get_archive_file_tree() latest_mod_time = archive_tree.get_latest_mod_time() archive_tree.add_file(NodeInArchive.from_text(arcpath=REVISION_TXT, text=f"{self.revision}\n", time=latest_mod_time)) archive_tree.add_file(NodeInArchive.from_text(arcpath=f"{GIT_HASH_FILENAME}", text=f"{self.commit}\n", time=latest_mod_time)) 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) + if "Makefile.am" in archive_tree: + patched_time = latest_mod_time + datetime.timedelta(minutes=1) + print(f"Makefile.am detected -> touching aclocal.m4, */Makefile.in, configure") + for node_data in archive_tree: + arc_name = os.path.basename(node_data.arcpath) + arc_name_we, arc_name_ext = os.path.splitext(arc_name) + if arc_name in ("aclocal.m4", "configure", "Makefile.in"): + print(f"Bumping time of {node_data.arcpath}") + node_data.time = patched_time + archive_base = f"{self.project}-{self.version}" zip_path = self.dist_path / f"{archive_base}.zip" tgz_path = self.dist_path / f"{archive_base}.tar.gz" @@ -752,24 +786,38 @@ def extract_filter(member: tarfile.TarInfo, path: str, /): install_path = build_parent_dir / f"install-{triplet}" shutil.rmtree(install_path, ignore_errors=True) build_path.mkdir(parents=True, exist_ok=True) + context = self.get_context({ + "ARCH": arch, + "DEP_PREFIX": str(mingw_deps_path / triplet), + }) + extra_args = configure_text_list(text_list=self.release_info["mingw"]["autotools"]["args"], context=context) + with self.section_printer.group(f"Configuring MinGW {triplet} (autotools)"): - extra_args = [arg.replace("@DEP_PREFIX@", str(mingw_deps_path / triplet)) for arg in self.release_info["mingw"]["autotools"]["args"]] assert "@" not in " ".join(extra_args), f"@ should not be present in extra arguments ({extra_args})" self.executer.run([ self.root / "configure", f"--prefix={install_path}", - f"--includedir={install_path}/include", - f"--libdir={install_path}/lib", - f"--bindir={install_path}/bin", + f"--includedir=${{prefix}}/include", + f"--libdir=${{prefix}}/lib", + f"--bindir=${{prefix}}/bin", f"--host={triplet}", f"--build=x86_64-none-linux-gnu", + "CFLAGS=-O2", + "CXXFLAGS=-O2", + "LDFLAGS=-Wl,-s", ] + extra_args, cwd=build_path, env=new_env) with self.section_printer.group(f"Build MinGW {triplet} (autotools)"): self.executer.run(["make", f"-j{self.cpu_count}"], cwd=build_path, env=new_env) with self.section_printer.group(f"Install MinGW {triplet} (autotools)"): self.executer.run(["make", "install"], cwd=build_path, env=new_env) self.verify_mingw_library(triplet=ARCH_TO_TRIPLET[arch], path=install_path / "bin" / f"{self.project}.dll") - archive_file_tree.add_directory_tree(arc_dir=arc_join(arc_root, triplet), path=install_path) + archive_file_tree.add_directory_tree(arc_dir=arc_join(arc_root, triplet), path=install_path, time=self.arc_time) + + print("Recording arch-dependent extra files for MinGW development archive ...") + extra_context = { + "TRIPLET": ARCH_TO_TRIPLET[arch], + } + 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) if "cmake" in self.release_info["mingw"]: assert self.release_info["mingw"]["cmake"]["shared-static"] in ("args", "both") @@ -782,6 +830,12 @@ def extract_filter(member: tarfile.TarInfo, path: str, /): assert arch not in mingw_archs mingw_archs.add(arch) + context = self.get_context({ + "ARCH": arch, + "DEP_PREFIX": str(mingw_deps_path / triplet), + }) + extra_args = configure_text_list(text_list=self.release_info["mingw"]["cmake"]["args"], context=context) + build_path = build_parent_dir / f"build-{triplet}" install_path = build_parent_dir / f"install-{triplet}" shutil.rmtree(install_path, ignore_errors=True) @@ -792,7 +846,6 @@ def extract_filter(member: tarfile.TarInfo, path: str, /): args_for_shared_static = (["-DBUILD_SHARED_LIBS=ON"], ["-DBUILD_SHARED_LIBS=OFF"]) for arg_for_shared_static in args_for_shared_static: with self.section_printer.group(f"Configuring MinGW {triplet} (CMake)"): - extra_args = [arg.replace("@DEP_PREFIX@", str(mingw_deps_path / triplet)) for arg in self.release_info["mingw"]["cmake"]["args"]] assert "@" not in " ".join(extra_args), f"@ should not be present in extra arguments ({extra_args})" self.executer.run([ f"cmake", @@ -816,6 +869,13 @@ def extract_filter(member: tarfile.TarInfo, path: str, /): self.verify_mingw_library(triplet=ARCH_TO_TRIPLET[arch], path=install_path / "bin" / f"{self.project}.dll") archive_file_tree.add_directory_tree(arc_dir=arc_join(arc_root, triplet), path=install_path, time=self.arc_time) + print("Recording arch-dependent extra files for MinGW development archive ...") + extra_context = { + "TRIPLET": ARCH_TO_TRIPLET[arch], + } + 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) + print("... done") + print("Recording extra files for MinGW development archive ...") 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) print("... done") @@ -834,22 +894,25 @@ def extract_filter(member: tarfile.TarInfo, path: str, /): self.artifacts["mingw-devel-tar-gz"] = tgz_path self.artifacts["mingw-devel-tar-xz"] = txz_path - def _detect_android_api(self, android_home: str) -> typing.Optional[int]: + def _detect_android_api(self, android_home: str) -> typing.Optional[AndroidApiVersion]: platform_dirs = list(Path(p) for p in glob.glob(f"{android_home}/platforms/android-*")) - re_platform = re.compile("android-([0-9]+)") - platform_versions = [] + re_platform = re.compile("^android-([0-9]+)(?:-ext([0-9]+))?$") + platform_versions: list[AndroidApiVersion] = [] for platform_dir in platform_dirs: logger.debug("Found Android Platform SDK: %s", platform_dir) + if not (platform_dir / "android.jar").is_file(): + logger.debug("Skipping SDK, missing android.jar") + continue if m:= re_platform.match(platform_dir.name): - platform_versions.append(int(m.group(1))) - platform_versions.sort() + platform_versions.append(AndroidApiVersion(name=platform_dir.name, ints=(int(m.group(1)), int(m.group(2) or 0)))) + platform_versions.sort(key=lambda v: v.ints) logger.info("Available platform versions: %s", platform_versions) - platform_versions = list(filter(lambda v: v >= self._android_api_minimum, platform_versions)) - logger.info("Valid platform versions (>=%d): %s", self._android_api_minimum, platform_versions) + platform_versions = list(filter(lambda v: v.ints >= self._android_api_minimum.ints, platform_versions)) + logger.info("Valid platform versions (>=%s): %s", self._android_api_minimum.ints, platform_versions) if not platform_versions: return None android_api = platform_versions[0] - logger.info("Selected API version %d", android_api) + logger.info("Selected API version %s", android_api) return android_api def _get_prefab_json_text(self) -> str: @@ -873,8 +936,19 @@ def _get_prefab_module_json_text(self, library_name: typing.Optional[str], expor return json.dumps(module_json_dict, indent=4) @property - def _android_api_minimum(self): - return self.release_info["android"]["api-minimum"] + def _android_api_minimum(self) -> AndroidApiVersion: + value = self.release_info["android"]["api-minimum"] + if isinstance(value, int): + ints = (value, ) + elif isinstance(value, str): + ints = tuple(split(".")) + else: + raise ValueError("Invalid android.api-minimum: must be X or X.Y") + match len(ints): + case 1: name = f"android-{ints[0]}" + case 2: name = f"android-{ints[0]}-ext-{ints[1]}" + case _: raise ValueError("Invalid android.api-minimum: must be X or X.Y") + return AndroidApiVersion(name=name, ints=ints) @property def _android_api_target(self): @@ -887,7 +961,7 @@ def _android_ndk_minimum(self): def _get_prefab_abi_json_text(self, abi: str, cpp: bool, shared: bool) -> str: abi_json_dict = { "abi": abi, - "api": self._android_api_minimum, + "api": self._android_api_minimum.ints[0], "ndk": self._android_ndk_minimum, "stl": "c++_shared" if cpp else "none", "static": not shared, @@ -900,7 +974,7 @@ def _get_android_manifest_text(self) -> str: xmlns:android="http://schemas.android.com/apk/res/android" package="org.libsdl.android.{self.project}" android:versionCode="1" android:versionName="1.0"> - """) @@ -910,7 +984,8 @@ def create_android_archives(self, android_api: int, android_home: Path, android_ if not cmake_toolchain_file.exists(): logger.error("CMake toolchain file does not exist (%s)", cmake_toolchain_file) raise SystemExit(1) - aar_path = self.dist_path / f"{self.project}-{self.version}.aar" + aar_path = self.root / "build-android" / f"{self.project}-{self.version}.aar" + android_dist_path = self.dist_path / f"{self.project}-devel-{self.version}-android.zip" android_abis = self.release_info["android"]["abis"] java_jars_added = False module_data_added = False @@ -918,14 +993,24 @@ def create_android_archives(self, android_api: int, android_home: Path, android_ shutil.rmtree(android_deps_path, ignore_errors=True) for dep, depinfo in self.release_info["android"].get("dependencies", {}).items(): - android_aar = self.deps_path / glob.glob(depinfo["artifact"], root_dir=self.deps_path)[0] - with self.section_printer.group(f"Extracting Android dependency {dep} ({android_aar.name})"): - self.executer.run([sys.executable, str(android_aar), "-o", str(android_deps_path)]) + dep_devel_zip = self.deps_path / glob.glob(depinfo["artifact"], root_dir=self.deps_path)[0] + + dep_extract_path = self.deps_path / f"extract/android/{dep}" + shutil.rmtree(dep_extract_path, ignore_errors=True) + dep_extract_path.mkdir(parents=True, exist_ok=True) + + with self.section_printer.group(f"Extracting Android dependency {dep} ({dep_devel_zip})"): + with zipfile.ZipFile(dep_devel_zip, "r") as zf: + zf.extractall(dep_extract_path) + + dep_devel_aar = dep_extract_path / glob.glob("*.aar", root_dir=dep_extract_path)[0] + self.executer.run([sys.executable, str(dep_devel_aar), "-o", str(android_deps_path)]) for module_name, module_info in self.release_info["android"]["modules"].items(): assert "type" in module_info and module_info["type"] in ("interface", "library"), f"module {module_name} must have a valid type" - archive_file_tree = ArchiveFileTree() + aar_file_tree = ArchiveFileTree() + android_devel_file_tree = ArchiveFileTree() for android_abi in android_abis: with self.section_printer.group(f"Building for Android {android_api} {android_abi}"): @@ -976,20 +1061,20 @@ def create_android_archives(self, android_api: int, android_home: Path, android_ assert library.suffix in (".so", ".a") assert library.is_file(), f"CMake should have built library '{library}' for module {module_name}" arcdir_prefab_libs = f"{arcdir_prefab_module}/libs/android.{android_abi}" - archive_file_tree.add_file(NodeInArchive.from_fs(arcpath=f"{arcdir_prefab_libs}/{library.name}", path=library, time=self.arc_time)) - archive_file_tree.add_file(NodeInArchive.from_text(arcpath=f"{arcdir_prefab_libs}/abi.json", text=self._get_prefab_abi_json_text(abi=android_abi, cpp=False, shared=library.suffix == ".so"), time=self.arc_time)) + aar_file_tree.add_file(NodeInArchive.from_fs(arcpath=f"{arcdir_prefab_libs}/{library.name}", path=library, time=self.arc_time)) + aar_file_tree.add_file(NodeInArchive.from_text(arcpath=f"{arcdir_prefab_libs}/abi.json", text=self._get_prefab_abi_json_text(abi=android_abi, cpp=False, shared=library.suffix == ".so"), time=self.arc_time)) if not module_data_added: library_name = None if module_info["type"] == "library": library_name = Path(module_info["library"]).stem.removeprefix("lib") export_libraries = module_info.get("export-libraries", []) - archive_file_tree.add_file(NodeInArchive.from_text(arcpath=arc_join(arcdir_prefab_module, "module.json"), text=self._get_prefab_module_json_text(library_name=library_name, export_libraries=export_libraries), time=self.arc_time)) + aar_file_tree.add_file(NodeInArchive.from_text(arcpath=arc_join(arcdir_prefab_module, "module.json"), text=self._get_prefab_module_json_text(library_name=library_name, export_libraries=export_libraries), time=self.arc_time)) arcdir_prefab_include = f"prefab/modules/{module_name}/include" if "includes" in module_info: - archive_file_tree.add_file_mapping(arc_dir=arcdir_prefab_include, file_mapping=module_info["includes"], file_mapping_root=install_dir, context=self.get_context(), time=self.arc_time) + aar_file_tree.add_file_mapping(arc_dir=arcdir_prefab_include, file_mapping=module_info["includes"], file_mapping_root=install_dir, context=self.get_context(), time=self.arc_time) else: - archive_file_tree.add_file(NodeInArchive.from_text(arcpath=arc_join(arcdir_prefab_include, ".keep"), text="\n", time=self.arc_time)) + aar_file_tree.add_file(NodeInArchive.from_text(arcpath=arc_join(arcdir_prefab_include, ".keep"), text="\n", time=self.arc_time)) module_data_added = True if not java_jars_added: @@ -1002,21 +1087,28 @@ def create_android_archives(self, android_api: int, android_home: Path, android_ assert sources_jar_path.is_file(), f"CMake should have archived the java sources into a JAR ({sources_jar_path})" assert doc_jar_path.is_file(), f"CMake should have archived javadoc into a JAR ({doc_jar_path})" - archive_file_tree.add_file(NodeInArchive.from_fs(arcpath="classes.jar", path=classes_jar_path, time=self.arc_time)) - archive_file_tree.add_file(NodeInArchive.from_fs(arcpath="classes-sources.jar", path=sources_jar_path, time=self.arc_time)) - archive_file_tree.add_file(NodeInArchive.from_fs(arcpath="classes-doc.jar", path=doc_jar_path, time=self.arc_time)) + aar_file_tree.add_file(NodeInArchive.from_fs(arcpath="classes.jar", path=classes_jar_path, time=self.arc_time)) + aar_file_tree.add_file(NodeInArchive.from_fs(arcpath="classes-sources.jar", path=sources_jar_path, time=self.arc_time)) + aar_file_tree.add_file(NodeInArchive.from_fs(arcpath="classes-doc.jar", path=doc_jar_path, time=self.arc_time)) assert ("jars" in self.release_info["android"] and java_jars_added) or "jars" not in self.release_info["android"], "Must have archived java JAR archives" - archive_file_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["android"].get("files", {}), file_mapping_root=self.root, context=self.get_context(), time=self.arc_time) + aar_file_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["android"]["aar-files"], file_mapping_root=self.root, context=self.get_context(), time=self.arc_time) - archive_file_tree.add_file(NodeInArchive.from_text(arcpath="prefab/prefab.json", text=self._get_prefab_json_text(), time=self.arc_time)) - archive_file_tree.add_file(NodeInArchive.from_text(arcpath="AndroidManifest.xml", text=self._get_android_manifest_text(), time=self.arc_time)) + aar_file_tree.add_file(NodeInArchive.from_text(arcpath="prefab/prefab.json", text=self._get_prefab_json_text(), time=self.arc_time)) + aar_file_tree.add_file(NodeInArchive.from_text(arcpath="AndroidManifest.xml", text=self._get_android_manifest_text(), time=self.arc_time)) with Archiver(zip_path=aar_path) as archiver: - archive_file_tree.add_to_archiver(archive_base="", archiver=archiver) + aar_file_tree.add_to_archiver(archive_base="", archiver=archiver) + archiver.add_git_hash(arcdir="", commit=self.commit, time=self.arc_time) + + android_devel_file_tree.add_file(NodeInArchive.from_fs(arcpath=aar_path.name, path=aar_path)) + android_devel_file_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["android"]["files"], file_mapping_root=self.root, context=self.get_context(), time=self.arc_time) + with Archiver(zip_path=android_dist_path) as archiver: + android_devel_file_tree.add_to_archiver(archive_base="", archiver=archiver) archiver.add_git_hash(arcdir="", commit=self.commit, time=self.arc_time) - self.artifacts[f"android-aar"] = aar_path + + self.artifacts[f"android-aar"] = android_dist_path def download_dependencies(self): shutil.rmtree(self.deps_path, ignore_errors=True) @@ -1053,7 +1145,7 @@ def verify_dependencies(self): assert len(msvc_matches) == 1, f"Exactly one archive matches msvc {dep} dependency: {msvc_matches}" if "android" in self.release_info: android_matches = glob.glob(self.release_info["android"]["dependencies"][dep]["artifact"], root_dir=self.deps_path) - assert len(android_matches) == 1, f"Exactly one archive matches msvc {dep} dependency: {msvc_matches}" + assert len(android_matches) == 1, f"Exactly one archive matches msvc {dep} dependency: {android_matches}" @staticmethod def _arch_to_vs_platform(arch: str, configuration: str="Release") -> VsArchPlatformConfig: @@ -1179,6 +1271,10 @@ def _build_msvc_cmake(self, arch_platform: VsArchPlatformConfig, dep_roots: list platform_context = self.get_context(extra_context=arch_platform.extra_context()) build_type = "Release" + extra_context = { + "ARCH": arch_platform.arch, + "PLATFORM": arch_platform.platform, + } built_paths = set(install_path / configure_text(f, context=platform_context) for file_mapping in (self.release_info["msvc"]["cmake"]["files-lib"], self.release_info["msvc"]["cmake"]["files-devel"]) for files_list in file_mapping.values() for f in files_list) logger.info("CMake builds these files, to be included in the package: %s", built_paths) @@ -1229,7 +1325,7 @@ def _build_msvc_cmake(self, arch_platform: VsArchPlatformConfig, dep_roots: list logger.info("Collecting files...") archive_file_tree = ArchiveFileTree() archive_file_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["msvc"]["cmake"]["files-lib"], file_mapping_root=install_path, context=platform_context, time=self.arc_time) - archive_file_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["msvc"]["files-lib"], file_mapping_root=self.root, context=self.get_context(), time=self.arc_time) + archive_file_tree.add_file_mapping(arc_dir="", file_mapping=self.release_info["msvc"]["files-lib"], file_mapping_root=self.root, context=self.get_context(extra_context=extra_context), time=self.arc_time) logger.info("Creating %s", zip_path) with Archiver(zip_path=zip_path) as archiver: @@ -1244,6 +1340,10 @@ def _build_msvc_devel(self) -> None: zip_path = self.dist_path / f"{self.project}-devel-{self.version}-VC.zip" arc_root = f"{self.project}-{self.version}" + def copy_files_devel(ctx): + 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) + + logger.info("Collecting files...") archive_file_tree = ArchiveFileTree() if "msbuild" in self.release_info["msvc"]: @@ -1251,12 +1351,13 @@ def _build_msvc_devel(self) -> None: arch_platform = self._arch_to_vs_platform(arch=arch) platform_context = self.get_context(arch_platform.extra_context()) 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) + copy_files_devel(ctx=platform_context) if "cmake" in self.release_info["msvc"]: for arch in self.release_info["msvc"]["cmake"]["archs"]: arch_platform = self._arch_to_vs_platform(arch=arch) platform_context = self.get_context(arch_platform.extra_context()) 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) - 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) + copy_files_devel(ctx=platform_context) with Archiver(zip_path=zip_path) as archiver: archive_file_tree.add_to_archiver(archive_base="", archiver=archiver) @@ -1288,7 +1389,7 @@ def main(argv=None) -> int: parser.add_argument("--actions", choices=["download", "source", "android", "mingw", "msvc", "dmg"], required=True, nargs="+", dest="actions", help="What to do?") parser.set_defaults(loglevel=logging.INFO) parser.add_argument('--vs-year', dest="vs_year", help="Visual Studio year") - parser.add_argument('--android-api', type=int, dest="android_api", help="Android API version") + parser.add_argument('--android-api', dest="android_api", help="Android API version") parser.add_argument('--android-home', dest="android_home", default=os.environ.get("ANDROID_HOME"), help="Android Home folder") parser.add_argument('--android-ndk-home', dest="android_ndk_home", default=os.environ.get("ANDROID_NDK_HOME"), help="Android NDK Home folder") parser.add_argument('--cmake-generator', dest="cmake_generator", default="Ninja", help="CMake Generator") @@ -1415,14 +1516,27 @@ def main(argv=None) -> int: if args.android_api is None: with section_printer.group("Detect Android APIS"): args.android_api = releaser._detect_android_api(android_home=args.android_home) - if args.android_api is None or not (Path(args.android_home) / f"platforms/android-{args.android_api}").is_dir(): + else: + try: + android_api_ints = tuple(int(v) for v in args.android_api.split(".")) + match len(android_api_ints): + case 1: android_api_name = f"android-{android_api_ints[0]}" + case 2: android_api_name = f"android-{android_api_ints[0]}-ext-{android_api_ints[1]}" + case _: raise ValueError + except ValueError: + logger.error("Invalid --android-api, must be a 'X' or 'X.Y' version") + args.android_api = AndroidApiVersion(ints=android_api_ints, name=android_api_name) + if args.android_api is None: parser.error("Invalid --android-api, and/or could not be detected") + android_api_path = Path(args.android_home) / f"platforms/{args.android_api.name}" + if not android_api_path.is_dir(): + parser.error(f"Android API directory does not exist ({android_api_path})") with section_printer.group("Android arguments"): print(f"android_home = {args.android_home}") print(f"android_ndk_home = {args.android_ndk_home}") print(f"android_api = {args.android_api}") releaser.create_android_archives( - android_api=args.android_api, + android_api=args.android_api.ints[0], android_home=args.android_home, android_ndk_home=args.android_ndk_home, ) diff --git a/build-scripts/pkg-support/android/INSTALL.md.in b/build-scripts/pkg-support/android/README.md.in similarity index 65% rename from build-scripts/pkg-support/android/INSTALL.md.in rename to build-scripts/pkg-support/android/README.md.in index 62582fe3..10cbd4e3 100644 --- a/build-scripts/pkg-support/android/INSTALL.md.in +++ b/build-scripts/pkg-support/android/README.md.in @@ -1,7 +1,23 @@ + +The Simple DirectMedia Layer (SDL for short) is a cross-platform library +designed to make it easy to write multi-media software, such as games +and emulators. + +The Simple DirectMedia Layer library source code is available from: +https://www.libsdl.org/ + +This library is distributed under the terms of the zlib license: +http://www.zlib.net/zlib_license.html + +# @<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar + This Android archive allows use of @<@PROJECT_NAME@>@ in your Android project, without needing to copy any SDL source. + +## Gradle integration + For integration with CMake/ndk-build, it uses [prefab](https://google.github.io/prefab/). -Copy this archive (@<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar) to a `app/libs` directory of your project. +Copy the aar archive (@<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar) to a `app/libs` directory of your project. In `app/build.gradle` of your Android project, add: ``` @@ -40,9 +56,9 @@ $(call import-module,prefab/@<@PROJECT_NAME@>@) --- -For advanced users: +## Other build systems (advanced) -If you want to build a 3rd party library outside Gradle, +If you want to build a project without Gradle, running the following command will extract the Android archive into a more common directory structure. ``` python @<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar -o android_prefix @@ -50,7 +66,7 @@ python @<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar -o android_prefix Add `--help` for a list of all available options. -Look at the example programs in ./test (of the source archive), and check out online documentation: +Look at the example programs in ./examples (of the source archive), and check out online documentation: https://wiki.libsdl.org/SDL3/FrontPage Join the SDL discourse server if you want to join the community: diff --git a/build-scripts/pkg-support/android/__main__.py.in b/build-scripts/pkg-support/android/aar/__main__.py.in similarity index 100% rename from build-scripts/pkg-support/android/__main__.py.in rename to build-scripts/pkg-support/android/aar/__main__.py.in diff --git a/build-scripts/pkg-support/android/cmake/SDL3_mixerConfig.cmake b/build-scripts/pkg-support/android/aar/cmake/SDL3_mixerConfig.cmake similarity index 83% rename from build-scripts/pkg-support/android/cmake/SDL3_mixerConfig.cmake rename to build-scripts/pkg-support/android/aar/cmake/SDL3_mixerConfig.cmake index 85b08211..e2c4b002 100644 --- a/build-scripts/pkg-support/android/cmake/SDL3_mixerConfig.cmake +++ b/build-scripts/pkg-support/android/aar/cmake/SDL3_mixerConfig.cmake @@ -1,7 +1,7 @@ # SDL CMake configuration file: # This file is meant to be placed in lib/cmake/SDL3_mixer subfolder of a reconstructed Android SDL3_mixer SDK -cmake_minimum_required(VERSION 3.0...3.5) +cmake_minimum_required(VERSION 3.0...3.28) include(FeatureSummary) set_package_properties(SDL3_mixer PROPERTIES @@ -75,27 +75,28 @@ else() return() endif() -get_filename_component(_sdl3_prefix "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) -get_filename_component(_sdl3_prefix "${_sdl3_prefix}/.." ABSOLUTE) -get_filename_component(_sdl3_prefix "${_sdl3_prefix}/.." ABSOLUTE) -set_and_check(_sdl3_prefix "${_sdl3_prefix}") -set_and_check(_sdl3_include_dirs "${_sdl3_prefix}/include") +get_filename_component(_sdl3mixer_prefix "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE) +get_filename_component(_sdl3mixer_prefix "${_sdl3mixer_prefix}/.." ABSOLUTE) +get_filename_component(_sdl3mixer_prefix "${_sdl3mixer_prefix}/.." ABSOLUTE) +set_and_check(_sdl3mixer_prefix "${_sdl3mixer_prefix}") +set_and_check(_sdl3mixer_include_dirs "${_sdl3mixer_prefix}/include") -set_and_check(_sdl3_lib "${_sdl3_prefix}/lib/${_sdl_arch_subdir}/libSDL3_mixer.so") +set_and_check(_sdl3mixer_lib "${_sdl3mixer_prefix}/lib/${_sdl_arch_subdir}/libSDL3_mixer.so") unset(_sdl_arch_subdir) -unset(_sdl3_prefix) +unset(_sdl3mixer_prefix) # All targets are created, even when some might not be requested though COMPONENTS. # This is done for compatibility with CMake generated SDL3_mixer-target.cmake files. set(SDL3_mixer_SDL3_mixer-shared_FOUND FALSE) -if(EXISTS "${_sdl3_lib}") +if(EXISTS "${_sdl3mixer_lib}") if(NOT TARGET SDL3_mixer::SDL3_mixer-shared) add_library(SDL3_mixer::SDL3_mixer-shared SHARED IMPORTED) set_target_properties(SDL3_mixer::SDL3_mixer-shared PROPERTIES - IMPORTED_LOCATION "${_sdl3_lib}" + IMPORTED_LOCATION "${_sdl3mixer_lib}" + INTERFACE_INCLUDE_DIRECTORIES "${_sdl3mixer_include_dirs}" COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED" INTERFACE_SDL3_SHARED "ON" COMPATIBLE_INTERFACE_STRING "SDL_VERSION" @@ -104,7 +105,8 @@ if(EXISTS "${_sdl3_lib}") endif() set(SDL3_mixer_SDL3_mixer-shared_FOUND TRUE) endif() -unset(_sdl3_lib) +unset(_sdl3mixer_include_dirs) +unset(_sdl3mixer_lib) set(SDL3_mixer_SDL3_mixer-static_FOUND FALSE) diff --git a/build-scripts/pkg-support/android/cmake/SDL3_mixerConfigVersion.cmake.in b/build-scripts/pkg-support/android/aar/cmake/SDL3_mixerConfigVersion.cmake.in similarity index 100% rename from build-scripts/pkg-support/android/cmake/SDL3_mixerConfigVersion.cmake.in rename to build-scripts/pkg-support/android/aar/cmake/SDL3_mixerConfigVersion.cmake.in diff --git a/build-scripts/pkg-support/android/description.json.in b/build-scripts/pkg-support/android/aar/description.json.in similarity index 100% rename from build-scripts/pkg-support/android/description.json.in rename to build-scripts/pkg-support/android/aar/description.json.in diff --git a/build-scripts/pkg-support/msvc/cmake/SDL3_mixerConfig.cmake.in b/build-scripts/pkg-support/msvc/cmake/SDL3_mixerConfig.cmake.in index ebd8d91a..e408c66f 100644 --- a/build-scripts/pkg-support/msvc/cmake/SDL3_mixerConfig.cmake.in +++ b/build-scripts/pkg-support/msvc/cmake/SDL3_mixerConfig.cmake.in @@ -7,7 +7,7 @@ set_package_properties(SDL3_mixer PROPERTIES DESCRIPTION "SDL_mixer is a sample multi-channel audio mixer library" ) -cmake_minimum_required(VERSION 3.0...3.5) +cmake_minimum_required(VERSION 3.0...3.28) # Copied from `configure_package_config_file` macro(check_required_components _NAME) diff --git a/build-scripts/release-info.json b/build-scripts/release-info.json index c327a27e..bea81e8b 100644 --- a/build-scripts/release-info.json +++ b/build-scripts/release-info.json @@ -267,24 +267,28 @@ "api-minimum": 19, "api-target": 29, "ndk-minimum": 21, - "files": { + "aar-files": { "": [ - "build-scripts/pkg-support/android/INSTALL.md.in:INSTALL.md", - "build-scripts/pkg-support/android/__main__.py.in:__main__.py", - "build-scripts/pkg-support/android/description.json.in:description.json" + "build-scripts/pkg-support/android/aar/__main__.py.in:__main__.py", + "build-scripts/pkg-support/android/aar/description.json.in:description.json" ], "META-INF": [ "LICENSE.txt" ], "cmake": [ "cmake/sdlcpu.cmake", - "build-scripts/pkg-support/android/cmake/SDL3_mixerConfig.cmake", - "build-scripts/pkg-support/android/cmake/SDL3_mixerConfigVersion.cmake.in:SDL3_mixerConfigVersion.cmake" + "build-scripts/pkg-support/android/aar/cmake/SDL3_mixerConfig.cmake", + "build-scripts/pkg-support/android/aar/cmake/SDL3_mixerConfigVersion.cmake.in:SDL3_mixerConfigVersion.cmake" + ] + }, + "files": { + "": [ + "build-scripts/pkg-support/android/README.md.in:README.md" ] }, "dependencies": { "SDL": { - "artifact": "SDL3-*.aar" + "artifact": "SDL3-devel-*-android.zip" } } } diff --git a/cmake/test/CMakeLists.txt b/cmake/test/CMakeLists.txt index e863057b..aaefecb4 100644 --- a/cmake/test/CMakeLists.txt +++ b/cmake/test/CMakeLists.txt @@ -1,6 +1,6 @@ # This cmake build script is meant for verifying the various CMake configuration script. -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.12...3.28) project(sdl_test LANGUAGES C) cmake_policy(SET CMP0074 NEW)