-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.etc2native-android
More file actions
45 lines (38 loc) · 1.7 KB
/
Copy pathDockerfile.etc2native-android
File metadata and controls
45 lines (38 loc) · 1.7 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
# Reproducible build environment for build_etc2native_android.sh
# ABIs: arm64-v8a, armeabi-v7a, x86, x86_64.
#
# The Android NDK r29 is baked at /opt/android-ndk-r29. The script honors
# $ANDROID_NDK_HOME and does NOT download the NDK itself. The etc2comp fork is
# cloned fresh BY THE SCRIPT on every run; only host tools live here.
#
# IMPORTANT: must be linux/amd64 -- NDK r29 is the linux-x86_64 prebuilt.
#
# Build the image: docker build --platform=linux/amd64 -f Dockerfile.etc2native-android -t etc2native-android .
# Run the build: docker run --rm --platform=linux/amd64 \
# -v "$PWD/out:/work/prebuilt_android_etc2native" etc2native-android
# (output: ./out/{arm64-v8a,armeabi-v7a,x86,x86_64}/libetc2native.so)
FROM --platform=linux/amd64 ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
ninja-build \
git \
curl \
ca-certificates \
unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# --- Bake the Android NDK r29 (same image convention as Dockerfile.libcmpx-android) ---
ENV ANDROID_NDK_HOME=/opt/android-ndk-r29
RUN curl -fL -o /tmp/ndk.zip \
https://dl.google.com/android/repository/android-ndk-r29-linux.zip \
&& echo "87e2bb7e9be5d6a1c6cdf5ec40dd4e0c6d07c30b /tmp/ndk.zip" | sha1sum -c - \
&& unzip -q /tmp/ndk.zip -d /opt \
&& rm /tmp/ndk.zip \
&& test -f "$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake"
WORKDIR /work
COPY build_etc2native_android.sh /work/build_etc2native_android.sh
COPY etc2native/ /work/etc2native/
RUN chmod +x /work/build_etc2native_android.sh
CMD ["sh", "/work/build_etc2native_android.sh"]