Files
lowbit--ps5-doom/tools/fetch-third-party.sh
T
rijads 93814c3e95 Send games from a PC or phone browser, with a QR code on screen
Add games gets a first row, Send from PC or phone. Its screen runs a small HTTP server for as long
as it is open (port 9666, or the next one the sandbox allows) and shows the address as text and as
a QR code. The page it serves takes dropped files and whole folders, uploads them one at a time with
progress, and lists what the console did with each. Game WADs are moved into place, archives go
through the importer and are deleted afterwards, add-ons and other files are refused with a reason.

qrcodegen 1.8.0 joins the pinned third-party fetch, renamed to fetch-third-party.sh; the page is
embedded at build time by tools/embed-file.py. tools/send.py does what the page does, for console
tests with test/console-send.cfg.
2026-10-04 15:25:39 +02:00

42 lines
1.7 KiB
Bash

#!/usr/bin/env bash
# Downloads the libraries built into the launcher and checks them: libarchive, xz's liblzma and zlib
# for the importer, qrcodegen for the address shown on the upload screen.
set -euo pipefail
out=${1:-.deps/third-party}
mkdir -p "$out"
fetch() {
local name=$1 sha256=$2
shift 2
if [ -f "$out/$name/.complete" ]; then
return
fi
local tmp
tmp=$(mktemp -d)
for url in "$@"; do
if wget -q -O "$tmp/source.tar.gz" "$url" &&
echo "$sha256 $tmp/source.tar.gz" | sha256sum --check --quiet; then
rm -rf "${out:?}/$name"
tar -xzf "$tmp/source.tar.gz" -C "$out"
touch "$out/$name/.complete"
rm -rf -- "$tmp"
return
fi
done
rm -rf -- "$tmp"
echo "could not fetch $name" >&2
exit 1
}
fetch libarchive-3.8.9 f5a6539059cf5e597dbeda37bfa4874b1e8dea063c8d93bf85a2b44af90a5bd4 \
https://www.libarchive.org/downloads/libarchive-3.8.9.tar.gz \
https://github.com/libarchive/libarchive/releases/download/v3.8.9/libarchive-3.8.9.tar.gz
fetch xz-5.8.4 0014c7886930454fe8bd4228665b51af55eeae560ea135c9c4cd33f55b2591d9 \
https://github.com/tukaani-project/xz/releases/download/v5.8.4/xz-5.8.4.tar.gz \
https://downloads.sourceforge.net/project/lzmautils/xz-5.8.4.tar.gz
fetch zlib-1.3.2 bb329a0a2cd0274d05519d61c667c062e06990d72e125ee2dfa8de64f0119d16 \
https://github.com/madler/zlib/releases/download/v1.3.2/zlib-1.3.2.tar.gz \
https://zlib.net/zlib-1.3.2.tar.gz
fetch QR-Code-generator-1.8.0 2ec0a4d33d6f521c942eeaf473d42d5fe139abcfa57d2beffe10c5cf7d34ae60 https://github.com/nayuki/QR-Code-generator/archive/refs/tags/v1.8.0.tar.gz https://codeload.github.com/nayuki/QR-Code-generator/tar.gz/refs/tags/v1.8.0