blob: b4bb496b9b2936f7a72c9708cc60f31a976d07a1 [file] [log] [blame]
Nico Hubere332db72025-03-01 13:45:56 +01001FROM alvrme/alpine-android:android-35-jdk8
2
3RUN \
4 adduser -D mani mani && \
5 apk update && \
6 apk add build-base git ccache meson
7
8ENV NDK_VERSION=27.2.12479018
9RUN extras ndk -n ${NDK_VERSION}
10ENV PATH /opt/sdk/ndk/${NDK_VERSION}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}
11
12RUN bash <<EOF
13 set -e
14 ndk_bin="/opt/sdk/ndk/${NDK_VERSION}/toolchains/llvm/prebuilt/linux-x86_64/bin"
15 for trgt in {aarch64,i686,x86_64}-linux-android{23,35}-clang \
16 armv7a-linux-androideabi{23,35}-clang
17 do
18 echo "[binaries]" >/opt/\${trgt}.txt
19 echo "c = '\${ndk_bin}/\${trgt}'" >>/opt/\${trgt}.txt
20 echo "ar = '\${ndk_bin}/llvm-ar'" >>/opt/\${trgt}.txt
21 echo "strip = '\${ndk_bin}/llvm-strip'" >>/opt/\${trgt}.txt
22 echo "" >>/opt/\${trgt}.txt
23 echo "[host_machine]" >>/opt/\${trgt}.txt
24 echo "system = 'android'" >>/opt/\${trgt}.txt
25 echo "cpu_family = '\${trgt%%-*}'" >>/opt/\${trgt}.txt
26 echo "cpu = '\${trgt%%-*}'" >>/opt/\${trgt}.txt
27 echo "endian = 'little'" >>/opt/\${trgt}.txt
28 done
29EOF
30
31RUN mkdir -p -m 1777 /ccache
32
33USER mani
34
35ARG ORIGIN=https://review.sourcearcade.org/flashprog.git
36RUN \
37 cd && \
38 mkdir .ccache && chown mani:mani .ccache && \
39 git clone ${ORIGIN} flashprog
40
41ARG IDENT=mani
42ARG CCACHE_MAX=512M
43RUN \
44 ccache --set-config cache_dir=/ccache/${IDENT} && \
45 ccache --set-config max_size=${CCACHE_MAX}
46
47ENV DEVSHELL /bin/sh
48COPY mani-wrapper.sh /home/mani/
49ENTRYPOINT ["/bin/sh", "/home/mani/mani-wrapper.sh"]