Skip to content

Commit

Permalink
Merge pull request #137 from libsdl-org/SDL2
Browse files Browse the repository at this point in the history
Merge SDL2 upstream
  • Loading branch information
capehill authored Nov 29, 2024
2 parents b66de0a + a4ec0b1 commit 34f6793
Show file tree
Hide file tree
Showing 15 changed files with 1,539 additions and 57 deletions.
93 changes: 93 additions & 0 deletions .github/actions/setup-vita-gles/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: 'Setup GLES for PlayStation Vita'
description: 'Download GLES for VITA (PVR or PIB), and copy it into the vita sdk'
inputs:
pib-version:
description: 'PIB version'
default: '1.1.4'
pvr-version:
description: 'PVR_PSP2 version'
default: '3.9'
type:
description: '"pib" or "pvr"'
default: ''
runs:
using: 'composite'
steps:
- name: 'Calculate variables'
id: calc
shell: sh
run: |
if test "x${VITASDK}" = "x"; then
echo "VITASDK must be defined"
exit 1;
fi
case "x${{ inputs.type }}" in
"xpvr")
echo "cache-key=SDL-vita-gles-pvr-${{ inputs.pvr-version}}" >> ${GITHUB_OUTPUT}
;;
"xpib")
echo "cache-key=SDL-vita-gles-pib-${{ inputs.pib-version}}" >> ${GITHUB_OUTPUT}
;;
*)
echo "Invalid type. Must be 'pib' or 'pvr'."
exit 1
;;
esac
- uses: actions/cache/restore@v4
id: restore-cache
with:
path: /vita/dependencies
key: '${{ steps.calc.outputs.cache-key }}'
- name: 'Download PVR_PSP2 (GLES)'
if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pvr' }}
shell: sh
run: |
pvr_psp2_version=${{ inputs.pvr-version }}
mkdir -p /vita/dependencies/include
mkdir -p /vita/dependencies/lib
# Configure PVR_PSP2 headers
wget https://github.com/GrapheneCt/PVR_PSP2/archive/refs/tags/v$pvr_psp2_version.zip -P/tmp
unzip /tmp/v$pvr_psp2_version.zip -d/tmp
cp -r /tmp/PVR_PSP2-$pvr_psp2_version/include/* /vita/dependencies/include
rm /tmp/v$pvr_psp2_version.zip
# include guard of PVR_PSP2's khrplatform.h does not match the usual one
sed -i -e s/__drvkhrplatform_h_/__khrplatform_h_/ /vita/dependencies/include/KHR/khrplatform.h
# Configure PVR_PSP2 stub libraries
wget https://github.com/GrapheneCt/PVR_PSP2/releases/download/v$pvr_psp2_version/vitasdk_stubs.zip -P/tmp
unzip /tmp/vitasdk_stubs.zip -d/tmp/pvr_psp2_stubs
find /tmp/pvr_psp2_stubs -type f -name "*.a" -exec cp {} /vita/dependencies/lib \;
rm /tmp/vitasdk_stubs.zip
rm -rf /tmp/pvr_psp2_stubs
- name: 'Download gl4es4vita (OpenGL)'
if: ${{ !steps.restore-cache.outputs.cache-hit && inputs.type == 'pib' }}
shell: sh
run: |
gl4es4vita_version=${{ inputs.pib-version }}
mkdir -p /vita/dependencies/include
mkdir -p /vita/dependencies/lib
# Configure gl4es4vita headers
wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/include.zip -P/tmp
unzip -o /tmp/include.zip -d/vita/dependencies/include
rm /tmp/include.zip
# Configure gl4es4vita stub libraries
wget https://github.com/SonicMastr/gl4es4vita/releases/download/v$gl4es4vita_version-vita/vitasdk_stubs.zip -P/tmp
unzip /tmp/vitasdk_stubs.zip -d/vita/dependencies/lib
- uses: actions/cache/save@v4
if: ${{ !steps.restore-cache.outputs.cache-hit }}
with:
path: /vita/dependencies
key: '${{ steps.calc.outputs.cache-key }}'

- name: Copy PVR_PSP2 (GLES) or gl4es4vita (OpenGL) to vita toolchain dir
shell: sh
run: |
cp -rv /vita/dependencies/* ${VITASDK}/arm-vita-eabi
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: 'Build (All)'

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
controller:
name: 'Create test plan'
runs-on: 'ubuntu-latest'
outputs:
platforms-level1: ${{ steps.plan.outputs.platforms-level1 }}
platforms-others: ${{ steps.plan.outputs.platforms-others }}
steps:
- uses: actions/setup-python@main
with:
python-version: 3.x
- uses: actions/checkout@main
with:
sparse-checkout: '.github/workflows/create-test-plan.py'
- name: 'Create plan'
id: plan
run: |
# Adding [sdl-ci-filter GLOB] to the commit message will limit the jobs
# e.g. [sdl-ci-filter msvc-*]
EOF=$(openssl rand -hex 32)
cat >/tmp/commit_message.txt <<$EOF
${{ github.event.head_commit.message }}
$EOF
python .github/workflows/create-test-plan.py \
--github-variable-prefix platforms \
--github-ci \
--verbose \
${{ (github.repository_owner != 'libsdl-org' && '--no-artifact') || '' }} \
--commit-message-file /tmp/commit_message.txt
level1:
needs: [controller]
uses: './.github/workflows/generic.yml'
with:
platforms: ${{ needs.controller.outputs.platforms-level1 }}
level2:
needs: [controller, level1]
uses: './.github/workflows/generic.yml'
with:
platforms: ${{ needs.controller.outputs.platforms-others }}
Loading

0 comments on commit 34f6793

Please sign in to comment.