1
0

vita.yml 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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: GLES (pib), os: windows-latest, pib: true }
  20. - { name: GLES (PVR_PSP2 + gl4es4vita), os: windows-latest, pvr: true }
  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. -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
  59. -DVIDEO_VITA_PIB=${{ !!matrix.platform.pib }} \
  60. -DVIDEO_VITA_PVR=${{ !!matrix.platform.pvr }} \
  61. -DSDL_WERROR=ON \
  62. -DSDL_TESTS=ON \
  63. -DSDL_INSTALL_TESTS=ON \
  64. -DCMAKE_BUILD_TYPE=Release \
  65. -DCMAKE_INSTALL_PREFIX=prefix
  66. - name: Build
  67. run: cmake --build build --verbose
  68. - name: Install CMake
  69. run: |
  70. echo "SDL3_DIR=$(pwd)/prefix" >> $GITHUB_ENV
  71. cmake --install build/
  72. ( cd prefix; find ) | LC_ALL=C sort -u
  73. - name: Verify CMake configuration files
  74. run: |
  75. cmake -S cmake/test -B cmake_config_build -G Ninja \
  76. -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake \
  77. -DTEST_SHARED=FALSE \
  78. -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} \
  79. -DCMAKE_BUILD_TYPE=Release
  80. cmake --build cmake_config_build --verbose
  81. - name: Verify sdl3.pc
  82. run: |
  83. export CC=arm-vita-eabi-gcc
  84. export PKG_CONFIG_PATH=${{ env.SDL3_DIR }}/lib/pkgconfig
  85. cmake/test/test_pkgconfig.sh