mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-25 22:19:10 +00:00
ci: add vita job
This commit is contained in:
parent
5617ce277d
commit
44f1f81d6c
3 changed files with 132 additions and 2 deletions
93
.github/actions/setup-vita-gles/action.yml
vendored
Normal file
93
.github/actions/setup-vita-gles/action.yml
vendored
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
name: 'Setup GLES for PlayStation Vita'
|
||||||
|
description: 'Setup GLES (PVR and PIB)'
|
||||||
|
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 "VITASKD 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
|
33
.github/workflows/create-test-plan.py
vendored
33
.github/workflows/create-test-plan.py
vendored
|
@ -49,6 +49,7 @@ class SdlPlatform(Enum):
|
||||||
PowerPC64 = "powerpc64"
|
PowerPC64 = "powerpc64"
|
||||||
Ps2 = "ps2"
|
Ps2 = "ps2"
|
||||||
Psp = "psp"
|
Psp = "psp"
|
||||||
|
Vita = "vita"
|
||||||
Riscos = "riscos"
|
Riscos = "riscos"
|
||||||
FreeBSD = "freebsd"
|
FreeBSD = "freebsd"
|
||||||
NetBSD = "netbsd"
|
NetBSD = "netbsd"
|
||||||
|
@ -67,6 +68,11 @@ class IntelCompiler(Enum):
|
||||||
Icx = "icx"
|
Icx = "icx"
|
||||||
|
|
||||||
|
|
||||||
|
class VitaGLES(Enum):
|
||||||
|
Pib = "pib"
|
||||||
|
Pvr = "pvr"
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass(slots=True)
|
@dataclasses.dataclass(slots=True)
|
||||||
class JobSpec:
|
class JobSpec:
|
||||||
name: str
|
name: str
|
||||||
|
@ -89,6 +95,7 @@ class JobSpec:
|
||||||
msvc_arch: Optional[MsvcArch] = None
|
msvc_arch: Optional[MsvcArch] = None
|
||||||
clang_cl: bool = False
|
clang_cl: bool = False
|
||||||
uwp: bool = False
|
uwp: bool = False
|
||||||
|
vita_gles: Optional[VitaGLES] = None
|
||||||
|
|
||||||
|
|
||||||
JOB_SPECS = {
|
JOB_SPECS = {
|
||||||
|
@ -124,6 +131,8 @@ JOB_SPECS = {
|
||||||
"ppc64": JobSpec(name="PowerPC64", os=JobOs.UbuntuLatest, platform=SdlPlatform.PowerPC64, artifact="SDL-ppc64le", container="dockcross/linux-ppc64le:latest", ),
|
"ppc64": JobSpec(name="PowerPC64", os=JobOs.UbuntuLatest, platform=SdlPlatform.PowerPC64, artifact="SDL-ppc64le", container="dockcross/linux-ppc64le:latest", ),
|
||||||
"ps2": JobSpec(name="Sony PlayStation 2", os=JobOs.UbuntuLatest, platform=SdlPlatform.Ps2, artifact="SDL-ps2", container="ps2dev/ps2dev:latest", ),
|
"ps2": JobSpec(name="Sony PlayStation 2", os=JobOs.UbuntuLatest, platform=SdlPlatform.Ps2, artifact="SDL-ps2", container="ps2dev/ps2dev:latest", ),
|
||||||
"psp": JobSpec(name="Sony PlayStation Portable", os=JobOs.UbuntuLatest, platform=SdlPlatform.Psp, artifact="SDL-psp", container="pspdev/pspdev:latest", ),
|
"psp": JobSpec(name="Sony PlayStation Portable", os=JobOs.UbuntuLatest, platform=SdlPlatform.Psp, artifact="SDL-psp", container="pspdev/pspdev:latest", ),
|
||||||
|
"vita-pib": JobSpec(name="Sony PlayStation Vita (GLES w/ pib)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Vita, artifact="SDL-vita-pib", container="vitasdk/vitasdk:latest", vita_gles=VitaGLES.Pib, ),
|
||||||
|
"vita-pvr": JobSpec(name="Sony PlayStation Vita (GLES w/ PVR_PSP2)", os=JobOs.UbuntuLatest, platform=SdlPlatform.Vita, artifact="SDL-vita-pvr", container="vitasdk/vitasdk:latest", vita_gles=VitaGLES.Pvr, ),
|
||||||
"riscos": JobSpec(name="RISC OS", os=JobOs.UbuntuLatest, platform=SdlPlatform.Riscos, artifact="SDL-riscos", container="riscosdotinfo/riscos-gccsdk-4.7:latest", ),
|
"riscos": JobSpec(name="RISC OS", os=JobOs.UbuntuLatest, platform=SdlPlatform.Riscos, artifact="SDL-riscos", container="riscosdotinfo/riscos-gccsdk-4.7:latest", ),
|
||||||
"netbsd": JobSpec(name="NetBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.NetBSD, artifact="SDL-netbsd-x64", ),
|
"netbsd": JobSpec(name="NetBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.NetBSD, artifact="SDL-netbsd-x64", ),
|
||||||
"freebsd": JobSpec(name="FreeBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.FreeBSD, artifact="SDL-freebsd-x64", ),
|
"freebsd": JobSpec(name="FreeBSD", os=JobOs.UbuntuLatest, platform=SdlPlatform.FreeBSD, artifact="SDL-freebsd-x64", ),
|
||||||
|
@ -187,6 +196,7 @@ class JobDetails:
|
||||||
cpactions_arch: str = ""
|
cpactions_arch: str = ""
|
||||||
cpactions_setup_cmd: str = ""
|
cpactions_setup_cmd: str = ""
|
||||||
cpactions_install_cmd: str = ""
|
cpactions_install_cmd: str = ""
|
||||||
|
setup_vita_gles_type: str = ""
|
||||||
|
|
||||||
def to_workflow(self) -> dict[str, str|bool]:
|
def to_workflow(self) -> dict[str, str|bool]:
|
||||||
data = {
|
data = {
|
||||||
|
@ -242,6 +252,7 @@ class JobDetails:
|
||||||
"cpactions-arch": self.cpactions_arch,
|
"cpactions-arch": self.cpactions_arch,
|
||||||
"cpactions-setup-cmd": self.cpactions_setup_cmd,
|
"cpactions-setup-cmd": self.cpactions_setup_cmd,
|
||||||
"cpactions-install-cmd": self.cpactions_install_cmd,
|
"cpactions-install-cmd": self.cpactions_install_cmd,
|
||||||
|
"setup-vita-gles-type": self.setup_vita_gles_type,
|
||||||
}
|
}
|
||||||
return {k: v for k, v in data.items() if v != ""}
|
return {k: v for k, v in data.items() if v != ""}
|
||||||
|
|
||||||
|
@ -476,6 +487,28 @@ def spec_to_job(spec: JobSpec) -> JobDetails:
|
||||||
job.cc = "psp-gcc"
|
job.cc = "psp-gcc"
|
||||||
job.ldflags = ["-L${PSPDEV}/lib", "-L${PSPDEV}/psp/lib", "-L${PSPDEV}/psp/sdk/lib", ]
|
job.ldflags = ["-L${PSPDEV}/lib", "-L${PSPDEV}/psp/lib", "-L${PSPDEV}/psp/sdk/lib", ]
|
||||||
job.pollute_directories = ["${PSPDEV}/include", "${PSPDEV}/psp/include", "${PSPDEV}/psp/sdk/include", ]
|
job.pollute_directories = ["${PSPDEV}/include", "${PSPDEV}/psp/include", "${PSPDEV}/psp/sdk/include", ]
|
||||||
|
case SdlPlatform.Vita:
|
||||||
|
job.sudo = ""
|
||||||
|
job.apt_packages = []
|
||||||
|
job.apk_packages = ["cmake", "ninja", "pkgconf", "bash", "tar"]
|
||||||
|
job.cmake_toolchain_file = "${VITASDK}/share/vita.toolchain.cmake"
|
||||||
|
assert spec.vita_gles is not None
|
||||||
|
job.setup_vita_gles_type = {
|
||||||
|
VitaGLES.Pib: "pib",
|
||||||
|
VitaGLES.Pvr: "pvr",
|
||||||
|
}[spec.vita_gles]
|
||||||
|
job.cmake_arguments.extend((
|
||||||
|
f"-DVIDEO_VITA_PIB={ 'true' if spec.vita_gles == VitaGLES.Pib else 'false' }",
|
||||||
|
f"-DVIDEO_VITA_PVR={ 'true' if spec.vita_gles == VitaGLES.Pvr else 'false' }",
|
||||||
|
"-DSDL_ARMNEON=ON",
|
||||||
|
"-DSDL_ARMSIMD=ON",
|
||||||
|
))
|
||||||
|
# Fix vita.toolchain.cmake (https://github.com/vitasdk/vita-toolchain/pull/253)
|
||||||
|
job.source_cmd = "sed -i -E 's/set\( PKG_CONFIG_EXECUTABLE \"\$\{VITASDK}\/bin\/arm-vita-eabi-pkg-config\" )/set( PKG_CONFIG_EXECUTABLE \"${VITASDK}\/bin\/arm-vita-eabi-pkg-config\" CACHE PATH \"Path of pkg-config executable\" )/' ${VITASDK}/share/vita.toolchain.cmake"
|
||||||
|
job.clang_tidy = False
|
||||||
|
job.run_tests = False
|
||||||
|
job.shared = False
|
||||||
|
job.cc = "arm-vita-eabi-gcc"
|
||||||
case SdlPlatform.Haiku:
|
case SdlPlatform.Haiku:
|
||||||
fpic = False
|
fpic = False
|
||||||
job.run_tests = False
|
job.run_tests = False
|
||||||
|
|
8
.github/workflows/generic.yml
vendored
8
.github/workflows/generic.yml
vendored
|
@ -38,8 +38,7 @@ jobs:
|
||||||
- name: 'Set up ninja'
|
- name: 'Set up ninja'
|
||||||
if: ${{ matrix.platform.setup-ninja }}
|
if: ${{ matrix.platform.setup-ninja }}
|
||||||
uses: ./.github/actions/setup-ninja
|
uses: ./.github/actions/setup-ninja
|
||||||
- name: 'Set up libusb'
|
- name: 'Set up libusb for MSVC'
|
||||||
id: libusb
|
|
||||||
if: ${{ matrix.platform.setup-libusb-arch != '' }}
|
if: ${{ matrix.platform.setup-libusb-arch != '' }}
|
||||||
uses: ./.github/actions/setup-msvc-libusb
|
uses: ./.github/actions/setup-msvc-libusb
|
||||||
with:
|
with:
|
||||||
|
@ -114,6 +113,11 @@ jobs:
|
||||||
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
||||||
brew update
|
brew update
|
||||||
brew install ${{ matrix.platform.brew-packages }}
|
brew install ${{ matrix.platform.brew-packages }}
|
||||||
|
- name: 'Set up GLES for VITA' # Must be after apk
|
||||||
|
if: ${{ matrix.platform.setup-vita-gles-type != '' }}
|
||||||
|
uses: ./.github/actions/setup-vita-gles
|
||||||
|
with:
|
||||||
|
type: ${{ matrix.platform.setup-vita-gles-type }}
|
||||||
|
|
||||||
- name: 'Pollute toolchain with "bad SDL headers'
|
- name: 'Pollute toolchain with "bad SDL headers'
|
||||||
if: ${{ matrix.platform.pollute-directories != '' }}
|
if: ${{ matrix.platform.pollute-directories != '' }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue