|
| 1 | +FROM debian:11 AS chromium-build |
| 2 | + |
| 3 | +WORKDIR /app |
| 4 | + |
| 5 | +ENV PATH="${PATH}:/app/depot_tools" |
| 6 | +ENV CCACHE_DIR=/app/.ccache |
| 7 | +ENV GIT_CACHE_PATH=/app/.git_cache |
| 8 | +ENV DEBIAN_FRONTEND=noninteractive |
| 9 | +ENV CHROMIUM_BUILDTOOLS_PATH=/app/electron/src/buildtools |
| 10 | +RUN apt-get update && \ |
| 11 | + apt-get install -y git sudo curl ccache python3 bzip2 xz-utils && \ |
| 12 | + curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ |
| 13 | + apt-get install -y nodejs && \ |
| 14 | + git clone --depth 1 --single-branch https://chromium.googlesource.com/chromium/tools/depot_tools.git |
| 15 | + |
| 16 | +COPY electron/.gclient electron/ |
| 17 | +COPY scripts/gclient.sh scripts/ |
| 18 | +RUN --mount=type=cache,target=/app/.git_cache scripts/gclient.sh |
| 19 | + |
| 20 | +RUN electron/src/build/install-build-deps.sh |
| 21 | + |
| 22 | +COPY scripts/patch.sh /app/scripts/ |
| 23 | +COPY src/chromium.patch /app/src/ |
| 24 | +RUN scripts/patch.sh |
| 25 | + |
| 26 | +FROM chromium-build AS chromium-arm64 |
| 27 | + |
| 28 | +RUN electron/src/build/linux/sysroot_scripts/install-sysroot.py --arch=arm64 |
| 29 | + |
| 30 | +COPY scripts/gn.sh /app/scripts/ |
| 31 | +RUN GN_ARGS='target_cpu="arm64" cc_wrapper="env CCACHE_DIR=/app/.ccache CCACHE_SLOPPINESS=time_macros ccache"' \ |
| 32 | + scripts/gn.sh release |
| 33 | + |
| 34 | +COPY scripts/ninja.sh /app/scripts/ |
| 35 | +RUN --mount=type=cache,target=/app/.ccache \ |
| 36 | + --mount=type=cache,target=/app/.git_cache \ |
| 37 | + electron/src/build/linux/sysroot_scripts/install-sysroot.py --arch=arm64 && \ |
| 38 | + scripts/ninja.sh release -j200 |
| 39 | + |
| 40 | +FROM chromium-arm64 |
| 41 | + |
| 42 | +COPY --from=chromium-build /app/electron/src/out /app/electron/src/out |
0 commit comments