SDL
93 строки · 3.4 Кб
1name: 'Setup GLES for PlayStation Vita'
2description: 'Download GLES for VITA (PVR or PIB), and copy it into the vita sdk'
3inputs:
4pib-version:
5description: 'PIB version'
6default: '1.1.4'
7pvr-version:
8description: 'PVR_PSP2 version'
9default: '3.9'
10type:
11description: '"pib" or "pvr"'
12default: ''
13runs:
14using: 'composite'
15steps:
16- name: 'Calculate variables'
17id: calc
18shell: sh
19run: |
20if test "x${VITASDK}" = "x"; then
21echo "VITASDK must be defined"
22exit 1;
23fi
24case "x${{ inputs.type }}" in
25"xpvr")
26echo "cache-key=SDL-vita-gles-pvr-${{ inputs.pvr-version}}" >> ${GITHUB_OUTPUT}
27;;
28"xpib")
29echo "cache-key=SDL-vita-gles-pib-${{ inputs.pib-version}}" >> ${GITHUB_OUTPUT}
30;;
31*)
32echo "Invalid type. Must be 'pib' or 'pvr'."
33exit 1
34;;
35esac
36- uses: actions/cache/restore@v4
37id: restore-cache
38with:
39path: /vita/dependencies
40key: '${{ steps.calc.outputs.cache-key }}'
41- name: 'Download PVR_PSP2 (GLES)'
42if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pvr' }}
43shell: sh
44run: |
45pvr_psp2_version=${{ inputs.pvr-version }}
46
47mkdir -p /vita/dependencies/include
48mkdir -p /vita/dependencies/lib
49
50# Configure PVR_PSP2 headers
51wget https://github.com/GrapheneCt/PVR_PSP2/archive/refs/tags/v$pvr_psp2_version.zip -P/tmp
52unzip /tmp/v$pvr_psp2_version.zip -d/tmp
53cp -r /tmp/PVR_PSP2-$pvr_psp2_version/include/* /vita/dependencies/include
54rm /tmp/v$pvr_psp2_version.zip
55
56# include guard of PVR_PSP2's khrplatform.h does not match the usual one
57sed -i -e s/__drvkhrplatform_h_/__khrplatform_h_/ /vita/dependencies/include/KHR/khrplatform.h
58
59# Configure PVR_PSP2 stub libraries
60wget https://github.com/GrapheneCt/PVR_PSP2/releases/download/v$pvr_psp2_version/vitasdk_stubs.zip -P/tmp
61unzip /tmp/vitasdk_stubs.zip -d/tmp/pvr_psp2_stubs
62find /tmp/pvr_psp2_stubs -type f -name "*.a" -exec cp {} /vita/dependencies/lib \;
63rm /tmp/vitasdk_stubs.zip
64rm -rf /tmp/pvr_psp2_stubs
65
66- name: 'Download gl4es4vita (OpenGL)'
67if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pib' }}
68shell: sh
69run: |
70gl4es4vita_version=${{ inputs.pib-version }}
71
72mkdir -p /vita/dependencies/include
73mkdir -p /vita/dependencies/lib
74
75# Configure gl4es4vita headers
76wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/include.zip -P/tmp
77unzip -o /tmp/include.zip -d/vita/dependencies/include
78rm /tmp/include.zip
79
80# Configure gl4es4vita stub libraries
81wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp
82unzip /tmp/vitasdk_stubs.zip -d/vita/dependencies/lib
83
84- uses: actions/cache/save@v4
85if: ${{ !steps.restore-cache.outputs.cache-hit }}
86with:
87path: /vita/dependencies
88key: '${{ steps.calc.outputs.cache-key }}'
89
90- name: Copy PVR_PSP2 (GLES) or gl4es4vita (OpenGL) to vita toolchain dir
91shell: sh
92run: |
93cp -rv /vita/dependencies/* ${VITASDK}/arm-vita-eabi
94