add SDL_mixer

This commit is contained in:
Sven Balzer
2025-04-03 03:50:59 +02:00
parent 90d167857e
commit 14728d17f5
739 changed files with 194492 additions and 1 deletions
@@ -0,0 +1,358 @@
#!/bin/bash
set -e
if ! [ "x${ANDROID_NDK_HOME}" != "x" -a -d "${ANDROID_NDK_HOME}" ]; then
echo "ANDROID_NDK_HOME environment variable is not set"
exit 1
fi
if ! [ "x${ANDROID_HOME}" != "x" -a -d "${ANDROID_HOME}" ]; then
echo "ANDROID_HOME environment variable is not set"
exit 1
fi
ANDROID_PLATFORM="${ANDROID_PLATFORM:-16}"
if [ "x${android_platform}" = "x" ]; then
ANDROID_API="$(ls "${ANDROID_HOME}/platforms" | grep -E "^android-[0-9]+$" | sed 's/android-//' | sort -n -r | head -1)"
if [ "x${ANDROID_API}" = "x" ]; then
echo "No Android platform found in $ANDROID_HOME/platforms"
exit 1
fi
else
if ! [ -d "${ANDROID_HOME}/platforms/android-${ANDROID_API}" ]; then
echo "Android api version ${ANDROID_API} is not available (${ANDROID_HOME}/platforms/android-${ANDROID_API} does not exist)" >2
exit 1
fi
fi
android_platformdir="${ANDROID_HOME}/platforms/android-${ANDROID_API}"
echo "Building with ANDROID_PLATFORM=${ANDROID_PLATFORM}"
echo "android_platformdir=${android_platformdir}"
scriptdir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
sdlmixer_root=$(cd -P -- "$(dirname -- "$0")/.." && printf '%s\n' "$(pwd -P)")
build_root="${sdlmixer_root}/build-android-prefab"
android_abis="armeabi-v7a arm64-v8a x86 x86_64"
android_api=19
android_ndk=21
android_stl="c++_shared"
sdlmixer_major=$(sed -ne 's/^#define SDL_MIXER_MAJOR_VERSION *//p' "${sdlmixer_root}/include/SDL3_mixer/SDL_mixer.h")
sdlmixer_minor=$(sed -ne 's/^#define SDL_MIXER_MINOR_VERSION *//p' "${sdlmixer_root}/include/SDL3_mixer/SDL_mixer.h")
sdlmixer_micro=$(sed -ne 's/^#define SDL_MIXER_MICRO_VERSION *//p' "${sdlmixer_root}/include/SDL3_mixer/SDL_mixer.h")
sdlmixer_version="${sdlmixer_major}.${sdlmixer_minor}.${sdlmixer_micro}"
echo "Building Android prefab package for SDL_mixer version $sdlmixer_version"
if test ! -d "${sdl_build_root}"; then
echo "sdl_build_root is not defined or is not a directory."
echo "Set this environment folder to the root of an android SDL${sdlmixer_major} prefab build"
echo "This usually is SDL/build-android-prefab"
exit 1
fi
prefabhome="${build_root}/prefab-${sdlmixer_version}"
rm -rf "$prefabhome"
mkdir -p "${prefabhome}"
build_cmake_projects() {
for android_abi in $android_abis; do
rm -rf "${build_root}/build_${android_abi}/prefix"
for build_shared_libs in ON OFF; do
echo "Configuring CMake project for $android_abi (shared=${build_shared_libs})"
cmake -S "${sdlmixer_root}" -B "${build_root}/build_${android_abi}/shared_${build_shared_libs}" \
-DSDLMIXER_DEPS_SHARED=ON \
-DSDLMIXER_VENDORED=ON \
-DSDLMIXER_FLAC=ON \
-DWITH_ASM=OFF \
-DSDLMIXER_FLAC_LIBFLAC=ON \
-DSDLMIXER_MOD=ON \
-DSDLMIXER_MOD_XMP=ON \
-DSDLMIXER_MP3=ON \
-DSDLMIXER_MP3_MPG123=ON \
-DSDLMIXER_MIDI=ON \
-DSDLMIXER_MIDI_TIMIDITY=ON \
-DSDLMIXER_OPUS=ON \
-DSDLMIXER_VORBIS=STB \
-DSDLMIXER_WAVPACK=ON \
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake" \
-DSDL${sdlmixer_major}_DIR="${sdl_build_root}/build_${android_abi}/prefix/lib/cmake/SDL${sdlmixer_major}" \
-DANDROID_PLATFORM=${ANDROID_PLATFORM} \
-DANDROID_ABI=${android_abi} \
-DBUILD_SHARED_LIBS=${build_shared_libs} \
-DCMAKE_INSTALL_PREFIX="${build_root}/build_${android_abi}/prefix" \
-DCMAKE_INSTALL_INCLUDEDIR=include \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_BUILD_TYPE=Release \
-DSDL${sdlmixer_major}MIXER_SAMPLES=OFF \
-GNinja
echo "Building CMake project for $android_abi (shared=${build_shared_libs})"
cmake --build "${build_root}/build_${android_abi}/shared_${build_shared_libs}"
echo "Installing CMake project for $android_abi (shared=${build_shared_libs})"
cmake --install "${build_root}/build_${android_abi}/shared_${build_shared_libs}"
done
done
}
pom_filename="SDL${sdlmixer_major}_mixer-${sdlmixer_version}.pom"
pom_filepath="${prefabhome}/${pom_filename}"
create_pom_xml() {
echo "Creating ${pom_filename}"
cat >"${pom_filepath}" <<EOF
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.libsdl.android</groupId>
<artifactId>SDL${sdlmixer_major}_mixer</artifactId>
<version>${sdlmixer_version}</version>
<packaging>aar</packaging>
<name>SDL${sdlmixer_major}_mixer</name>
<description>The AAR for SDL${sdlmixer_major}_mixer</description>
<url>https://libsdl.org/</url>
<licenses>
<license>
<name>zlib License</name>
<url>https://github.com/libsdl-org/SDL_mixer/blob/main/LICENSE.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Sam Lantinga</name>
<email>slouken@libsdl.org</email>
<organization>SDL</organization>
<organizationUrl>https://www.libsdl.org</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/libsdl-org/SDL_mixer</connection>
<developerConnection>scm:git:ssh://github.com:libsdl-org/SDL_mixer.git</developerConnection>
<url>https://github.com/libsdl-org/SDL_mixer</url>
</scm>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>4.6.0</version>
<extensions>true</extensions>
<configuration>
<sign>
<debug>false</debug>
</sign>
</configuration>
</plugin>
</project>
EOF
}
create_aar_androidmanifest() {
echo "Creating AndroidManifest.xml"
cat >"${aar_root}/AndroidManifest.xml" <<EOF
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="org.libsdl.android" android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="16"
android:targetSdkVersion="29"/>
</manifest>
EOF
}
echo "Creating AAR root directory"
aar_root="${prefabhome}/SDL${sdlmixer_major}_mixer-${sdlmixer_version}"
mkdir -p "${aar_root}"
aar_metainfdir_path=${aar_root}/META-INF
mkdir -p "${aar_metainfdir_path}"
cp "${sdlmixer_root}/LICENSE.txt" "${aar_metainfdir_path}"
prefabworkdir="${aar_root}/prefab"
mkdir -p "${prefabworkdir}"
cat >"${prefabworkdir}/prefab.json" <<EOF
{
"schema_version": 2,
"name": "SDL${sdlmixer_major}_mixer",
"version": "${sdlmixer_version}",
"dependencies": ["SDL${sdlmixer_major}"]
}
EOF
modulesworkdir="${prefabworkdir}/modules"
mkdir -p "${modulesworkdir}"
create_shared_sdl_mixer_module() {
echo "Creating SDL${sdlmixer_major}_mixer prefab module"
for android_abi in $android_abis; do
sdl_moduleworkdir="${modulesworkdir}/SDL${sdlmixer_major}_mixer"
mkdir -p "${sdl_moduleworkdir}"
abi_build_prefix="${build_root}/build_${android_abi}/prefix"
cat >"${sdl_moduleworkdir}/module.json" <<EOF
{
"export_libraries": ["//SDL${sdlmixer_major}:SDL${sdlmixer_major}"],
"library_name": "libSDL${sdlmixer_major}_mixer"
}
EOF
mkdir -p "${sdl_moduleworkdir}/include/SDL${sdlmixer_major}"
cp -r "${abi_build_prefix}/include/SDL${sdlmixer_major}/"* "${sdl_moduleworkdir}/include/SDL${sdlmixer_major}"
abi_sdllibdir="${sdl_moduleworkdir}/libs/android.${android_abi}"
mkdir -p "${abi_sdllibdir}"
cat >"${abi_sdllibdir}/abi.json" <<EOF
{
"abi": "${android_abi}",
"api": ${android_api},
"ndk": ${android_ndk},
"stl": "${android_stl}",
"static": false
}
EOF
cp "${abi_build_prefix}/lib/libSDL${sdlmixer_major}_mixer.so" "${abi_sdllibdir}"
done
}
create_static_sdl_mixer_module() {
echo "Creating SDL${sdlmixer_major}_mixer-static prefab module"
for android_abi in $android_abis; do
sdl_moduleworkdir="${modulesworkdir}/SDL${sdlmixer_major}_mixer-static"
mkdir -p "${sdl_moduleworkdir}"
abi_build_prefix="${build_root}/build_${android_abi}/prefix"
cat >"${sdl_moduleworkdir}/module.json" <<EOF
{
"export_libraries": ["//SDL${sdlmixer_major}:SDL${sdlmixer_major}-static"],
"library_name": "libSDL${sdlmixer_major}_mixer"
}
EOF
mkdir -p "${sdl_moduleworkdir}/include/SDL${sdlmixer_major}"
cp -r "${abi_build_prefix}/include/SDL${sdlmixer_major}/"* "${sdl_moduleworkdir}/include/SDL${sdlmixer_major}"
abi_sdllibdir="${sdl_moduleworkdir}/libs/android.${android_abi}"
mkdir -p "${abi_sdllibdir}"
cat >"${abi_sdllibdir}/abi.json" <<EOF
{
"abi": "${android_abi}",
"api": ${android_api},
"ndk": ${android_ndk},
"stl": "${android_stl}",
"static": true
}
EOF
cp "${abi_build_prefix}/lib/libSDL${sdlmixer_major}_mixer.a" "${abi_sdllibdir}"
done
}
create_shared_module() {
modulename=$1
libraryname=$2
export_libraries=$3
echo "Creating $modulename prefab module"
export_libraries_json="[]"
if test "x$export_libraries" != "x"; then
export_libraries_json="["
for export_library in $export_libraries; do
if test "x$export_libraries_json" != "x["; then
export_libraries_json="$export_libraries_json, "
fi
export_libraries_json="$export_libraries_json\"$export_library\""
done
export_libraries_json="$export_libraries_json]"
fi
for android_abi in $android_abis; do
sdl_moduleworkdir="${modulesworkdir}/$modulename"
mkdir -p "${sdl_moduleworkdir}"
abi_build_prefix="${build_root}/build_${android_abi}/prefix"
cat >"${sdl_moduleworkdir}/module.json" <<EOF
{
"export_libraries": $export_libraries_json,
"library_name": "$libraryname"
}
EOF
abi_sdllibdir="${sdl_moduleworkdir}/libs/android.${android_abi}"
mkdir -p "${abi_sdllibdir}"
cat >"${abi_sdllibdir}/abi.json" <<EOF
{
"abi": "${android_abi}",
"api": ${android_api},
"ndk": ${android_ndk},
"stl": "${android_stl}"
}
EOF
cp "${abi_build_prefix}/lib/$libraryname.so" "${abi_sdllibdir}"
done
}
build_cmake_projects
create_pom_xml
create_aar_androidmanifest
create_shared_sdl_mixer_module
create_static_sdl_mixer_module
create_shared_module external_libogg libogg ""
cp "${sdlmixer_root}/external/ogg/COPYING" "${aar_metainfdir_path}/LICENSE.libogg.txt"
create_shared_module external_libflac libFLAC ":external_libogg"
for ext in FDL GPL LGPL Xiph; do
cp "${sdlmixer_root}/external/flac/COPYING.$ext" "${aar_metainfdir_path}/LICENSE.libflac.$ext.txt"
done
create_shared_module external_libmpg123 libmpg123 ""
cp "${sdlmixer_root}/external/mpg123/COPYING" "${aar_metainfdir_path}/LICENSE.libmpg123.txt"
create_shared_module external_libopus libopus ":external_libogg"
cp "${sdlmixer_root}/external/opus/COPYING" "${aar_metainfdir_path}/LICENSE.libopus.txt"
create_shared_module external_libopusfile libopusfile ":external_libopus"
cp "${sdlmixer_root}/external/opusfile/COPYING" "${aar_metainfdir_path}/LICENSE.libopusfile.txt"
create_shared_module external_libxmp libxmp ""
tail -n15 "${sdlmixer_root}/external/libxmp/README" >"${aar_metainfdir_path}/LICENSE.libxmp.txt"
create_shared_module external_libwavpack libwavpack ""
tail -n15 "${sdlmixer_root}/external/wavpack/COPYING" >"${aar_metainfdir_path}/LICENSE.wavpack.txt"
pushd "${aar_root}"
aar_filename="SDL${sdlmixer_major}_mixer-${sdlmixer_version}.aar"
zip -r "${aar_filename}" AndroidManifest.xml prefab META-INF
zip -Tv "${aar_filename}" 2>/dev/null ;
mv "${aar_filename}" "${prefabhome}"
popd
maven_filename="SDL${sdlmixer_major}_mixer-${sdlmixer_version}.zip"
pushd "${prefabhome}"
zip_filename="SDL${sdlmixer_major}_mixer-${sdlmixer_version}.zip"
zip "${maven_filename}" "${aar_filename}" "${pom_filename}" 2>/dev/null;
zip -Tv "${zip_filename}" 2>/dev/null;
popd
echo "Prefab zip is ready at ${prefabhome}/${aar_filename}"
echo "Maven archive is ready at ${prefabhome}/${zip_filename}"
@@ -0,0 +1,18 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86)
find_program(CMAKE_C_COMPILER NAMES i686-w64-mingw32-gcc)
find_program(CMAKE_CXX_COMPILER NAMES i686-w64-mingw32-g++)
find_program(CMAKE_RC_COMPILER NAMES i686-w64-mingw32-windres windres)
if(NOT CMAKE_C_COMPILER)
message(FATAL_ERROR "Failed to find CMAKE_C_COMPILER.")
endif()
if(NOT CMAKE_CXX_COMPILER)
message(FATAL_ERROR "Failed to find CMAKE_CXX_COMPILER.")
endif()
if(NOT CMAKE_RC_COMPILER)
message(FATAL_ERROR "Failed to find CMAKE_RC_COMPILER.")
endif()
@@ -0,0 +1,18 @@
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR x86_64)
find_program(CMAKE_C_COMPILER NAMES x86_64-w64-mingw32-gcc)
find_program(CMAKE_CXX_COMPILER NAMES x86_64-w64-mingw32-g++)
find_program(CMAKE_RC_COMPILER NAMES x86_64-w64-mingw32-windres windres)
if(NOT CMAKE_C_COMPILER)
message(FATAL_ERROR "Failed to find CMAKE_C_COMPILER.")
endif()
if(NOT CMAKE_CXX_COMPILER)
message(FATAL_ERROR "Failed to find CMAKE_CXX_COMPILER.")
endif()
if(NOT CMAKE_RC_COMPILER)
message(FATAL_ERROR "Failed to find CMAKE_RC_COMPILER.")
endif()
@@ -0,0 +1,45 @@
#!/usr/bin/env python3
import argparse
from pathlib import Path
import json
import logging
import re
import subprocess
ROOT = Path(__file__).resolve().parents[1]
def determine_remote() -> str:
text = (ROOT / "build-scripts/release-info.json").read_text()
release_info = json.loads(text)
if "remote" in release_info:
return release_info["remote"]
project_with_version = release_info["name"]
project, _ = re.subn("([^a-zA-Z_])", "", project_with_version)
return f"libsdl-org/{project}"
def main():
default_remote = determine_remote()
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument("--ref", required=True, help=f"Name of branch or tag containing release.yml")
parser.add_argument("--remote", "-R", default=default_remote, help=f"Remote repo (default={default_remote})")
parser.add_argument("--commit", help=f"Input 'commit' of release.yml (default is the hash of the ref)")
args = parser.parse_args()
if args.commit is None:
args.commit = subprocess.check_output(["git", "rev-parse", args.ref], cwd=ROOT, text=True).strip()
print(f"Running release.yml workflow:")
print(f" remote = {args.remote}")
print(f" ref = {args.ref}")
print(f" commit = {args.commit}")
subprocess.check_call(["gh", "-R", args.remote, "workflow", "run", "release.yml", "--ref", args.ref, "-f", f"commit={args.commit}"], cwd=ROOT)
if __name__ == "__main__":
raise SystemExit(main())
@@ -0,0 +1,77 @@
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 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:
```
android {
/* ... */
buildFeatures {
prefab true
}
}
dependencies {
implementation files('libs/@<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar')
/* ... */
}
```
If you're using CMake, add the following to your CMakeLists.txt:
```
find_package(@<@PROJECT_NAME@>@ REQUIRED CONFIG)
target_link_libraries(yourgame PRIVATE @<@PROJECT_NAME@>@::@<@PROJECT_NAME@>@)
```
If you use ndk-build, add the following before `include $(BUILD_SHARED_LIBRARY)` to your `Android.mk`:
```
LOCAL_SHARED_LIBARARIES := @<@PROJECT_NAME@>@
```
And add the following at the bottom:
```
# https://google.github.io/prefab/build-systems.html
# Add the prefab modules to the import path.
$(call import-add-path,/out)
# Import @<@PROJECT_NAME@>@ so we can depend on it.
$(call import-module,prefab/@<@PROJECT_NAME@>@)
```
---
## Other build systems (advanced)
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
```
Add `--help` for a list of all available options.
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:
https://discourse.libsdl.org/
That's it!
Sam Lantinga <slouken@libsdl.org>
@@ -0,0 +1,104 @@
#!/usr/bin/env python
"""
Create a @<@PROJECT_NAME@>@ SDK prefix from an Android archive
This file is meant to be placed in a the root of an android .aar archive
Example usage:
```sh
python @<@PROJECT_NAME@>@-@<@PROJECT_VERSION@>@.aar -o /usr/opt/android-sdks
cmake -S my-project \
-DCMAKE_PREFIX_PATH=/usr/opt/android-sdks \
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
-B build-arm64 -DANDROID_ABI=arm64-v8a \
-DCMAKE_BUILD_TYPE=Releaase
cmake --build build-arm64
```
"""
import argparse
import io
import json
import os
import pathlib
import re
import stat
import zipfile
AAR_PATH = pathlib.Path(__file__).resolve().parent
ANDROID_ARCHS = { "armeabi-v7a", "arm64-v8a", "x86", "x86_64" }
def main():
parser = argparse.ArgumentParser(
description="Convert a @<@PROJECT_NAME@>@ Android .aar archive into a SDK",
allow_abbrev=False,
)
parser.add_argument("--version", action="version", version="@<@PROJECT_NAME@>@ @<@PROJECT_VERSION@>@")
parser.add_argument("-o", dest="output", type=pathlib.Path, required=True, help="Folder where to store the SDK")
args = parser.parse_args()
print(f"Creating a @<@PROJECT_NAME@>@ SDK at {args.output}...")
prefix = args.output
incdir = prefix / "include"
libdir = prefix / "lib"
RE_LIB_MODULE_ARCH = re.compile(r"prefab/modules/(?P<module>[A-Za-z0-9_-]+)/libs/android\.(?P<arch>[a-zA-Z0-9_-]+)/(?P<filename>lib[A-Za-z0-9_]+\.(?:so|a))")
RE_INC_MODULE_ARCH = re.compile(r"prefab/modules/(?P<module>[A-Za-z0-9_-]+)/include/(?P<header>[a-zA-Z0-9_./-]+)")
RE_LICENSE = re.compile(r"(?:.*/)?(?P<filename>(?:license|copying)(?:\.md|\.txt)?)", flags=re.I)
RE_PROGUARD = re.compile(r"(?:.*/)?(?P<filename>proguard.*\.(?:pro|txt))", flags=re.I)
RE_CMAKE = re.compile(r"(?:.*/)?(?P<filename>.*\.cmake)", flags=re.I)
with zipfile.ZipFile(AAR_PATH) as zf:
project_description = json.loads(zf.read("description.json"))
project_name = project_description["name"]
project_version = project_description["version"]
licensedir = prefix / "share/licenses" / project_name
cmakedir = libdir / "cmake" / project_name
javadir = prefix / "share/java" / project_name
javadocdir = prefix / "share/javadoc" / project_name
def read_zipfile_and_write(path: pathlib.Path, zippath: str):
data = zf.read(zippath)
path.parent.mkdir(parents=True, exist_ok=True)
path.write_bytes(data)
for zip_info in zf.infolist():
zippath = zip_info.filename
if m := RE_LIB_MODULE_ARCH.match(zippath):
lib_path = libdir / m["arch"] / m["filename"]
read_zipfile_and_write(lib_path, zippath)
if m["filename"].endswith(".so"):
os.chmod(lib_path, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
elif m := RE_INC_MODULE_ARCH.match(zippath):
header_path = incdir / m["header"]
read_zipfile_and_write(header_path, zippath)
elif m:= RE_LICENSE.match(zippath):
license_path = licensedir / m["filename"]
read_zipfile_and_write(license_path, zippath)
elif m:= RE_PROGUARD.match(zippath):
proguard_path = javadir / m["filename"]
read_zipfile_and_write(proguard_path, zippath)
elif m:= RE_CMAKE.match(zippath):
cmake_path = cmakedir / m["filename"]
read_zipfile_and_write(cmake_path, zippath)
elif zippath == "classes.jar":
versioned_jar_path = javadir / f"{project_name}-{project_version}.jar"
unversioned_jar_path = javadir / f"{project_name}.jar"
read_zipfile_and_write(versioned_jar_path, zippath)
os.symlink(src=versioned_jar_path.name, dst=unversioned_jar_path)
elif zippath == "classes-sources.jar":
jarpath = javadir / f"{project_name}-{project_version}-sources.jar"
read_zipfile_and_write(jarpath, zippath)
elif zippath == "classes-doc.jar":
jarpath = javadocdir / f"{project_name}-{project_version}-javadoc.jar"
read_zipfile_and_write(jarpath, zippath)
print("... done")
return 0
if __name__ == "__main__":
raise SystemExit(main())
@@ -0,0 +1,133 @@
# 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.28)
include(FeatureSummary)
set_package_properties(SDL3_mixer PROPERTIES
URL "https://www.libsdl.org/projects/SDL_mixer/"
DESCRIPTION "SDL_mixer is a sample multi-channel audio mixer library"
)
# Copied from `configure_package_config_file`
macro(set_and_check _var _file)
set(${_var} "${_file}")
if(NOT EXISTS "${_file}")
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
endif()
endmacro()
# Copied from `configure_package_config_file`
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
set(SDL3_mixer_FOUND TRUE)
set(SDLMIXER_VENDORED TRUE)
set(SDLMIXER_FLAC_LIBFLAC FALSE)
set(SDLMIXER_FLAC_DRFLAC TRUE)
set(SDLMIXER_GME FALSE)
set(SDLMIXER_MOD FALSE)
set(SDLMIXER_MOD_XMP FALSE)
set(SDLMIXER_MOD_XMP_LITE FALSE)
set(SDLMIXER_MP3 TRUE)
set(SDLMIXER_MP3_DRMP3 TRUE)
set(SDLMIXER_MP3_MPG123 FALSE)
set(SDLMIXER_MIDI FALSE)
set(SDLMIXER_MIDI_FLUIDSYNTH FALSE)
set(SDLMIXER_MIDI_NATIVE FALSE)
set(SDLMIXER_MIDI_TIMIDITY TRUE)
set(SDLMIXER_OPUS FALSE)
set(SDLMIXER_VORBIS STB)
set(SDLMIXER_VORBIS_STB TRUE)
set(SDLMIXER_VORBIS_TREMOR FALSE)
set(SDLMIXER_VORBIS_VORBISFILE FALSE)
set(SDLMIXER_WAVE TRUE)
set(SDL3_mixer_FOUND TRUE)
if(SDL_CPU_X86)
set(_sdl_arch_subdir "x86")
elseif(SDL_CPU_X64)
set(_sdl_arch_subdir "x86_64")
elseif(SDL_CPU_ARM32)
set(_sdl_arch_subdir "armeabi-v7a")
elseif(SDL_CPU_ARM64)
set(_sdl_arch_subdir "arm64-v8a")
else()
set(SDL3_mixer_FOUND FALSE)
return()
endif()
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(_sdl3mixer_lib "${_sdl3mixer_prefix}/lib/${_sdl_arch_subdir}/libSDL3_mixer.so")
unset(_sdl_arch_subdir)
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 "${_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 "${_sdl3mixer_lib}"
INTERFACE_INCLUDE_DIRECTORIES "${_sdl3mixer_include_dirs}"
COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED"
INTERFACE_SDL3_SHARED "ON"
COMPATIBLE_INTERFACE_STRING "SDL_VERSION"
INTERFACE_SDL_VERSION "SDL3"
)
endif()
set(SDL3_mixer_SDL3_mixer-shared_FOUND TRUE)
endif()
unset(_sdl3mixer_include_dirs)
unset(_sdl3mixer_lib)
set(SDL3_mixer_SDL3_mixer-static_FOUND FALSE)
if(SDL3_mixer_SDL3_mixer-shared_FOUND)
set(SDL3_mixer_SDL3_mixer_FOUND TRUE)
endif()
function(_sdl_create_target_alias_compat NEW_TARGET TARGET)
if(CMAKE_VERSION VERSION_LESS "3.18")
# Aliasing local targets is not supported on CMake < 3.18, so make it global.
add_library(${NEW_TARGET} INTERFACE IMPORTED)
set_target_properties(${NEW_TARGET} PROPERTIES INTERFACE_LINK_LIBRARIES "${TARGET}")
else()
add_library(${NEW_TARGET} ALIAS ${TARGET})
endif()
endfunction()
# Make sure SDL3_mixer::SDL3_mixer always exists
if(NOT TARGET SDL3_mixer::SDL3_mixer)
if(TARGET SDL3_mixer::SDL3_mixer-shared)
_sdl_create_target_alias_compat(SDL3_mixer::SDL3_mixer SDL3_mixer::SDL3_mixer-shared)
endif()
endif()
check_required_components(SDL3_mixer)
@@ -0,0 +1,38 @@
# SDL3_mixer CMake version configuration file:
# This file is meant to be placed in a lib/cmake/SDL3_mixer subfolder of a reconstructed Android SDL3_mixer SDK
set(PACKAGE_VERSION "@<@PROJECT_VERSION@>@")
if(PACKAGE_FIND_VERSION_RANGE)
# Package version must be in the requested version range
if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
endif()
else()
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
endif()
# if the using project doesn't have CMAKE_SIZEOF_VOID_P set, fail.
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/sdlcpu.cmake")
SDL_DetectTargetCPUArchitectures(_detected_archs)
# check that the installed version has a compatible architecture as the one which is currently searching:
if(NOT(SDL_CPU_X86 OR SDL_CPU_X64 OR SDL_CPU_ARM32 OR SDL_CPU_ARM64))
set(PACKAGE_VERSION "${PACKAGE_VERSION} (X86,X64,ARM32,ARM64)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()
@@ -0,0 +1,5 @@
{
"name": "@<@PROJECT_NAME@>@",
"version": "@<@PROJECT_VERSION@>@",
"git-hash": "@<@PROJECT_COMMIT@>@"
}
@@ -0,0 +1,19 @@
# SDL3_mixer CMake configuration file:
# This file is meant to be placed in a cmake subfolder of SDL3_mixer-devel-3.x.y-mingw
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(sdl3_mixer_config_path "${CMAKE_CURRENT_LIST_DIR}/../i686-w64-mingw32/lib/cmake/SDL3_mixer/SDL3_mixerConfig.cmake")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(sdl3_mixer_config_path "${CMAKE_CURRENT_LIST_DIR}/../x86_64-w64-mingw32/lib/cmake/SDL3_mixer/SDL3_mixerConfig.cmake")
else("${CMAKE_SIZEOF_VOID_P}" STREQUAL "")
set(SDL3_mixer_FOUND FALSE)
return()
endif()
if(NOT EXISTS "${sdl3_mixer_config_path}")
message(WARNING "${sdl3_mixer_config_path} does not exist: MinGW development package is corrupted")
set(SDL3_mixer_FOUND FALSE)
return()
endif()
include("${sdl3_mixer_config_path}")
@@ -0,0 +1,19 @@
# SDL3_mixer CMake version configuration file:
# This file is meant to be placed in a cmake subfolder of SDL3_mixer-devel-3.x.y-mingw
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(sdl3_mixer_config_path "${CMAKE_CURRENT_LIST_DIR}/../i686-w64-mingw32/lib/cmake/SDL3_mixer/SDL3_mixerConfigVersion.cmake")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(sdl3_mixer_config_path "${CMAKE_CURRENT_LIST_DIR}/../x86_64-w64-mingw32/lib/cmake/SDL3_mixer/SDL3_mixerConfigVersion.cmake")
else("${CMAKE_SIZEOF_VOID_P}" STREQUAL "")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()
if(NOT EXISTS "${sdl3_mixer_config_path}")
message(WARNING "${sdl3_mixer_config_path} does not exist: MinGW development package is corrupted")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
return()
endif()
include("${sdl3_mixer_config_path}")
@@ -0,0 +1,114 @@
# @<@PROJECT_NAME@>@ CMake configuration file:
# This file is meant to be placed in a cmake subfolder of @<@PROJECT_NAME@>@-devel-@<@PROJECT_VERSION@>@-VC.zip
include(FeatureSummary)
set_package_properties(SDL3_mixer PROPERTIES
URL "https://www.libsdl.org/projects/SDL_mixer/"
DESCRIPTION "SDL_mixer is a sample multi-channel audio mixer library"
)
cmake_minimum_required(VERSION 3.0...3.28)
# Copied from `configure_package_config_file`
macro(check_required_components _NAME)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(NOT ${_NAME}_${comp}_FOUND)
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
endif()
endif()
endforeach()
endmacro()
set(SDL3_mixer_FOUND TRUE)
set(SDLMIXER_VENDORED TRUE)
set(SDLMIXER_FLAC_LIBFLAC FALSE)
set(SDLMIXER_FLAC_DRFLAC TRUE)
set(SDLMIXER_GME FALSE)
set(SDLMIXER_MOD TRUE)
set(SDLMIXER_MOD_XMP TRUE)
set(SDLMIXER_MOD_XMP_LITE FALSE)
set(SDLMIXER_MP3 TRUE)
set(SDLMIXER_MP3_DRMP3 TRUE)
set(SDLMIXER_MP3_MPG123 FALSE)
set(SDLMIXER_MIDI TRUE)
set(SDLMIXER_MIDI_FLUIDSYNTH FALSE)
set(SDLMIXER_MIDI_NATIVE TRUE)
set(SDLMIXER_MIDI_TIMIDITY TRUE)
set(SDLMIXER_OPUS TRUE)
set(SDLMIXER_VORBIS STB)
set(SDLMIXER_VORBIS_STB TRUE)
set(SDLMIXER_VORBIS_TREMOR FALSE)
set(SDLMIXER_VORBIS_VORBISFILE FALSE)
set(SDLMIXER_WAVE TRUE)
if(SDL_CPU_X86)
set(_sdl3_mixer_arch_subdir "x86")
elseif(SDL_CPU_X64 OR SDL_CPU_ARM64EC)
set(_sdl3_mixer_arch_subdir "x64")
elseif(SDL_CPU_ARM64)
set(_sdl3_mixer_arch_subdir "arm64")
else()
set(SDL3_mixer_FOUND FALSE)
return()
endif()
set(_sdl3_mixer_incdir "${CMAKE_CURRENT_LIST_DIR}/../include")
set(_sdl3_mixer_library "${CMAKE_CURRENT_LIST_DIR}/../lib/${_sdl3_mixer_arch_subdir}/SDL3_mixer.lib")
set(_sdl3_mixer_dll "${CMAKE_CURRENT_LIST_DIR}/../lib/${_sdl3_mixer_arch_subdir}/SDL3_mixer.dll")
# 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 TRUE)
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
INTERFACE_INCLUDE_DIRECTORIES "${_sdl3_mixer_incdir}"
IMPORTED_IMPLIB "${_sdl3_mixer_library}"
IMPORTED_LOCATION "${_sdl3_mixer_dll}"
COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED"
INTERFACE_SDL3_SHARED "ON"
)
endif()
set(SDL3_mixer_SDL3_mixer-static_FOUND FALSE)
if(SDL3_mixer_SDL3_mixer-shared_FOUND OR SDL3_mixer_SDL3_mixer-static_FOUND)
set(SDL3_mixer_SDL3_mixer_FOUND TRUE)
endif()
function(_sdl_create_target_alias_compat NEW_TARGET TARGET)
if(CMAKE_VERSION VERSION_LESS "3.18")
# Aliasing local targets is not supported on CMake < 3.18, so make it global.
add_library(${NEW_TARGET} INTERFACE IMPORTED)
set_target_properties(${NEW_TARGET} PROPERTIES INTERFACE_LINK_LIBRARIES "${TARGET}")
else()
add_library(${NEW_TARGET} ALIAS ${TARGET})
endif()
endfunction()
# Make sure SDL3_mixer::SDL3_mixer always exists
if(NOT TARGET SDL3_mixer::SDL3_mixer)
if(TARGET SDL3_mixer::SDL3_mixer-shared)
_sdl_create_target_alias_compat(SDL3_mixer::SDL3_mixer SDL3_mixer::SDL3_mixer-shared)
endif()
endif()
unset(_sdl3_mixer_arch_subdir)
unset(_sdl3_mixer_incdir)
unset(_sdl3_mixer_library)
unset(_sdl3_mixer_dll)
check_required_components(SDL3_mixer)
@@ -0,0 +1,36 @@
# @<@PROJECT_NAME@>@ CMake version configuration file:
# This file is meant to be placed in a cmake subfolder of @<@PROJECT_NAME@>@-devel-@<@PROJECT_VERSION@>@-VC.zip
set(PACKAGE_VERSION "@<@PROJECT_VERSION@>@")
include("${CMAKE_CURRENT_LIST_DIR}/sdlcpu.cmake")
SDL_DetectTargetCPUArchitectures(_detected_archs)
if(PACKAGE_FIND_VERSION_RANGE)
# Package version must be in the requested version range
if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
endif()
else()
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
endif()
#include("${CMAKE_CURRENT_LIST_DIR}/sdlcpu.cmake")
#SDL_DetectTargetCPUArchitectures(_detected_archs)
# check that the installed version has a compatible architecture as the one which is currently searching:
if(NOT(SDL_CPU_X86 OR SDL_CPU_X64 OR SDL_CPU_ARM64 OR SDL_CPU_ARM64EC))
set(PACKAGE_VERSION "${PACKAGE_VERSION} (X86,X64,ARM64)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()
@@ -0,0 +1,292 @@
{
"name": "SDL3_mixer",
"remote": "libsdl-org/SDL_mixer",
"dependencies": {
"SDL": {
"startswith": "3.",
"repo": "libsdl-org/SDL"
}
},
"version": {
"file": "include/SDL3_mixer/SDL_mixer.h",
"re_major": "^#define SDL_MIXER_MAJOR_VERSION\\s+([0-9]+)$",
"re_minor": "^#define SDL_MIXER_MINOR_VERSION\\s+([0-9]+)$",
"re_micro": "^#define SDL_MIXER_MICRO_VERSION\\s+([0-9]+)$"
},
"source": {
"checks": [
"src/mixer.c",
"include/SDL3_mixer/SDL_mixer.h",
"examples/playmus.c"
]
},
"dmg": {
"project": "Xcode/SDL_mixer.xcodeproj",
"path": "Xcode/build/SDL3_mixer.dmg",
"scheme": "SDL3_mixer.dmg",
"build-xcconfig": "Xcode/pkg-support/build.xcconfig",
"dependencies": {
"SDL": {
"artifact": "SDL3-*.dmg"
}
}
},
"mingw": {
"cmake": {
"archs": ["x86", "x64"],
"args": [
"-DBUILD_SHARED_LIBS=ON",
"-DSDLMIXER_SNDFILE=ON",
"-DSDLMIXER_FLAC=ON",
"-DSDLMIXER_FLAC_DRFLAC=ON",
"-DSDLMIXER_GME=OFF",
"-DSDLMIXER_MOD=OFF",
"-DSDLMIXER_MOD_XMP=OFF",
"-DSDLMIXER_MP3=ON",
"-DSDLMIXER_MP3_DRMP3=ON",
"-DSDLMIXER_MP3_MPG123=OFF",
"-DSDLMIXER_MIDI=ON",
"-DSDLMIXER_MIDI_NATIVE=ON",
"-DSDLMIXER_OPUS=OFF",
"-DSDLMIXER_VORBIS=STB",
"-DSDLMIXER_WAVE=ON",
"-DSDLMIXER_WAVPACK=OFF",
"-DSDLMIXER_RELOCATABLE=ON",
"-DSDLMIXER_SAMPLES=OFF",
"-DSDLMIXER_VENDORED=ON"
],
"shared-static": "args"
},
"files": {
"": [
"CHANGES.txt",
"LICENSE.txt",
"README.txt",
"build-scripts/pkg-support/mingw/Makefile"
],
"cmake": [
"build-scripts/pkg-support/mingw/cmake/SDL3_mixerConfig.cmake",
"build-scripts/pkg-support/mingw/cmake/SDL3_mixerConfigVersion.cmake"
]
},
"dependencies": {
"SDL": {
"artifact": "SDL3-devel-*-mingw.tar.gz",
"install-command": "make install-@<@ARCH@>@ DESTDIR=@<@PREFIX@>@"
}
}
},
"msvc": {
"msbuild": {
"archs": [
"x86",
"x64"
],
"projects": [
"VisualC/SDL_mixer.vcxproj"
],
"prebuilt": [
"VisualC/external/optional/@<@ARCH@>@/*"
],
"files-lib": {
"": [
"VisualC/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL3_mixer.dll"
],
"optional": [
"VisualC/external/optional/@<@ARCH@>@/libgme.dll",
"VisualC/external/optional/@<@ARCH@>@/libogg-0.dll",
"VisualC/external/optional/@<@ARCH@>@/libopus-0.dll",
"VisualC/external/optional/@<@ARCH@>@/libopusfile-0.dll",
"VisualC/external/optional/@<@ARCH@>@/libwavpack-1.dll",
"VisualC/external/optional/@<@ARCH@>@/libxmp.dll",
"VisualC/external/optional/@<@ARCH@>@/LICENSE.gme.txt",
"VisualC/external/optional/@<@ARCH@>@/LICENSE.ogg-vorbis.txt",
"VisualC/external/optional/@<@ARCH@>@/LICENSE.opus.txt",
"VisualC/external/optional/@<@ARCH@>@/LICENSE.opusfile.txt",
"VisualC/external/optional/@<@ARCH@>@/LICENSE.wavpack.txt",
"VisualC/external/optional/@<@ARCH@>@/LICENSE.xmp.txt"
]
},
"files-devel": {
"lib/@<@ARCH@>@": [
"VisualC/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL3_mixer.dll",
"VisualC/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL3_mixer.lib",
"VisualC/@<@PLATFORM@>@/@<@CONFIGURATION@>@/SDL3_mixer.pdb"
],
"lib/@<@ARCH@>@/optional": [
"VisualC/external/optional/@<@ARCH@>@/libgme.dll",
"VisualC/external/optional/@<@ARCH@>@/libogg-0.dll",
"VisualC/external/optional/@<@ARCH@>@/libopus-0.dll",
"VisualC/external/optional/@<@ARCH@>@/libopusfile-0.dll",
"VisualC/external/optional/@<@ARCH@>@/libwavpack-1.dll",
"VisualC/external/optional/@<@ARCH@>@/libxmp.dll",
"VisualC/external/optional/@<@ARCH@>@/LICENSE.gme.txt",
"VisualC/external/optional/@<@ARCH@>@/LICENSE.ogg-vorbis.txt",
"VisualC/external/optional/@<@ARCH@>@/LICENSE.opus.txt",
"VisualC/external/optional/@<@ARCH@>@/LICENSE.opusfile.txt",
"VisualC/external/optional/@<@ARCH@>@/LICENSE.wavpack.txt",
"VisualC/external/optional/@<@ARCH@>@/LICENSE.xmp.txt"
]
}
},
"cmake": {
"archs": [
"arm64"
],
"args": [
"-DSDLMIXER_SNDFILE=ON",
"-DSDLMIXER_FLAC=ON",
"-DSDLMIXER_FLAC_DRFLAC=ON",
"-DSDLMIXER_GME=ON",
"-DSDLMIXER_MOD=ON",
"-DSDLMIXER_MOD_XMP=ON",
"-DSDLMIXER_MP3=ON",
"-DSDLMIXER_MP3_DRMP3=ON",
"-DSDLMIXER_MP3_MPG123=OFF",
"-DSDLMIXER_MIDI=ON",
"-DSDLMIXER_MIDI_NATIVE=ON",
"-DSDLMIXER_OPUS=ON",
"-DSDLMIXER_VORBIS=STB",
"-DSDLMIXER_WAVE=ON",
"-DSDLMIXER_WAVPACK=ON",
"-DSDLMIXER_RELOCATABLE=ON",
"-DSDLMIXER_SAMPLES=OFF",
"-DSDLMIXER_DEPS_SHARED=ON",
"-DSDLMIXER_VENDORED=ON"
],
"files-lib": {
"": [
"bin/SDL3_mixer.dll"
],
"optional": [
"bin/gme.dll",
"bin/libxmp.dll",
"bin/ogg-0.dll",
"bin/opus-0.dll",
"bin/opusfile-0.dll",
"bin/libwavpack-1.dll"
]
},
"files-devel": {
"lib/@<@ARCH@>@": [
"bin/SDL3_mixer.dll",
"bin/SDL3_mixer.pdb",
"lib/SDL3_mixer.lib"
],
"lib/@<@ARCH@>@/optional": [
"bin/gme.dll",
"bin/libxmp.dll",
"bin/ogg-0.dll",
"bin/opus-0.dll",
"bin/opusfile-0.dll",
"bin/libwavpack-1.dll"
]
}
},
"files-lib": {
"": [
"README.txt"
]
},
"files-devel": {
"": [
"CHANGES.txt",
"LICENSE.txt",
"README.txt"
],
"cmake": [
"build-scripts/pkg-support/msvc/cmake/SDL3_mixerConfig.cmake.in:SDL3_mixerConfig.cmake",
"build-scripts/pkg-support/msvc/cmake/SDL3_mixerConfigVersion.cmake.in:SDL3_mixerConvigVersion.cmake",
"cmake/sdlcpu.cmake"
],
"include/SDL3_mixer": [
"include/SDL3_mixer/SDL_mixer.h"
]
},
"dependencies": {
"SDL": {
"artifact": "SDL3-devel-*-VC.zip",
"copy": [
{
"src": "lib/@<@ARCH@>@/SDL3.*",
"dst": "../SDL/VisualC/@<@PLATFORM@>@/@<@CONFIGURATION@>@"
},
{
"src": "include/SDL3/*",
"dst": "../SDL/include/SDL3"
}
]
}
}
},
"android": {
"cmake": {
"args": [
"-DBUILD_SHARED_LIBS=ON",
"-DSDLMIXER_SNDFILE=ON",
"-DSDLMIXER_FLAC=ON",
"-DSDLMIXER_FLAC_DRFLAC=ON",
"-DSDLMIXER_GME=OFF",
"-DSDLMIXER_MOD=OFF",
"-DSDLMIXER_MOD_XMP=OFF",
"-DSDLMIXER_MP3=ON",
"-DSDLMIXER_MP3_DRMP3=ON",
"-DSDLMIXER_MP3_MPG123=OFF",
"-DSDLMIXER_MIDI=ON",
"-DSDLMIXER_MIDI_NATIVE=ON",
"-DSDLMIXER_OPUS=OFF",
"-DSDLMIXER_VORBIS=STB",
"-DSDLMIXER_WAVE=ON",
"-DSDLMIXER_WAVPACK=OFF",
"-DSDLMIXER_SAMPLES=OFF",
"-DSDLMIXER_VENDORED=ON"
]
},
"modules": {
"SDL3_mixer-shared": {
"type": "library",
"library": "lib/libSDL3_mixer.so",
"includes": {
"SDL3_mixer": ["include/SDL3_mixer/*.h"]
}
},
"SDL3_mixer": {
"type": "interface",
"export-libraries": [":SDL3_mixer-shared"]
}
},
"abis": [
"armeabi-v7a",
"arm64-v8a",
"x86",
"x86_64"
],
"api-minimum": 19,
"api-target": 29,
"ndk-minimum": 21,
"aar-files": {
"": [
"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/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-devel-*-android.zip"
}
}
}
}
@@ -0,0 +1,142 @@
#!/bin/sh
# Copyright 2022 Collabora Ltd.
# SPDX-License-Identifier: Zlib
set -eu
cd `dirname $0`/..
# Needed so sed doesn't report illegal byte sequences on macOS
export LC_CTYPE=C
header=include/SDL3_mixer/SDL_mixer.h
ref_major=$(sed -ne 's/^#define SDL_MIXER_MAJOR_VERSION *//p' $header)
ref_minor=$(sed -ne 's/^#define SDL_MIXER_MINOR_VERSION *//p' $header)
ref_micro=$(sed -ne 's/^#define SDL_MIXER_MICRO_VERSION *//p' $header)
ref_version="${ref_major}.${ref_minor}.${ref_micro}"
tests=0
failed=0
ok () {
tests=$(( tests + 1 ))
echo "ok - $*"
}
not_ok () {
tests=$(( tests + 1 ))
echo "not ok - $*"
failed=1
}
major=$(sed -ne 's/^set(MAJOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
minor=$(sed -ne 's/^set(MINOR_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
micro=$(sed -ne 's/^set(MICRO_VERSION \([0-9]*\))$/\1/p' CMakeLists.txt)
ref_sdl_req=$(sed -ne 's/^set(SDL_REQUIRED_VERSION \([0-9.]*\))$/\1/p' CMakeLists.txt)
version="${major}.${minor}.${micro}"
if [ "$ref_version" = "$version" ]; then
ok "CMakeLists.txt $version"
else
not_ok "CMakeLists.txt $version disagrees with SDL_mixer.h $ref_version"
fi
for rcfile in src/version.rc; do
tuple=$(sed -ne 's/^ *FILEVERSION *//p' "$rcfile" | tr -d '\r')
ref_tuple="${ref_major},${ref_minor},${ref_micro},0"
if [ "$ref_tuple" = "$tuple" ]; then
ok "$rcfile FILEVERSION $tuple"
else
not_ok "$rcfile FILEVERSION $tuple disagrees with SDL_mixer.h $ref_tuple"
fi
tuple=$(sed -ne 's/^ *PRODUCTVERSION *//p' "$rcfile" | tr -d '\r')
if [ "$ref_tuple" = "$tuple" ]; then
ok "$rcfile PRODUCTVERSION $tuple"
else
not_ok "$rcfile PRODUCTVERSION $tuple disagrees with SDL_mixer.h $ref_tuple"
fi
tuple=$(sed -Ene 's/^ *VALUE "FileVersion", "([0-9, ]*)\\0"\r?$/\1/p' "$rcfile" | tr -d '\r')
ref_tuple="${ref_major}, ${ref_minor}, ${ref_micro}, 0"
if [ "$ref_tuple" = "$tuple" ]; then
ok "$rcfile FileVersion $tuple"
else
not_ok "$rcfile FileVersion $tuple disagrees with SDL_mixer.h $ref_tuple"
fi
tuple=$(sed -Ene 's/^ *VALUE "ProductVersion", "([0-9, ]*)\\0"\r?$/\1/p' "$rcfile" | tr -d '\r')
if [ "$ref_tuple" = "$tuple" ]; then
ok "$rcfile ProductVersion $tuple"
else
not_ok "$rcfile ProductVersion $tuple disagrees with SDL_mixer.h $ref_tuple"
fi
done
version=$(sed -Ene '/CFBundleShortVersionString/,+1 s/.*<string>(.*)<\/string>.*/\1/p' Xcode/Info-Framework.plist)
if [ "$ref_version" = "$version" ]; then
ok "Info-Framework.plist CFBundleShortVersionString $version"
else
not_ok "Info-Framework.plist CFBundleShortVersionString $version disagrees with SDL_mixer.h $ref_version"
fi
version=$(sed -Ene '/CFBundleVersion/,+1 s/.*<string>(.*)<\/string>.*/\1/p' Xcode/Info-Framework.plist)
if [ "$ref_version" = "$version" ]; then
ok "Info-Framework.plist CFBundleVersion $version"
else
not_ok "Info-Framework.plist CFBundleVersion $version disagrees with SDL_mixer.h $ref_version"
fi
# For simplicity this assumes we'll never break ABI before SDL 3.
dylib_compat=$(sed -Ene 's/.*DYLIB_COMPATIBILITY_VERSION = (.*);$/\1/p' Xcode/SDL_mixer.xcodeproj/project.pbxproj)
case "$ref_minor" in
(*[02468])
major="$(( ref_minor * 100 + 1 ))"
minor="0"
;;
(*)
major="$(( ref_minor * 100 + ref_micro + 1 ))"
minor="0"
;;
esac
ref="${major}.${minor}.0
${major}.${minor}.0"
if [ "$ref" = "$dylib_compat" ]; then
ok "project.pbxproj DYLIB_COMPATIBILITY_VERSION is consistent"
else
not_ok "project.pbxproj DYLIB_COMPATIBILITY_VERSION is inconsistent, expected $ref, got $dylib_compat"
fi
dylib_cur=$(sed -Ene 's/.*DYLIB_CURRENT_VERSION = (.*);$/\1/p' Xcode/SDL_mixer.xcodeproj/project.pbxproj)
case "$ref_minor" in
(*[02468])
major="$(( ref_minor * 100 + 1 ))"
minor="$ref_micro"
;;
(*)
major="$(( ref_minor * 100 + ref_micro + 1 ))"
minor="0"
;;
esac
ref="${major}.${minor}.0
${major}.${minor}.0"
if [ "$ref" = "$dylib_cur" ]; then
ok "project.pbxproj DYLIB_CURRENT_VERSION is consistent"
else
not_ok "project.pbxproj DYLIB_CURRENT_VERSION is inconsistent, expected $ref, got $dylib_cur"
fi
echo "1..$tests"
exit "$failed"
File diff suppressed because it is too large Load Diff