-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild-miyoomini.sh
More file actions
42 lines (32 loc) · 1.18 KB
/
build-miyoomini.sh
File metadata and controls
42 lines (32 loc) · 1.18 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
#!/bin/bash
set -e
RETROARCH_VERSION="${RETROARCH_VERSION:-v1.22.2}"
OUTPUT_DIR="${OUTPUT_DIR:-/output}"
echo "=== Building RetroArch ${RETROARCH_VERSION} for Miyoo Mini (armhf) ==="
# Clone RetroArch
if [ ! -d "RetroArch" ]; then
git clone --depth 1 --branch "$RETROARCH_VERSION" \
https://github.com/libretro/RetroArch.git
fi
cd RetroArch
# Fix line endings before patching (upstream has mixed CRLF/LF)
find . -type f \( -name '*.c' -o -name '*.h' \) -exec sed -i 's/\r$//' {} +
# Apply miyoomini-specific patches
# OnionUI patches (000xx) use patch(1) for fuzz tolerance
# Spruce patches (001xx) use git apply for strict format
for p in /patches/miyoomini/*.patch; do
echo "Applying: $(basename "$p")"
case "$(basename "$p")" in
000*) patch -p1 < "$p" ;;
*) git apply "$p" ;;
esac
done
# Copy miyoomini custom source files on top of the patched tree
cp -r /miyoomini_src/* .
# Build using the miyoomini Makefile
make -f Makefile.miyoomini -j$(nproc)
# Output
mkdir -p "$OUTPUT_DIR"
cp retroarch "$OUTPUT_DIR/"
/opt/miyoomini-toolchain/usr/bin/arm-linux-gnueabihf-strip -s "$OUTPUT_DIR/retroarch"
echo "=== Build complete: ${OUTPUT_DIR}/retroarch ==="