-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile.a30
More file actions
62 lines (53 loc) · 2.74 KB
/
Copy pathDockerfile.a30
File metadata and controls
62 lines (53 loc) · 2.74 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
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 \
pkg-config \
git \
ca-certificates \
python3 \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install A30 buildroot toolchain
# GCC 13.2.0, glibc 2.23 sysroot, Mali fbdev EGL/GLES2, SDL2 2.28.5
COPY a30_toolchain-v1.0.tar.gz /tmp/
RUN tar xzf /tmp/a30_toolchain-v1.0.tar.gz -C /opt && rm /tmp/a30_toolchain-v1.0.tar.gz
# Create toolchain wrapper scripts (buildroot wrappers weren't included in tarball)
# The .br_real binaries need --sysroot passed explicitly
# rm -f first: tarball may contain symlinks that would redirect the write
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++
# Create cross pkg-config wrapper (configure looks for ${CROSS_COMPILE}pkg-config)
RUN SYSROOT=/opt/a30/arm-a30-linux-gnueabihf/sysroot && \
printf '#!/bin/sh\nexport PKG_CONFIG_SYSROOT_DIR=%s\nexport PKG_CONFIG_LIBDIR=%s/usr/lib/pkgconfig\nexec pkg-config "$@"\n' \
"$SYSROOT" "$SYSROOT" > /opt/a30/bin/arm-a30-linux-gnueabihf-pkg-config && \
chmod +x /opt/a30/bin/arm-a30-linux-gnueabihf-pkg-config
# 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 the libraries that RetroArch's configure 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
COPY build-a30.sh /build-a30.sh
RUN chmod +x /build-a30.sh
COPY patches/ /patches/
WORKDIR /build
ENTRYPOINT ["/build-a30.sh"]