mirror of
https://github.com/ARMSX2/ARMSX1.git
synced 2026-08-24 16:53:35 -07:00
Fix CI matrices and add Vita workflow
This commit is contained in:
@@ -27,7 +27,7 @@ jobs:
|
||||
packages: "build-essential binutils cmake file git libgl1-mesa-dev libsdl2-dev make pkg-config python3 python3-jinja2 zip"
|
||||
- target: x32
|
||||
extra_arch: "i386"
|
||||
apt_source_arch: ""
|
||||
apt_source_arch: "x32"
|
||||
packages: "binutils cmake file gcc-multilib g++-multilib git libc6-dev-i386 libgl1-mesa-dev:i386 libsdl2-dev:i386 make pkg-config python3 python3-jinja2 zip"
|
||||
- target: arm64
|
||||
extra_arch: "arm64"
|
||||
@@ -161,6 +161,58 @@ jobs:
|
||||
name: armsx-macos-ventura-x64
|
||||
path: artifacts/macos/ventura/armsx-macos-ventura-x64.zip
|
||||
|
||||
psvita:
|
||||
name: PSVita VPK
|
||||
runs-on: psvita
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: false
|
||||
|
||||
- name: Fetch submodules with private repo token
|
||||
shell: bash
|
||||
env:
|
||||
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}
|
||||
FSUI_SUBMODULE_TOKEN: ${{ secrets.FSUI_SUBMODULE_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
token="${GIT_TOKEN:-${FSUI_SUBMODULE_TOKEN:-}}"
|
||||
if [ -z "$token" ]; then
|
||||
echo "GIT_TOKEN (or FSUI_SUBMODULE_TOKEN) is required to fetch the private fsui-lib submodule." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
auth="$(printf 'x-access-token:%s' "$token" | base64 | tr -d '\n')"
|
||||
git config --global http.https://git.nanodata.cloud/.extraheader "AUTHORIZATION: basic $auth"
|
||||
git submodule sync --recursive
|
||||
git submodule update --init --recursive --depth=1
|
||||
|
||||
- name: Validate Vita runner
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -z "${VITASDK:-}" ]; then
|
||||
echo "VITASDK must be set on the Vita runner." >&2
|
||||
exit 1
|
||||
fi
|
||||
for tool in cargo vita-mksfoex vita-elf-create vita-make-fself vita-pack-vpk; do
|
||||
if ! command -v "$tool" >/dev/null 2>&1; then
|
||||
echo "$tool is required on the Vita runner." >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Build PSVita package
|
||||
shell: bash
|
||||
env:
|
||||
RUSTUP_TOOLCHAIN: nightly
|
||||
run: ./build.sh psvita
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: armsx-psvita-vpk
|
||||
path: bin/psvita/ARMSX.vpk
|
||||
|
||||
linux-musl:
|
||||
name: Linux musl ${{ matrix.target }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
@@ -185,6 +185,9 @@ C_SOURCES := $(wildcard psx/*.c) \
|
||||
frontend/config.c \
|
||||
frontend/diagnostics.c \
|
||||
frontend/toml.c
|
||||
ifeq ($(PSVITA_TARGET),1)
|
||||
C_SOURCES += frontend/vita_sdl_stubs.c
|
||||
endif
|
||||
C_SOURCES_SHARED := $(C_SOURCES)
|
||||
|
||||
CPP_SOURCES := frontend/main.cpp
|
||||
|
||||
@@ -32,8 +32,34 @@ build_fsui_native() {
|
||||
}
|
||||
|
||||
build_fsui_wasm() {
|
||||
if ! command -v emcmake >/dev/null 2>&1; then
|
||||
echo "emcmake is required for the wasm FSUI build."
|
||||
if ! command -v emcmake >/dev/null 2>&1 || ! command -v emcc >/dev/null 2>&1; then
|
||||
for candidate in "${EMSCRIPTEN_ROOT:-}" "${EMSDK:-}" "/Volumes/FastDrive/linkertools/emsdk"; do
|
||||
if [ -z "${candidate}" ] || [ ! -d "${candidate}" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ -x "${candidate}/upstream/emscripten/emcmake" ] && [ -x "${candidate}/upstream/emscripten/emcc" ]; then
|
||||
export EMSDK="${candidate}"
|
||||
export EMSCRIPTEN="${candidate}/upstream/emscripten"
|
||||
PATH="${candidate}/upstream/emscripten:${PATH}"
|
||||
node_bin="$(find "${candidate}/node" -type f -name node 2>/dev/null | head -n 1)"
|
||||
if [ -n "${node_bin}" ]; then
|
||||
PATH="$(dirname "${node_bin}"):${PATH}"
|
||||
fi
|
||||
export PATH
|
||||
break
|
||||
fi
|
||||
|
||||
if [ -x "${candidate}/emcmake" ] && [ -x "${candidate}/emcc" ]; then
|
||||
PATH="${candidate}:${PATH}"
|
||||
export PATH
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if ! command -v emcmake >/dev/null 2>&1 || ! command -v emcc >/dev/null 2>&1; then
|
||||
echo "emcmake/emcc are required for the wasm FSUI build. Set EMSCRIPTEN_ROOT or install Emscripten."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -52,12 +78,17 @@ build_fsui_psvita() {
|
||||
cmake -S cmake/psvita-fsui -B build/fsui/psvita \
|
||||
-DCMAKE_TOOLCHAIN_FILE="${VITASDK}/share/vita.toolchain.cmake" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_POSITION_INDEPENDENT_CODE=OFF \
|
||||
-DVITASDK="${VITASDK}" \
|
||||
-DFSUI_BUILD_SAMPLES=OFF \
|
||||
-DFSUI_ENABLE_INSTALL=OFF \
|
||||
-DFSUI_PLATFORM_BACKEND=SDL2 \
|
||||
-DFSUI_IMGUI_OPENGL_ES3=ON
|
||||
cmake --build build/fsui/psvita -j"${BUILD_JOBS}"
|
||||
|
||||
# The Vita Rust wrapper expects the FSUI archives in the CMake root output
|
||||
# directory, so stage the real archives out of the nested fsui-lib build.
|
||||
cp build/fsui/psvita/fsui-lib/libfsui*.a build/fsui/psvita/
|
||||
}
|
||||
|
||||
bundle_macos_app() {
|
||||
@@ -219,8 +250,9 @@ elif [ "$MODE" = "android" ]; then
|
||||
|
||||
REPO_ROOT="$(pwd)"
|
||||
|
||||
SDL_BUILD_ROOT="${REPO_ROOT}/build/android/sdl"
|
||||
SDL_BUILD_ROOT="${REPO_ROOT}/build/android/sdl/${ANDROID_ABI}"
|
||||
SDL_INSTALL_DIR="${SDL_BUILD_ROOT}/install"
|
||||
rm -rf "${SDL_BUILD_ROOT}"
|
||||
mkdir -p "${SDL_BUILD_ROOT}"
|
||||
|
||||
cmake -S third_party/SDL -B "${SDL_BUILD_ROOT}" \
|
||||
@@ -327,7 +359,10 @@ elif [ "$MODE" = "psvita" ]; then
|
||||
|
||||
VITA_PACKAGE_DIR="$(pwd)/build/psvita/package"
|
||||
VITA_TARGET_DIR="$(pwd)/psvita/target/armv7-sony-vita-newlibeabihf/release"
|
||||
VITA_ELF="${VITA_TARGET_DIR}/ARMSX_vita"
|
||||
VITA_ELF="${VITA_TARGET_DIR}/ARMSX_vita.elf"
|
||||
if [ ! -f "${VITA_ELF}" ] && [ -f "${VITA_TARGET_DIR}/ARMSX_vita" ]; then
|
||||
VITA_ELF="${VITA_TARGET_DIR}/ARMSX_vita"
|
||||
fi
|
||||
VITA_VELF="${VITA_PACKAGE_DIR}/eboot.velf"
|
||||
VITA_EBOOT="${VITA_PACKAGE_DIR}/eboot.bin"
|
||||
VITA_PARAM="${VITA_PACKAGE_DIR}/param.sfo"
|
||||
@@ -340,7 +375,7 @@ elif [ "$MODE" = "psvita" ]; then
|
||||
|
||||
rm -rf "${VITA_PACKAGE_DIR}"
|
||||
mkdir -p "${VITA_PACKAGE_DIR}/sce_sys"
|
||||
cp icons/FsuiAppIcon.png "${VITA_PACKAGE_DIR}/sce_sys/icon0.png"
|
||||
cp icons/ArmsxDesktop.png "${VITA_PACKAGE_DIR}/sce_sys/icon0.png"
|
||||
|
||||
vita-mksfoex -s TITLE_ID=ARMSX001 "ARMSX PSVita" "${VITA_PARAM}"
|
||||
vita-elf-create -s "${VITA_ELF}" "${VITA_VELF}"
|
||||
|
||||
@@ -52,3 +52,28 @@ set(FSUI_IMGUI_OPENGL_ES3 ON CACHE BOOL "Build the fsui OpenGL backend in OpenGL
|
||||
set(FSUI_USE_SYSTEM_SDL2 OFF CACHE BOOL "Prefer a system SDL2 package when an SDL target is not already available" FORCE)
|
||||
|
||||
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/../../third_party/fsui-lib" "${CMAKE_BINARY_DIR}/fsui-lib")
|
||||
|
||||
if(DEFINED VITASDK AND VITASDK)
|
||||
# Vita packaging tools reject PIC-style ARM relocations such as R_ARM_BASE_PREL.
|
||||
# Keep the upstream fsui source tree untouched, but force the Vita-facing targets
|
||||
# to build as plain static libraries.
|
||||
set(_FSUI_VITA_TARGETS
|
||||
fsui_imgui
|
||||
fsui-core
|
||||
fsui-platform-sdl2
|
||||
fsui-renderer-opengl
|
||||
fsui-renderer-sdl2
|
||||
fsui-renderer-sdl2surface
|
||||
fsui-backend-sdl
|
||||
fsui-donor
|
||||
fsui_resources
|
||||
fsui_glad
|
||||
glad
|
||||
)
|
||||
|
||||
foreach(_FSUI_VITA_TARGET IN LISTS _FSUI_VITA_TARGETS)
|
||||
if(TARGET ${_FSUI_VITA_TARGET})
|
||||
set_target_properties(${_FSUI_VITA_TARGET} PROPERTIES POSITION_INDEPENDENT_CODE OFF)
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
@@ -127,6 +127,8 @@ void SdlLogOutput(void*, int category, SDL_LogPriority priority, const char* mes
|
||||
psxe_diag_logf("sdl", "category=%d priority=%d %s", category, static_cast<int>(priority), message ? message : "");
|
||||
}
|
||||
|
||||
[[noreturn]] void ReportNativeCrash(const char* reason);
|
||||
|
||||
#if defined(_WIN32) && !defined(UWP_TARGET)
|
||||
LONG WINAPI WindowsUnhandledExceptionFilter(EXCEPTION_POINTERS* exception_info) {
|
||||
const DWORD code = exception_info && exception_info->ExceptionRecord
|
||||
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#include <SDL.h>
|
||||
|
||||
#ifdef PSVITA_TARGET
|
||||
|
||||
int SDL_OpenURL(const char* url) {
|
||||
(void)url;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int SDL_SetClipboardText(const char* text) {
|
||||
(void)text;
|
||||
return -1;
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasClipboardText(void) {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
char* SDL_GetClipboardText(void) {
|
||||
char* text = (char*)SDL_malloc(1);
|
||||
if (text) {
|
||||
text[0] = '\0';
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -118,6 +118,11 @@ configure_target
|
||||
|
||||
toolchain_dir="$(download_toolchain "$toolchain_name")"
|
||||
apk_static="$(download_apk_static)"
|
||||
python3_bin="$(command -v python3 || true)"
|
||||
if [ -z "$python3_bin" ]; then
|
||||
echo "python3 is required for the musl fsui build." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sysroot_dir="$sysroot_root/$target"
|
||||
repo_file="$sysroot_dir/etc/apk/repositories"
|
||||
@@ -178,6 +183,8 @@ cmake -S "$repo_root/third_party/fsui-lib" -B "$fsui_build_dir" \
|
||||
-DFSUI_BUILD_SAMPLES=OFF \
|
||||
-DFSUI_PLATFORM_BACKEND=SDL2 \
|
||||
-DFSUI_USE_SYSTEM_SDL2=ON \
|
||||
-DPython_EXECUTABLE="$python3_bin" \
|
||||
-DPython3_EXECUTABLE="$python3_bin" \
|
||||
-DCMAKE_PREFIX_PATH="$sysroot_dir/usr" \
|
||||
-DSDL2_DIR="$sdl2_config_dir"
|
||||
cmake --build "$fsui_build_dir" -j"$build_jobs"
|
||||
|
||||
@@ -5,7 +5,11 @@ set -euo pipefail
|
||||
target_arch="${1:-}"
|
||||
|
||||
case "$target_arch" in
|
||||
x32|i386)
|
||||
source_mode="x32"
|
||||
;;
|
||||
arm64|armhf)
|
||||
source_mode="ports"
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
@@ -22,16 +26,28 @@ for source in /etc/apt/sources.list /etc/apt/sources.list.d/*; do
|
||||
fi
|
||||
done
|
||||
|
||||
cat > "/etc/apt/sources.list.d/armsx-ubuntu-amd64.list" <<'EOF'
|
||||
case "$source_mode" in
|
||||
x32)
|
||||
cat > "/etc/apt/sources.list.d/armsx-ubuntu-x32.list" <<'EOF'
|
||||
deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu noble main restricted universe multiverse
|
||||
deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu noble-updates main restricted universe multiverse
|
||||
deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu noble-backports main restricted universe multiverse
|
||||
deb [arch=amd64,i386] http://archive.ubuntu.com/ubuntu noble-security main restricted universe multiverse
|
||||
EOF
|
||||
;;
|
||||
ports)
|
||||
cat > "/etc/apt/sources.list.d/armsx-ubuntu-amd64.list" <<'EOF'
|
||||
deb [arch=amd64] http://archive.ubuntu.com/ubuntu noble main restricted universe multiverse
|
||||
deb [arch=amd64] http://archive.ubuntu.com/ubuntu noble-updates main restricted universe multiverse
|
||||
deb [arch=amd64] http://archive.ubuntu.com/ubuntu noble-backports main restricted universe multiverse
|
||||
deb [arch=amd64] http://security.ubuntu.com/ubuntu noble-security main restricted universe multiverse
|
||||
EOF
|
||||
|
||||
cat > "/etc/apt/sources.list.d/armsx-ubuntu-${target_arch}.list" <<EOF
|
||||
cat > "/etc/apt/sources.list.d/armsx-ubuntu-${target_arch}.list" <<EOF
|
||||
deb [arch=${target_arch}] http://ports.ubuntu.com/ubuntu-ports noble main restricted universe multiverse
|
||||
deb [arch=${target_arch}] http://ports.ubuntu.com/ubuntu-ports noble-updates main restricted universe multiverse
|
||||
deb [arch=${target_arch}] http://ports.ubuntu.com/ubuntu-ports noble-backports main restricted universe multiverse
|
||||
deb [arch=${target_arch}] http://ports.ubuntu.com/ubuntu-ports noble-security main restricted universe multiverse
|
||||
EOF
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user