From 6aaedb813fa11ba0679c3051bc2eb28646b9506c Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sat, 30 Aug 2025 16:53:58 -0700 Subject: Update to SDL3 --- .../.github/actions/setup-gdk-desktop/action.yml | 82 +++++++++++++++++++ .../actions/setup-loongarch64-toolchain/action.yml | 53 ++++++++++++ .../.github/actions/setup-msvc-libusb/action.yml | 71 +++++++++++++++++ .../.github/actions/setup-ninja/action.yml | 62 +++++++++++++++ .../.github/actions/setup-vita-gles/action.yml | 93 ++++++++++++++++++++++ 5 files changed, 361 insertions(+) create mode 100644 src/contrib/SDL-3.2.20/.github/actions/setup-gdk-desktop/action.yml create mode 100644 src/contrib/SDL-3.2.20/.github/actions/setup-loongarch64-toolchain/action.yml create mode 100644 src/contrib/SDL-3.2.20/.github/actions/setup-msvc-libusb/action.yml create mode 100644 src/contrib/SDL-3.2.20/.github/actions/setup-ninja/action.yml create mode 100644 src/contrib/SDL-3.2.20/.github/actions/setup-vita-gles/action.yml (limited to 'src/contrib/SDL-3.2.20/.github/actions') diff --git a/src/contrib/SDL-3.2.20/.github/actions/setup-gdk-desktop/action.yml b/src/contrib/SDL-3.2.20/.github/actions/setup-gdk-desktop/action.yml new file mode 100644 index 0000000..10427ac --- /dev/null +++ b/src/contrib/SDL-3.2.20/.github/actions/setup-gdk-desktop/action.yml @@ -0,0 +1,82 @@ +name: 'Setup GDK (Game Development Kit) for Windows Desktop' +description: 'Download GDK and install into MSBuild' +inputs: + # Keep edition and ref in sync! + edition: + description: 'GDK edition' + default: '240601' # YYMMUU (Year Month Update) + ref: + description: 'Git reference' + default: 'June_2024_Update_1' + folder: + description: 'Folder where to create Directory.Build.props' + required: true + default: '${{ github.workspace }}' +runs: + using: 'composite' + steps: + - uses: actions/setup-python@main + with: + python-version: 3.x + - name: 'Calculate variables' + id: calc + shell: pwsh + run: | + $vs_folder=@(vswhere -latest -property installationPath) + echo "vs-folder=${vs_folder}" >> $Env:GITHUB_OUTPUT + + echo "gdk-path=${{ runner.temp }}\GDK-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT + + echo "cache-key=gdk-${{ inputs.ref }}-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT + - name: 'Restore cached GDK' + id: cache-restore + uses: actions/cache/restore@v4 + with: + path: '${{ steps.calc.outputs.gdk-path }}' + key: ${{ steps.calc.outputs.cache-key }} + - name: 'Download GDK' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + shell: pwsh + run: | + python build-scripts/setup-gdk-desktop.py ` + --download ` + --temp-folder "${{ runner.temp }}" ` + --gdk-path="${{ steps.calc.outputs.gdk-path }}" ` + --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" ` + --vs-folder="${{ steps.calc.outputs.vs-folder }}" ` + --no-user-props + - name: 'Extract GDK' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + shell: pwsh + run: | + python build-scripts/setup-gdk-desktop.py ` + --extract ` + --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" ` + --temp-folder "${{ runner.temp }}" ` + --gdk-path="${{ steps.calc.outputs.gdk-path }}" ` + --vs-folder="${{ steps.calc.outputs.vs-folder }}" ` + --no-user-props + - name: 'Cache GDK' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: '${{ steps.calc.outputs.gdk-path }}' + key: ${{ steps.calc.outputs.cache-key }} + - name: 'Copy MSBuild files into GDK' + shell: pwsh + run: | + python build-scripts/setup-gdk-desktop.py ` + --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" ` + --gdk-path="${{ steps.calc.outputs.gdk-path }}" ` + --vs-folder="${{ steps.calc.outputs.vs-folder }}" ` + --copy-msbuild ` + --no-user-props + - name: 'Write user props' + shell: pwsh + run: | + python build-scripts/setup-gdk-desktop.py ` + --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" ` + --temp-folder "${{ runner.temp }}" ` + --vs-folder="${{ steps.calc.outputs.vs-folder }}" ` + --gdk-path="${{ steps.calc.outputs.gdk-path }}" ` + "--props-folder=${{ inputs.folder }}" diff --git a/src/contrib/SDL-3.2.20/.github/actions/setup-loongarch64-toolchain/action.yml b/src/contrib/SDL-3.2.20/.github/actions/setup-loongarch64-toolchain/action.yml new file mode 100644 index 0000000..e7f9ddc --- /dev/null +++ b/src/contrib/SDL-3.2.20/.github/actions/setup-loongarch64-toolchain/action.yml @@ -0,0 +1,53 @@ +name: 'Setup LoongArch64 toolchain' +description: 'Download Linux LoongArch64 toolchain and set output variables' +inputs: + version: + description: 'LoongArch64 version' + default: '2023.08.08' +outputs: + prefix: + description: "LoongArch toolchain prefix" + value: ${{ steps.final.outputs.prefix }} + cc: + description: "LoongArch C compiler" + value: ${{ steps.final.outputs.cc }} + cxx: + description: "LoongArch C++ compiler" + value: ${{ steps.final.outputs.cxx }} +runs: + using: 'composite' + steps: + - uses: actions/cache/restore@v4 + id: restore-cache + with: + path: /opt/cross-tools + key: loongarch64-${{ inputs.version }} + + - name: 'Download LoongArch64 gcc+glibc toolchain' + if: ${{ !steps.restore-cache.outputs.cache-hit }} + shell: bash + run: | + url="https://github.com/loongson/build-tools/releases/download/${{ inputs.version }}/CLFS-loongarch64-8.1-x86_64-cross-tools-gcc-glibc.tar.xz" + + wget "$url" -O /tmp/toolchain.tar.xz + + mkdir -p /opt + tar -C /opt -x -f /tmp/toolchain.tar.xz + + - uses: actions/cache/save@v4 + if: ${{ !steps.restore-cache.outputs.cache-hit }} + with: + path: /opt/cross-tools + key: loongarch64-${{ inputs.version }} + - name: 'Set output vars' + id: final + shell: bash + run: | + prefix=/opt/cross-tools + echo "prefix=${prefix}" >> $GITHUB_OUTPUT + cc="${prefix}/bin/loongarch64-unknown-linux-gnu-gcc" + cxx="${prefix}/bin/loongarch64-unknown-linux-gnu-g++" + echo "cc=${cc}" >> $GITHUB_OUTPUT + echo "cxx=${cxx}" >> $GITHUB_OUTPUT + echo "LOONGARCH64_CC=${cc}" >>$GITHUB_ENV + echo "LOONGARCH64_CXX=${cxx}" >>$GITHUB_ENV diff --git a/src/contrib/SDL-3.2.20/.github/actions/setup-msvc-libusb/action.yml b/src/contrib/SDL-3.2.20/.github/actions/setup-msvc-libusb/action.yml new file mode 100644 index 0000000..cbbf098 --- /dev/null +++ b/src/contrib/SDL-3.2.20/.github/actions/setup-msvc-libusb/action.yml @@ -0,0 +1,71 @@ +name: 'Setup libusb for MSVC' +description: 'Download libusb sdk for MSVC, and set output/environment variables' +inputs: + version: + description: 'libusb version' + required: true + default: '1.0.27' + arch: + description: "libusb architecture (x86 or x64)" + rqeuired: true +outputs: + root: + description: "libusb root directory" + value: ${{ steps.final.outputs.root }} +runs: + using: 'composite' + steps: + - name: 'Restore cached libusb-${{ inputs.version }}.7z' + id: cache-restore + uses: actions/cache/restore@v4 + with: + path: 'C:\temp\libusb-${{ inputs.version }}.7z' + key: libusb-msvc-${{ inputs.version }} + - name: 'Download libusb ${{ inputs.version }}' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + shell: pwsh + run: | + Invoke-WebRequest "https://github.com/libusb/libusb/releases/download/v${{ inputs.version }}/libusb-${{ inputs.version }}.7z" -OutFile "C:\temp\libusb-${{ inputs.version }}.7z" + - name: 'Cache libusb-${{ inputs.version }}.7z' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: 'C:\temp\libusb-${{ inputs.version }}.7z' + key: libusb-msvc-${{ inputs.version }} + - name: 'Extract libusb' + shell: pwsh + run: | + 7z "-oC:\temp\libusb-${{ inputs.version }}" x "C:\temp\libusb-${{ inputs.version }}.7z" + - name: 'Set output vars' + id: final + shell: pwsh + run: | + if ('${{ inputs.arch }}' -eq 'x86') { + $archdir = "MS32"; + } elseif ('${{ inputs.arch }}' -eq 'x64') { + $archdir = "MS64"; + } else { + write-host "Invalid arch=${{ inputs.arch }}" + exit 1 + } + $libusb_incdir = "C:\temp\libusb-${{ inputs.version }}\include"; + $libusb_libdir = "C:\temp\libusb-${{ inputs.version }}\VS2022\${archdir}\dll"; + + $libusb_header = "${libusb_incdir}\libusb.h"; + $libusb_implib = "${libusb_libdir}\libusb-1.0.lib"; + $libusb_dll = "${libusb_libdir}\libusb-1.0.dll"; + + if (!(Test-Path "${libusb_header}")) { + write-host "${libusb_header} does not exist!" + exit 1 + } + if (!(Test-Path "${libusb_implib}")){ + write-host "${libusb_implib} does not exist!" + exit 1 + } + if (!(Test-Path "${libusb_dll}")) { + write-host "${libusb_dll} does not exist!" + exit 1 + } + echo "root=${libusb_incdir};${libusb_libdir}" >> $env:GITHUB_OUTPUT + echo "LibUSB_ROOT=${libusb_incdir};${libusb_libdir}" >> $env:GITHUB_ENV diff --git a/src/contrib/SDL-3.2.20/.github/actions/setup-ninja/action.yml b/src/contrib/SDL-3.2.20/.github/actions/setup-ninja/action.yml new file mode 100644 index 0000000..a1d3ad9 --- /dev/null +++ b/src/contrib/SDL-3.2.20/.github/actions/setup-ninja/action.yml @@ -0,0 +1,62 @@ +name: 'Setup ninja' +description: 'Download ninja and add it to the PATH environment variable' +inputs: + version: + description: 'Ninja version' + default: '1.12.1' +runs: + using: 'composite' + steps: + - name: 'Calculate variables' + id: calc + shell: sh + run: | + case "${{ runner.os }}-${{ runner.arch }}" in + "Linux-X86" | "Linux-X64") + archive="ninja-linux.zip" + ;; + "Linux-ARM64") + archive="ninja-linux-aarch64.zip" + ;; + "macOS-X86" | "macOS-X64" | "macOS-ARM64") + archive="ninja-mac.zip" + ;; + "Windows-X86" | "Windows-X64") + archive="ninja-win.zip" + ;; + "Windows-ARM64") + archive="ninja-winarm64.zip" + ;; + *) + echo "Unsupported ${{ runner.os }}-${{ runner.arch }}" + exit 1; + ;; + esac + echo "archive=${archive}" >> ${GITHUB_OUTPUT} + echo "cache-key=${archive}-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}" >> ${GITHUB_OUTPUT} + - name: 'Restore cached ${{ steps.calc.outputs.archive }}' + id: cache-restore + uses: actions/cache/restore@v4 + with: + path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}' + key: ${{ steps.calc.outputs.cache-key }} + - name: 'Download ninja ${{ inputs.version }} for ${{ runner.os }} (${{ runner.arch }})' + if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }} + shell: pwsh + run: | + Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v${{ inputs.version }}/${{ steps.calc.outputs.archive }}" -OutFile "${{ runner.temp }}/${{ steps.calc.outputs.archive }}" + - name: 'Cache ${{ steps.calc.outputs.archive }}' + if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }} + uses: actions/cache/save@v4 + with: + path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}' + key: ${{ steps.calc.outputs.cache-key }} + - name: 'Extract ninja' + shell: pwsh + run: | + 7z "-o${{ runner.temp }}/ninja-${{ inputs.version }}-${{ runner.arch }}" x "${{ runner.temp }}/${{ steps.calc.outputs.archive }}" + - name: 'Set output variables' + id: final + shell: pwsh + run: | + echo "${{ runner.temp }}/ninja-${{ inputs.version }}-${{ runner.arch }}" >> $env:GITHUB_PATH diff --git a/src/contrib/SDL-3.2.20/.github/actions/setup-vita-gles/action.yml b/src/contrib/SDL-3.2.20/.github/actions/setup-vita-gles/action.yml new file mode 100644 index 0000000..e263737 --- /dev/null +++ b/src/contrib/SDL-3.2.20/.github/actions/setup-vita-gles/action.yml @@ -0,0 +1,93 @@ +name: 'Setup GLES for PlayStation Vita' +description: 'Download GLES for VITA (PVR or PIB), and copy it into the vita sdk' +inputs: + pib-version: + description: 'PIB version' + default: '1.1.4' + pvr-version: + description: 'PVR_PSP2 version' + default: '3.9' + type: + description: '"pib" or "pvr"' + default: '' +runs: + using: 'composite' + steps: + - name: 'Calculate variables' + id: calc + shell: sh + run: | + if test "x${VITASDK}" = "x"; then + echo "VITASDK must be defined" + exit 1; + fi + case "x${{ inputs.type }}" in + "xpvr") + echo "cache-key=SDL-vita-gles-pvr-${{ inputs.pvr-version}}" >> ${GITHUB_OUTPUT} + ;; + "xpib") + echo "cache-key=SDL-vita-gles-pib-${{ inputs.pib-version}}" >> ${GITHUB_OUTPUT} + ;; + *) + echo "Invalid type. Must be 'pib' or 'pvr'." + exit 1 + ;; + esac + - uses: actions/cache/restore@v4 + id: restore-cache + with: + path: /vita/dependencies + key: '${{ steps.calc.outputs.cache-key }}' + - name: 'Download PVR_PSP2 (GLES)' + if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pvr' }} + shell: sh + run: | + pvr_psp2_version=${{ inputs.pvr-version }} + + mkdir -p /vita/dependencies/include + mkdir -p /vita/dependencies/lib + + # Configure PVR_PSP2 headers + wget https://github.com/GrapheneCt/PVR_PSP2/archive/refs/tags/v$pvr_psp2_version.zip -P/tmp + unzip /tmp/v$pvr_psp2_version.zip -d/tmp + cp -r /tmp/PVR_PSP2-$pvr_psp2_version/include/* /vita/dependencies/include + rm /tmp/v$pvr_psp2_version.zip + + # include guard of PVR_PSP2's khrplatform.h does not match the usual one + sed -i -e s/__drvkhrplatform_h_/__khrplatform_h_/ /vita/dependencies/include/KHR/khrplatform.h + + # Configure PVR_PSP2 stub libraries + wget https://github.com/GrapheneCt/PVR_PSP2/releases/download/v$pvr_psp2_version/vitasdk_stubs.zip -P/tmp + unzip /tmp/vitasdk_stubs.zip -d/tmp/pvr_psp2_stubs + find /tmp/pvr_psp2_stubs -type f -name "*.a" -exec cp {} /vita/dependencies/lib \; + rm /tmp/vitasdk_stubs.zip + rm -rf /tmp/pvr_psp2_stubs + + - name: 'Download gl4es4vita (OpenGL)' + if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pib' }} + shell: sh + run: | + gl4es4vita_version=${{ inputs.pib-version }} + + mkdir -p /vita/dependencies/include + mkdir -p /vita/dependencies/lib + + # Configure gl4es4vita headers + wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/include.zip -P/tmp + unzip -o /tmp/include.zip -d/vita/dependencies/include + rm /tmp/include.zip + + # Configure gl4es4vita stub libraries + wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp + unzip /tmp/vitasdk_stubs.zip -d/vita/dependencies/lib + + - uses: actions/cache/save@v4 + if: ${{ !steps.restore-cache.outputs.cache-hit }} + with: + path: /vita/dependencies + key: '${{ steps.calc.outputs.cache-key }}' + + - name: Copy PVR_PSP2 (GLES) or gl4es4vita (OpenGL) to vita toolchain dir + shell: sh + run: | + cp -rv /vita/dependencies/* ${VITASDK}/arm-vita-eabi -- cgit v1.2.3