#!/usr/bin/env bash # PS5 Vulkan Template - the payload SDK this title builds with, at a pinned revision. # # ps5/tools/setup-sdk.sh install it into .deps/native/ps5-payload-sdk (once a revision) # # The SDK is my fork, ../PS5_PayloadSDK: the upstream release with the PS5 # platform layer (libps5platform.a, include/ps5platform) installed over it. The # pinned revision is exported with git archive, so a build never depends on the # fork's working tree, and the SDK directory records it, as PS5 RetroArch and # PS5 vkQuake pin theirs. RADV's archive, its link recipe and the packaging # tools stay PS5_Vulkan's. # # Copyright (C) 2026 Mihawk # SPDX-License-Identifier: MIT set -euo pipefail root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd) cache="$root/.deps/native" sdk="$cache/ps5-payload-sdk" sdk_fork="${PS5_PAYLOAD_SDK_FORK:-$root/../PS5_PayloadSDK}" # adc8dd7: /data through the Lapy daemon (ps5platform/elevation.h), an opt-in no sample calls. # Never older than fa69d00, the platform layer's localeconv in the C locale (ps5_localeconv). sdk_revision=adc8dd795ada7bf696cd98748aae463a3970ffbb if [[ ! -f $sdk/.ps5-sdk-revision || $(<"$sdk/.ps5-sdk-revision") != "$sdk_revision" ]]; then git -C "$sdk_fork" cat-file -e "$sdk_revision^{commit}" 2>/dev/null || { echo "the payload SDK fork at $sdk_fork does not have $sdk_revision" >&2 exit 2 } mkdir -p "$cache" sdk_tree=$(mktemp -d) git -C "$sdk_fork" archive "$sdk_revision" | tar -x -C "$sdk_tree" bash "$sdk_tree/platform/tools/setup-sdk.sh" "$sdk" "$sdk_revision" "$cache" >&2 rm -rf -- "$sdk_tree" fi [[ -x $sdk/bin/prospero-lld && -d $sdk/target/include ]] || { echo "the pinned PS5 payload SDK is incomplete" >&2; exit 2; } echo "$sdk"