| Nico Huber | e332db7 | 2025-03-01 13:45:56 +0100 | [diff] [blame] | 1 | FROM alvrme/alpine-android:android-35-jdk8 |
| 2 | |
| 3 | RUN \ |
| 4 | adduser -D mani mani && \ |
| 5 | apk update && \ |
| 6 | apk add build-base git ccache meson |
| 7 | |
| 8 | ENV NDK_VERSION=27.2.12479018 |
| 9 | RUN extras ndk -n ${NDK_VERSION} |
| 10 | ENV PATH /opt/sdk/ndk/${NDK_VERSION}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH} |
| 11 | |
| 12 | RUN 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 |
| 29 | EOF |
| 30 | |
| 31 | RUN mkdir -p -m 1777 /ccache |
| 32 | |
| 33 | USER mani |
| 34 | |
| 35 | ARG ORIGIN=https://review.sourcearcade.org/flashprog.git |
| 36 | RUN \ |
| 37 | cd && \ |
| 38 | mkdir .ccache && chown mani:mani .ccache && \ |
| 39 | git clone ${ORIGIN} flashprog |
| 40 | |
| 41 | ARG IDENT=mani |
| 42 | ARG CCACHE_MAX=512M |
| 43 | RUN \ |
| 44 | ccache --set-config cache_dir=/ccache/${IDENT} && \ |
| 45 | ccache --set-config max_size=${CCACHE_MAX} |
| 46 | |
| 47 | ENV DEVSHELL /bin/sh |
| 48 | COPY mani-wrapper.sh /home/mani/ |
| 49 | ENTRYPOINT ["/bin/sh", "/home/mani/mani-wrapper.sh"] |