action.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. mkdir -p /vita/dependencies/include
  47. mkdir -p /vita/dependencies/lib
  48. # Configure PVR_PSP2 headers
  49. wget https://github.com/GrapheneCt/PVR_PSP2/archive/refs/tags/v$pvr_psp2_version.zip -P/tmp
  50. unzip /tmp/v$pvr_psp2_version.zip -d/tmp
  51. cp -r /tmp/PVR_PSP2-$pvr_psp2_version/include/* /vita/dependencies/include
  52. rm /tmp/v$pvr_psp2_version.zip
  53. # include guard of PVR_PSP2's khrplatform.h does not match the usual one
  54. sed -i -e s/__drvkhrplatform_h_/__khrplatform_h_/ /vita/dependencies/include/KHR/khrplatform.h
  55. # Configure PVR_PSP2 stub libraries
  56. wget https://github.com/GrapheneCt/PVR_PSP2/releases/download/v$pvr_psp2_version/vitasdk_stubs.zip -P/tmp
  57. unzip /tmp/vitasdk_stubs.zip -d/tmp/pvr_psp2_stubs
  58. find /tmp/pvr_psp2_stubs -type f -name "*.a" -exec cp {} /vita/dependencies/lib \;
  59. rm /tmp/vitasdk_stubs.zip
  60. rm -rf /tmp/pvr_psp2_stubs
  61. - name: 'Download gl4es4vita (OpenGL)'
  62. if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pib' }}
  63. shell: sh
  64. run: |
  65. gl4es4vita_version=${{ inputs.pib-version }}
  66. mkdir -p /vita/dependencies/include
  67. mkdir -p /vita/dependencies/lib
  68. # Configure gl4es4vita headers
  69. wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/include.zip -P/tmp
  70. unzip -o /tmp/include.zip -d/vita/dependencies/include
  71. rm /tmp/include.zip
  72. # Configure gl4es4vita stub libraries
  73. wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp
  74. unzip /tmp/vitasdk_stubs.zip -d/vita/dependencies/lib
  75. - uses: actions/cache/save@v4
  76. if: ${{ !steps.restore-cache.outputs.cache-hit }}
  77. with:
  78. path: /vita/dependencies
  79. key: '${{ steps.calc.outputs.cache-key }}'
  80. - name: Copy PVR_PSP2 (GLES) or gl4es4vita (OpenGL) to vita toolchain dir
  81. shell: sh
  82. run: |
  83. cp -rv /vita/dependencies/* ${VITASDK}/arm-vita-eabi