forked from itsPLK/ps5-webkit-autoloader
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_release.sh
More file actions
executable file
·68 lines (56 loc) · 2.53 KB
/
Copy pathbuild_release.sh
File metadata and controls
executable file
·68 lines (56 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
# WebKit Autoloader Installer - Versioned Release Build Script
# 1. Compute full version (stable = base, dev = base + build type + git hash/timestamp)
VERSION=$(python3 tools/gen_version.py --print)
if [ -z "$VERSION" ]; then
echo "Error: Could not compute version"
exit 1
fi
OUTPUT_ELF="webkit-autoloader-installer_v${VERSION}.elf"
HOST_PY="webkit-autoloader-host_v${VERSION}.py"
IMAGE_NAME="ps5-webkit-autoloader-sdk"
echo "--- Building WebKit Autoloader Installer v$VERSION ---"
# 2. Remove old versioned artifacts
rm -f webkit-autoloader-installer_v*.elf webkit-autoloader-host_v*.py
echo " Removed old artifacts (webkit-autoloader-installer_v*.elf, webkit-autoloader-host_v*.py)"
# 3. Build/verify the docker image (includes librsvg for icon generation)
if [[ "$(docker images -q $IMAGE_NAME 2> /dev/null)" == "" ]]; then
echo " Docker image $IMAGE_NAME not found. Building... (this may take a few minutes)"
docker build -t $IMAGE_NAME -f Dockerfile.sdk .
if [ $? -ne 0 ]; then
echo " !!! Docker image build FAILED!"
exit 1
fi
echo " Docker image built successfully."
fi
# 4. Build native ELF via Docker (generates icon assets + file registry as deps)
# Note: docker does NOT inherit the host environment, so BUILD_TYPE,
# FORCE_EXPLOIT and CUSTOM_VERSION must be passed explicitly or defaults
# ("dev"/"auto"/empty) apply.
echo "[1/2] Building native ELF via Docker..."
docker run --rm -u "$(id -u):$(id -g)" -e "BUILD_TYPE=${BUILD_TYPE:-dev}" -e "FORCE_EXPLOIT=${FORCE_EXPLOIT:-auto}" -e "CUSTOM_VERSION=${CUSTOM_VERSION:-}" -v "$(pwd)":/src -w /src $IMAGE_NAME make clean all
if [ $? -ne 0 ]; then
echo " !!! ELF build FAILED!"
exit 1
fi
if [ -f "installer.elf" ]; then
mv installer.elf "$OUTPUT_ELF"
echo " Created versioned binary: $OUTPUT_ELF"
else
echo " !!! installer.elf not found after build!"
exit 1
fi
# 5. Build standalone webkit-autoloader-host.py with the frontend embedded.
# HOST_PAYLOAD points at the versioned installer ELF built in step 4 (the
# PC host serves it as the autoload payload instead of the bundled one).
echo "[2/2] Building webkit-autoloader-host.py (embedded frontend)..."
make host HOST_PAYLOAD="$OUTPUT_ELF"
if [ $? -ne 0 ]; then
echo " !!! webkit-autoloader-host.py build FAILED!"
exit 1
fi
mv webkit-autoloader-host.py "$HOST_PY"
echo " Created: $HOST_PY"
echo "--- Build Complete! ---"
echo "Note: Windows executable (.exe) is built via GitHub Actions."
ls -la "$OUTPUT_ELF" "$HOST_PY"