mirror of
https://github.com/mihawk-99/PS5_RetroArch.git
synced 2026-10-18 23:09:29 -05:00
ES-DE 3.5.0 (frontends/es-de, next) needs FreeType, HarfBuzz, ICU, pugixml,
libcurl and FFmpeg with libavfilter beside SDL2 and OpenGL. Each is built from
a release archive pinned by digest (GitHub's published digests, or the same
bytes from two mirrors for FreeType) into .deps/native/<name>-ps5 as static
archives with headers, licences and a stamp, the way tools/build-libiconv.sh
does:
build-freetype.sh FreeType 2.13.3, no optional zlib/bzip2/PNG/Brotli/HarfBuzz
build-harfbuzz.sh HarfBuzz 14.5.1, the amalgamated harfbuzz.cc over FreeType
build-icu.sh ICU 78.3 libicuuc and a filtered static libicudata (en and
root, break rules without dictionaries: 2.4 MB, not ~30),
from a host build of the same release; U_STATIC_IMPLEMENTATION
because this compiler takes __declspec(dllexport)
build-pugixml.sh pugixml 1.16
build-curl.sh curl 8.22.0 over mbedTLS 3.6.7 (RetroArch's mbedTLS is 2.6.0),
HTTP and HTTPS only
build-ffmpeg-esde.sh FFmpeg 8.1.1 (tools/build-ffmpeg.sh's release) with the
filters ES-DE's video player builds and the usual video and
audio formats; tools/build-ffmpeg.sh is unchanged
Verified: each script built on this host (freetype 1.4 MB, harfbuzz 2.5 MB,
libicuuc 4.3 MB + libicudata 2.4 MB, pugixml 444 KB, libcurl 1.6 MB + mbedTLS,
FFmpeg 17 MB of archives); bash tools/lint-shell.sh PASS. Nothing links them
yet: the ES-DE build that does is the next step, and its console run the proof.
48 lines
2.3 KiB
Bash
Executable File
48 lines
2.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Build pugixml for the PS5 as a static archive, for EmulationStation's XML (its
|
|
# settings, systems and game lists; docs/FRONTENDS.md).
|
|
#
|
|
# The release archive is GitHub's, pinned by the digest GitHub publishes for it
|
|
# (v1.16, 2026-06-16): one source file, compiled as it is.
|
|
#
|
|
# Output: .deps/native/pugixml-ps5 (lib/libpugixml.a, include/pugixml.hpp,
|
|
# include/pugiconfig.hpp), with the version and this script's digest in .stamp.
|
|
set -euo pipefail
|
|
|
|
root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
|
|
cd "$root"
|
|
version=1.16
|
|
digest=4cee1ca4aad395170f4c7a07824f3bdd41f28316c6e1e1090a1425b278ec0b4b
|
|
prefix="$root/.deps/native/pugixml-ps5"
|
|
stamp="$version $(sha256sum "$0" | cut -c1-64)"
|
|
[[ -f $prefix/.stamp && $(<"$prefix/.stamp") == "$stamp" ]] && {
|
|
echo "==> [pugixml] $version already built in $prefix"; exit 0; }
|
|
|
|
sdk="$root/.deps/native/ps5-payload-sdk"
|
|
[[ -x $sdk/bin/prospero-clang ]] || { echo "error: bootstrap this project's SDK first" >&2; exit 2; }
|
|
export PS5_PAYLOAD_SDK="$sdk" PS5_CLANG=${PS5_CLANG:-/usr/bin/clang}
|
|
|
|
archive="$root/.deps/downloads/pugixml-$version.tar.gz"
|
|
mkdir -p "$root/.deps/downloads"
|
|
[[ -f $archive ]] || curl --fail --location --retry 3 \
|
|
"https://github.com/zeux/pugixml/releases/download/v$version/pugixml-$version.tar.gz" -o "$archive"
|
|
printf '%s %s\n' "$digest" "$archive" | sha256sum --check --status || {
|
|
echo "error: pugixml archive digest mismatch" >&2; exit 1; }
|
|
|
|
build="$root/build/pugixml-ps5"
|
|
rm -rf -- "$build"
|
|
mkdir -p "$build/src"
|
|
tar -xzf "$archive" -C "$build/src" --strip-components=1
|
|
cxx="$sdk/bin/prospero-clang++"
|
|
command -v ccache >/dev/null && cxx="ccache $cxx"
|
|
$cxx -std=c++17 -O2 -march=znver2 -fPIC -ffunction-sections -fdata-sections \
|
|
-c "$build/src/src/pugixml.cpp" -o "$build/pugixml.o" > "$build/compile.log" 2>&1 ||
|
|
{ tail -20 "$build/compile.log" >&2; exit 1; }
|
|
rm -rf -- "$prefix"
|
|
mkdir -p "$prefix/lib" "$prefix/include" "$prefix/share/licenses/pugixml"
|
|
"$sdk/bin/prospero-ar" rcs "$prefix/lib/libpugixml.a" "$build/pugixml.o"
|
|
cp "$build/src/src/pugixml.hpp" "$build/src/src/pugiconfig.hpp" "$prefix/include/"
|
|
cp "$build/src/LICENSE.md" "$prefix/share/licenses/pugixml/LICENSE.md"
|
|
printf '%s\n' "$stamp" > "$prefix/.stamp"
|
|
printf '==> [pugixml] %s: %s in %s\n' "$version" "$(du -h "$prefix/lib/libpugixml.a" | cut -f1)" "$prefix"
|