SDL

Форк
0
93 строки · 3.4 Кб
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
94

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.