vita.yml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. name: Build (Sony Playstation Vita)
  2. on: [push, pull_request]
  3. concurrency:
  4. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
  5. cancel-in-progress: true
  6. defaults:
  7. run:
  8. shell: sh
  9. jobs:
  10. vita:
  11. name: ${{ matrix.platform.name }}
  12. runs-on: ubuntu-latest
  13. container:
  14. image: vitasdk/vitasdk:latest
  15. strategy:
  16. fail-fast: false
  17. matrix:
  18. platform:
  19. - { name: Vita (GLES w/ pib), os: windows-latest, pib: true, artifact: SDL-vita-pib }
  20. - { name: Vita (GLES w/ PVR_PSP2 + gles4vita), os: windows-latest, pvr: true, artifact: SDL-vita-pvr }
  21. steps:
  22. - uses: actions/checkout@v3
  23. - name: Install build requirements
  24. run: |
  25. apk update
  26. apk add cmake ninja pkgconf bash
  27. - name: Configure PVR_PSP2 (GLES)
  28. if: ${{ !!matrix.platform.pvr }}
  29. run: |
  30. pvr_psp2_version=3.9
  31. # Configure PVR_PSP2 headers
  32. wget https://github.com/GrapheneCt/PVR_PSP2/archive/refs/tags/v$pvr_psp2_version.zip -P/tmp
  33. unzip /tmp/v$pvr_psp2_version.zip -d/tmp
  34. cp -r /tmp/PVR_PSP2-$pvr_psp2_version/include/* ${VITASDK}/arm-vita-eabi/include
  35. rm /tmp/v$pvr_psp2_version.zip
  36. # include guard of PVR_PSP2's khrplatform.h does not match the usual one
  37. sed -i -e s/__drvkhrplatform_h_/__khrplatform_h_/ ${VITASDK}/arm-vita-eabi/include/KHR/khrplatform.h
  38. # Configure PVR_PSP2 stub libraries
  39. wget https://github.com/GrapheneCt/PVR_PSP2/releases/download/v$pvr_psp2_version/vitasdk_stubs.zip -P/tmp
  40. unzip /tmp/vitasdk_stubs.zip -d/tmp/pvr_psp2_stubs
  41. find /tmp/pvr_psp2_stubs -type f -name "*.a" -exec cp {} ${VITASDK}/arm-vita-eabi/lib \;
  42. rm /tmp/vitasdk_stubs.zip
  43. rm -rf /tmp/pvr_psp2_stubs
  44. - name: Configure gl4es4vita (OpenGL)
  45. if: ${{ !!matrix.platform.pvr }}
  46. run: |
  47. gl4es4vita_version=1.1.4
  48. # Configure gl4es4vita headers
  49. wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/include.zip -P/tmp
  50. unzip -o /tmp/include.zip -d${VITASDK}/arm-vita-eabi/include
  51. rm /tmp/include.zip
  52. # Configure gl4es4vita stub libraries
  53. wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp
  54. unzip /tmp/vitasdk_stubs.zip -d${VITASDK}/arm-vita-eabi/lib
  55. - name: Configure (CMake)
  56. run: |
  57. cmake -S . -B build -G Ninja \
  58. -Wdeprecated -Wdev -Werror \
  59. -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
  60. -DVIDEO_VITA_PIB=${{ !!matrix.platform.pib }} \
  61. -DVIDEO_VITA_PVR=${{ !!matrix.platform.pvr }} \
  62. -DSDL_WERROR=ON \
  63. -DSDL_TESTS=ON \
  64. -DSDL_INSTALL_TESTS=ON \
  65. -DCMAKE_BUILD_TYPE=Release \
  66. -DCMAKE_INSTALL_PREFIX=prefix
  67. - name: Build (CMake)
  68. run: cmake --build build --verbose
  69. - name: Install (CMake)
  70. run: |
  71. echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV
  72. cmake --install build/
  73. ( cd prefix; find ) | LC_ALL=C sort -u
  74. - name: Package (CPack)
  75. run: |
  76. cmake --build build/ --config Release --target package
  77. - name: Verify CMake configuration files
  78. run: |
  79. cmake -S cmake/test -B cmake_config_build -G Ninja \
  80. -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
  81. -DTEST_SHARED=FALSE \
  82. -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} \
  83. -DCMAKE_BUILD_TYPE=Release
  84. cmake --build cmake_config_build --verbose
  85. - name: Verify sdl3.pc
  86. run: |
  87. export CC=arm-vita-eabi-gcc
  88. export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig
  89. cmake/test/test_pkgconfig.sh
  90. - uses: actions/upload-artifact@v3
  91. with:
  92. if-no-files-found: error
  93. name: ${{ matrix.platform.artifact }}
  94. path: build/dist/SDL3*