-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.a30
More file actions
69 lines (60 loc) · 3.07 KB
/
Dockerfile.a30
File metadata and controls
69 lines (60 loc) · 3.07 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
68
69
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
# Basic build tools (no cross-compiler from apt — we use the A30 buildroot toolchain)
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential cmake pkg-config git ca-certificates python3 wget ccache \
&& rm -rf /var/lib/apt/lists/*
# Install A30 buildroot toolchain
# GCC 13.2.0, glibc 2.23, arm-a30-linux-gnueabihf, Mali fbdev, SDL2 2.28.5
RUN wget -q https://github.com/steward-fu/website/releases/download/miyoo-a30/a30_toolchain-v1.0.tar.gz \
-O /tmp/a30_toolchain.tar.gz && \
tar xzf /tmp/a30_toolchain.tar.gz -C /opt && \
rm /tmp/a30_toolchain.tar.gz
# Create toolchain wrapper scripts (buildroot .br_real binaries need --sysroot)
RUN SYSROOT=/opt/a30/arm-a30-linux-gnueabihf/sysroot && \
rm -f /opt/a30/bin/arm-a30-linux-gnueabihf-gcc /opt/a30/bin/arm-a30-linux-gnueabihf-g++ && \
printf '#!/bin/sh\nexec /opt/a30/bin/arm-a30-linux-gnueabihf-gcc-13.2.0.br_real --sysroot=%s "$@"\n' "$SYSROOT" > /opt/a30/bin/arm-a30-linux-gnueabihf-gcc && \
printf '#!/bin/sh\nexec /opt/a30/bin/arm-a30-linux-gnueabihf-c++.br_real --sysroot=%s "$@"\n' "$SYSROOT" > /opt/a30/bin/arm-a30-linux-gnueabihf-g++ && \
chmod +x /opt/a30/bin/arm-a30-linux-gnueabihf-gcc /opt/a30/bin/arm-a30-linux-gnueabihf-g++
# Restore sysroot/lib symlinks stripped by tarball (needed by glibc linker scripts)
RUN SYSROOT=/opt/a30/arm-a30-linux-gnueabihf/sysroot && \
cd "$SYSROOT/lib" && \
ln -sf ld-2.23.so ld-linux-armhf.so.3 && \
ln -sf libc-2.23.so libc.so.6 && \
ln -sf libpthread-2.23.so libpthread.so.0 && \
ln -sf libdl-2.23.so libdl.so.2 && \
ln -sf libm-2.23.so libm.so.6 && \
ln -sf librt-2.23.so librt.so.1 && \
ln -sf libresolv-2.23.so libresolv.so.2 && \
ln -sf libnsl-2.23.so libnsl.so.1
# Create symlinks for libraries that PPSSPP's CMake expects
RUN SYSROOT=/opt/a30/arm-a30-linux-gnueabihf/sysroot && \
cd "$SYSROOT/usr/lib" && \
ln -sf libSDL2-2.0.so.0.2800.5 libSDL2.so && \
ln -sf libMali.so libEGL.so && \
ln -sf libMali.so libGLESv2.so && \
ln -sf libasound.so.2.0.0 libasound.so && \
ln -sf libfreetype.so.6.20.1 libfreetype.so
# Create CMake toolchain file
RUN SYSROOT=/opt/a30/arm-a30-linux-gnueabihf/sysroot && \
printf '\
set(CMAKE_SYSTEM_NAME Linux)\n\
set(CMAKE_SYSTEM_PROCESSOR arm)\n\
set(CMAKE_C_COMPILER /opt/a30/bin/arm-a30-linux-gnueabihf-gcc)\n\
set(CMAKE_CXX_COMPILER /opt/a30/bin/arm-a30-linux-gnueabihf-g++)\n\
set(CMAKE_SYSROOT %s)\n\
set(CMAKE_FIND_ROOT_PATH %s)\n\
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n\
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n\
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n\
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)\n\
set(PKG_CONFIG_EXECUTABLE /usr/bin/pkg-config)\n\
set(ENV{PKG_CONFIG_SYSROOT_DIR} "%s")\n\
set(ENV{PKG_CONFIG_LIBDIR} "%s/usr/lib/pkgconfig")\n\
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)\n\
' "$SYSROOT" "$SYSROOT" "$SYSROOT" "$SYSROOT" > /tmp/a30-toolchain.cmake
COPY build-a30.sh /build-a30.sh
RUN chmod +x /build-a30.sh
COPY patches/ /patches/
WORKDIR /build
ENTRYPOINT ["/build-a30.sh"]