diff options
author | 3gg <3gg@shellblade.net> | 2025-08-30 16:53:58 -0700 |
---|---|---|
committer | 3gg <3gg@shellblade.net> | 2025-08-30 16:53:58 -0700 |
commit | 6aaedb813fa11ba0679c3051bc2eb28646b9506c (patch) | |
tree | 34acbfc9840e02cb4753e6306ea7ce978bf8b58e /src/contrib/SDL-3.2.20/.github/actions | |
parent | 8f228ade99dd3d4c8da9b78ade1815c9adf85c8f (diff) |
Update to SDL3
Diffstat (limited to 'src/contrib/SDL-3.2.20/.github/actions')
5 files changed, 361 insertions, 0 deletions
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 @@ | |||
1 | name: 'Setup GDK (Game Development Kit) for Windows Desktop' | ||
2 | description: 'Download GDK and install into MSBuild' | ||
3 | inputs: | ||
4 | # Keep edition and ref in sync! | ||
5 | edition: | ||
6 | description: 'GDK edition' | ||
7 | default: '240601' # YYMMUU (Year Month Update) | ||
8 | ref: | ||
9 | description: 'Git reference' | ||
10 | default: 'June_2024_Update_1' | ||
11 | folder: | ||
12 | description: 'Folder where to create Directory.Build.props' | ||
13 | required: true | ||
14 | default: '${{ github.workspace }}' | ||
15 | runs: | ||
16 | using: 'composite' | ||
17 | steps: | ||
18 | - uses: actions/setup-python@main | ||
19 | with: | ||
20 | python-version: 3.x | ||
21 | - name: 'Calculate variables' | ||
22 | id: calc | ||
23 | shell: pwsh | ||
24 | run: | | ||
25 | $vs_folder=@(vswhere -latest -property installationPath) | ||
26 | echo "vs-folder=${vs_folder}" >> $Env:GITHUB_OUTPUT | ||
27 | |||
28 | echo "gdk-path=${{ runner.temp }}\GDK-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT | ||
29 | |||
30 | echo "cache-key=gdk-${{ inputs.ref }}-${{ inputs.edition }}" >> $Env:GITHUB_OUTPUT | ||
31 | - name: 'Restore cached GDK' | ||
32 | id: cache-restore | ||
33 | uses: actions/cache/restore@v4 | ||
34 | with: | ||
35 | path: '${{ steps.calc.outputs.gdk-path }}' | ||
36 | key: ${{ steps.calc.outputs.cache-key }} | ||
37 | - name: 'Download GDK' | ||
38 | if: ${{ !steps.cache-restore.outputs.cache-hit }} | ||
39 | shell: pwsh | ||
40 | run: | | ||
41 | python build-scripts/setup-gdk-desktop.py ` | ||
42 | --download ` | ||
43 | --temp-folder "${{ runner.temp }}" ` | ||
44 | --gdk-path="${{ steps.calc.outputs.gdk-path }}" ` | ||
45 | --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" ` | ||
46 | --vs-folder="${{ steps.calc.outputs.vs-folder }}" ` | ||
47 | --no-user-props | ||
48 | - name: 'Extract GDK' | ||
49 | if: ${{ !steps.cache-restore.outputs.cache-hit }} | ||
50 | shell: pwsh | ||
51 | run: | | ||
52 | python build-scripts/setup-gdk-desktop.py ` | ||
53 | --extract ` | ||
54 | --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" ` | ||
55 | --temp-folder "${{ runner.temp }}" ` | ||
56 | --gdk-path="${{ steps.calc.outputs.gdk-path }}" ` | ||
57 | --vs-folder="${{ steps.calc.outputs.vs-folder }}" ` | ||
58 | --no-user-props | ||
59 | - name: 'Cache GDK' | ||
60 | if: ${{ !steps.cache-restore.outputs.cache-hit }} | ||
61 | uses: actions/cache/save@v4 | ||
62 | with: | ||
63 | path: '${{ steps.calc.outputs.gdk-path }}' | ||
64 | key: ${{ steps.calc.outputs.cache-key }} | ||
65 | - name: 'Copy MSBuild files into GDK' | ||
66 | shell: pwsh | ||
67 | run: | | ||
68 | python build-scripts/setup-gdk-desktop.py ` | ||
69 | --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" ` | ||
70 | --gdk-path="${{ steps.calc.outputs.gdk-path }}" ` | ||
71 | --vs-folder="${{ steps.calc.outputs.vs-folder }}" ` | ||
72 | --copy-msbuild ` | ||
73 | --no-user-props | ||
74 | - name: 'Write user props' | ||
75 | shell: pwsh | ||
76 | run: | | ||
77 | python build-scripts/setup-gdk-desktop.py ` | ||
78 | --ref-edition "${{ inputs.ref }},${{ inputs.edition }}" ` | ||
79 | --temp-folder "${{ runner.temp }}" ` | ||
80 | --vs-folder="${{ steps.calc.outputs.vs-folder }}" ` | ||
81 | --gdk-path="${{ steps.calc.outputs.gdk-path }}" ` | ||
82 | "--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 @@ | |||
1 | name: 'Setup LoongArch64 toolchain' | ||
2 | description: 'Download Linux LoongArch64 toolchain and set output variables' | ||
3 | inputs: | ||
4 | version: | ||
5 | description: 'LoongArch64 version' | ||
6 | default: '2023.08.08' | ||
7 | outputs: | ||
8 | prefix: | ||
9 | description: "LoongArch toolchain prefix" | ||
10 | value: ${{ steps.final.outputs.prefix }} | ||
11 | cc: | ||
12 | description: "LoongArch C compiler" | ||
13 | value: ${{ steps.final.outputs.cc }} | ||
14 | cxx: | ||
15 | description: "LoongArch C++ compiler" | ||
16 | value: ${{ steps.final.outputs.cxx }} | ||
17 | runs: | ||
18 | using: 'composite' | ||
19 | steps: | ||
20 | - uses: actions/cache/restore@v4 | ||
21 | id: restore-cache | ||
22 | with: | ||
23 | path: /opt/cross-tools | ||
24 | key: loongarch64-${{ inputs.version }} | ||
25 | |||
26 | - name: 'Download LoongArch64 gcc+glibc toolchain' | ||
27 | if: ${{ !steps.restore-cache.outputs.cache-hit }} | ||
28 | shell: bash | ||
29 | run: | | ||
30 | url="https://github.com/loongson/build-tools/releases/download/${{ inputs.version }}/CLFS-loongarch64-8.1-x86_64-cross-tools-gcc-glibc.tar.xz" | ||
31 | |||
32 | wget "$url" -O /tmp/toolchain.tar.xz | ||
33 | |||
34 | mkdir -p /opt | ||
35 | tar -C /opt -x -f /tmp/toolchain.tar.xz | ||
36 | |||
37 | - uses: actions/cache/save@v4 | ||
38 | if: ${{ !steps.restore-cache.outputs.cache-hit }} | ||
39 | with: | ||
40 | path: /opt/cross-tools | ||
41 | key: loongarch64-${{ inputs.version }} | ||
42 | - name: 'Set output vars' | ||
43 | id: final | ||
44 | shell: bash | ||
45 | run: | | ||
46 | prefix=/opt/cross-tools | ||
47 | echo "prefix=${prefix}" >> $GITHUB_OUTPUT | ||
48 | cc="${prefix}/bin/loongarch64-unknown-linux-gnu-gcc" | ||
49 | cxx="${prefix}/bin/loongarch64-unknown-linux-gnu-g++" | ||
50 | echo "cc=${cc}" >> $GITHUB_OUTPUT | ||
51 | echo "cxx=${cxx}" >> $GITHUB_OUTPUT | ||
52 | echo "LOONGARCH64_CC=${cc}" >>$GITHUB_ENV | ||
53 | 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 @@ | |||
1 | name: 'Setup libusb for MSVC' | ||
2 | description: 'Download libusb sdk for MSVC, and set output/environment variables' | ||
3 | inputs: | ||
4 | version: | ||
5 | description: 'libusb version' | ||
6 | required: true | ||
7 | default: '1.0.27' | ||
8 | arch: | ||
9 | description: "libusb architecture (x86 or x64)" | ||
10 | rqeuired: true | ||
11 | outputs: | ||
12 | root: | ||
13 | description: "libusb root directory" | ||
14 | value: ${{ steps.final.outputs.root }} | ||
15 | runs: | ||
16 | using: 'composite' | ||
17 | steps: | ||
18 | - name: 'Restore cached libusb-${{ inputs.version }}.7z' | ||
19 | id: cache-restore | ||
20 | uses: actions/cache/restore@v4 | ||
21 | with: | ||
22 | path: 'C:\temp\libusb-${{ inputs.version }}.7z' | ||
23 | key: libusb-msvc-${{ inputs.version }} | ||
24 | - name: 'Download libusb ${{ inputs.version }}' | ||
25 | if: ${{ !steps.cache-restore.outputs.cache-hit }} | ||
26 | shell: pwsh | ||
27 | run: | | ||
28 | Invoke-WebRequest "https://github.com/libusb/libusb/releases/download/v${{ inputs.version }}/libusb-${{ inputs.version }}.7z" -OutFile "C:\temp\libusb-${{ inputs.version }}.7z" | ||
29 | - name: 'Cache libusb-${{ inputs.version }}.7z' | ||
30 | if: ${{ !steps.cache-restore.outputs.cache-hit }} | ||
31 | uses: actions/cache/save@v4 | ||
32 | with: | ||
33 | path: 'C:\temp\libusb-${{ inputs.version }}.7z' | ||
34 | key: libusb-msvc-${{ inputs.version }} | ||
35 | - name: 'Extract libusb' | ||
36 | shell: pwsh | ||
37 | run: | | ||
38 | 7z "-oC:\temp\libusb-${{ inputs.version }}" x "C:\temp\libusb-${{ inputs.version }}.7z" | ||
39 | - name: 'Set output vars' | ||
40 | id: final | ||
41 | shell: pwsh | ||
42 | run: | | ||
43 | if ('${{ inputs.arch }}' -eq 'x86') { | ||
44 | $archdir = "MS32"; | ||
45 | } elseif ('${{ inputs.arch }}' -eq 'x64') { | ||
46 | $archdir = "MS64"; | ||
47 | } else { | ||
48 | write-host "Invalid arch=${{ inputs.arch }}" | ||
49 | exit 1 | ||
50 | } | ||
51 | $libusb_incdir = "C:\temp\libusb-${{ inputs.version }}\include"; | ||
52 | $libusb_libdir = "C:\temp\libusb-${{ inputs.version }}\VS2022\${archdir}\dll"; | ||
53 | |||
54 | $libusb_header = "${libusb_incdir}\libusb.h"; | ||
55 | $libusb_implib = "${libusb_libdir}\libusb-1.0.lib"; | ||
56 | $libusb_dll = "${libusb_libdir}\libusb-1.0.dll"; | ||
57 | |||
58 | if (!(Test-Path "${libusb_header}")) { | ||
59 | write-host "${libusb_header} does not exist!" | ||
60 | exit 1 | ||
61 | } | ||
62 | if (!(Test-Path "${libusb_implib}")){ | ||
63 | write-host "${libusb_implib} does not exist!" | ||
64 | exit 1 | ||
65 | } | ||
66 | if (!(Test-Path "${libusb_dll}")) { | ||
67 | write-host "${libusb_dll} does not exist!" | ||
68 | exit 1 | ||
69 | } | ||
70 | echo "root=${libusb_incdir};${libusb_libdir}" >> $env:GITHUB_OUTPUT | ||
71 | 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 @@ | |||
1 | name: 'Setup ninja' | ||
2 | description: 'Download ninja and add it to the PATH environment variable' | ||
3 | inputs: | ||
4 | version: | ||
5 | description: 'Ninja version' | ||
6 | default: '1.12.1' | ||
7 | runs: | ||
8 | using: 'composite' | ||
9 | steps: | ||
10 | - name: 'Calculate variables' | ||
11 | id: calc | ||
12 | shell: sh | ||
13 | run: | | ||
14 | case "${{ runner.os }}-${{ runner.arch }}" in | ||
15 | "Linux-X86" | "Linux-X64") | ||
16 | archive="ninja-linux.zip" | ||
17 | ;; | ||
18 | "Linux-ARM64") | ||
19 | archive="ninja-linux-aarch64.zip" | ||
20 | ;; | ||
21 | "macOS-X86" | "macOS-X64" | "macOS-ARM64") | ||
22 | archive="ninja-mac.zip" | ||
23 | ;; | ||
24 | "Windows-X86" | "Windows-X64") | ||
25 | archive="ninja-win.zip" | ||
26 | ;; | ||
27 | "Windows-ARM64") | ||
28 | archive="ninja-winarm64.zip" | ||
29 | ;; | ||
30 | *) | ||
31 | echo "Unsupported ${{ runner.os }}-${{ runner.arch }}" | ||
32 | exit 1; | ||
33 | ;; | ||
34 | esac | ||
35 | echo "archive=${archive}" >> ${GITHUB_OUTPUT} | ||
36 | echo "cache-key=${archive}-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}" >> ${GITHUB_OUTPUT} | ||
37 | - name: 'Restore cached ${{ steps.calc.outputs.archive }}' | ||
38 | id: cache-restore | ||
39 | uses: actions/cache/restore@v4 | ||
40 | with: | ||
41 | path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}' | ||
42 | key: ${{ steps.calc.outputs.cache-key }} | ||
43 | - name: 'Download ninja ${{ inputs.version }} for ${{ runner.os }} (${{ runner.arch }})' | ||
44 | if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }} | ||
45 | shell: pwsh | ||
46 | run: | | ||
47 | Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v${{ inputs.version }}/${{ steps.calc.outputs.archive }}" -OutFile "${{ runner.temp }}/${{ steps.calc.outputs.archive }}" | ||
48 | - name: 'Cache ${{ steps.calc.outputs.archive }}' | ||
49 | if: ${{ !steps.cache-restore.outputs.cache-hit || steps.cache-restore.outputs.cache-hit == 'false' }} | ||
50 | uses: actions/cache/save@v4 | ||
51 | with: | ||
52 | path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}' | ||
53 | key: ${{ steps.calc.outputs.cache-key }} | ||
54 | - name: 'Extract ninja' | ||
55 | shell: pwsh | ||
56 | run: | | ||
57 | 7z "-o${{ runner.temp }}/ninja-${{ inputs.version }}-${{ runner.arch }}" x "${{ runner.temp }}/${{ steps.calc.outputs.archive }}" | ||
58 | - name: 'Set output variables' | ||
59 | id: final | ||
60 | shell: pwsh | ||
61 | run: | | ||
62 | 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 @@ | |||
1 | name: 'Setup GLES for PlayStation Vita' | ||
2 | description: 'Download GLES for VITA (PVR or PIB), and copy it into the vita sdk' | ||
3 | inputs: | ||
4 | pib-version: | ||
5 | description: 'PIB version' | ||
6 | default: '1.1.4' | ||
7 | pvr-version: | ||
8 | description: 'PVR_PSP2 version' | ||
9 | default: '3.9' | ||
10 | type: | ||
11 | description: '"pib" or "pvr"' | ||
12 | default: '' | ||
13 | runs: | ||
14 | using: 'composite' | ||
15 | steps: | ||
16 | - name: 'Calculate variables' | ||
17 | id: calc | ||
18 | shell: sh | ||
19 | run: | | ||
20 | if test "x${VITASDK}" = "x"; then | ||
21 | echo "VITASDK must be defined" | ||
22 | exit 1; | ||
23 | fi | ||
24 | case "x${{ inputs.type }}" in | ||
25 | "xpvr") | ||
26 | echo "cache-key=SDL-vita-gles-pvr-${{ inputs.pvr-version}}" >> ${GITHUB_OUTPUT} | ||
27 | ;; | ||
28 | "xpib") | ||
29 | echo "cache-key=SDL-vita-gles-pib-${{ inputs.pib-version}}" >> ${GITHUB_OUTPUT} | ||
30 | ;; | ||
31 | *) | ||
32 | echo "Invalid type. Must be 'pib' or 'pvr'." | ||
33 | exit 1 | ||
34 | ;; | ||
35 | esac | ||
36 | - uses: actions/cache/restore@v4 | ||
37 | id: restore-cache | ||
38 | with: | ||
39 | path: /vita/dependencies | ||
40 | key: '${{ steps.calc.outputs.cache-key }}' | ||
41 | - name: 'Download PVR_PSP2 (GLES)' | ||
42 | if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pvr' }} | ||
43 | shell: sh | ||
44 | run: | | ||
45 | pvr_psp2_version=${{ inputs.pvr-version }} | ||
46 | |||
47 | mkdir -p /vita/dependencies/include | ||
48 | mkdir -p /vita/dependencies/lib | ||
49 | |||
50 | # Configure PVR_PSP2 headers | ||
51 | wget https://github.com/GrapheneCt/PVR_PSP2/archive/refs/tags/v$pvr_psp2_version.zip -P/tmp | ||
52 | unzip /tmp/v$pvr_psp2_version.zip -d/tmp | ||
53 | cp -r /tmp/PVR_PSP2-$pvr_psp2_version/include/* /vita/dependencies/include | ||
54 | rm /tmp/v$pvr_psp2_version.zip | ||
55 | |||
56 | # include guard of PVR_PSP2's khrplatform.h does not match the usual one | ||
57 | sed -i -e s/__drvkhrplatform_h_/__khrplatform_h_/ /vita/dependencies/include/KHR/khrplatform.h | ||
58 | |||
59 | # Configure PVR_PSP2 stub libraries | ||
60 | wget https://github.com/GrapheneCt/PVR_PSP2/releases/download/v$pvr_psp2_version/vitasdk_stubs.zip -P/tmp | ||
61 | unzip /tmp/vitasdk_stubs.zip -d/tmp/pvr_psp2_stubs | ||
62 | find /tmp/pvr_psp2_stubs -type f -name "*.a" -exec cp {} /vita/dependencies/lib \; | ||
63 | rm /tmp/vitasdk_stubs.zip | ||
64 | rm -rf /tmp/pvr_psp2_stubs | ||
65 | |||
66 | - name: 'Download gl4es4vita (OpenGL)' | ||
67 | if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pib' }} | ||
68 | shell: sh | ||
69 | run: | | ||
70 | gl4es4vita_version=${{ inputs.pib-version }} | ||
71 | |||
72 | mkdir -p /vita/dependencies/include | ||
73 | mkdir -p /vita/dependencies/lib | ||
74 | |||
75 | # Configure gl4es4vita headers | ||
76 | wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/include.zip -P/tmp | ||
77 | unzip -o /tmp/include.zip -d/vita/dependencies/include | ||
78 | rm /tmp/include.zip | ||
79 | |||
80 | # Configure gl4es4vita stub libraries | ||
81 | wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp | ||
82 | unzip /tmp/vitasdk_stubs.zip -d/vita/dependencies/lib | ||
83 | |||
84 | - uses: actions/cache/save@v4 | ||
85 | if: ${{ !steps.restore-cache.outputs.cache-hit }} | ||
86 | with: | ||
87 | path: /vita/dependencies | ||
88 | key: '${{ steps.calc.outputs.cache-key }}' | ||
89 | |||
90 | - name: Copy PVR_PSP2 (GLES) or gl4es4vita (OpenGL) to vita toolchain dir | ||
91 | shell: sh | ||
92 | run: | | ||
93 | cp -rv /vita/dependencies/* ${VITASDK}/arm-vita-eabi | ||