2024-08-08 07:47:42 +00:00
|
|
|
FROM scratch AS base
|
2024-02-09 07:30:28 +00:00
|
|
|
ENV VERSION=1.9.0
|
2023-11-19 00:53:18 +00:00
|
|
|
ENV SRC_HASH=5d7ec75828f8d3fd1a0c2f31b5b0cea780cdfe1031359228c428c1a48bfcd5b9
|
2024-02-09 07:30:28 +00:00
|
|
|
ENV SRC_FILE=v${VERSION}.tar.gz
|
|
|
|
ENV SRC_SITE=https://github.com/martine/ninja/archive/${SRC_FILE}
|
2023-11-19 00:53:18 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM base AS fetch
|
2024-02-09 07:30:28 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
2023-12-16 23:50:40 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM fetch AS build
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/binutils . /
|
|
|
|
COPY --from=stagex/make . /
|
|
|
|
COPY --from=stagex/python . /
|
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/gcc . /
|
|
|
|
COPY --from=stagex/openssl . /
|
2024-02-09 07:30:28 +00:00
|
|
|
RUN tar -xf ${SRC_FILE}
|
2024-08-26 01:18:52 +00:00
|
|
|
WORKDIR /ninja-${VERSION}
|
2024-02-09 07:30:28 +00:00
|
|
|
ADD *.patch .
|
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
|
|
|
patch -p1 < fix-musl.patch
|
2024-02-10 11:28:57 +00:00
|
|
|
python ./configure.py --bootstrap
|
2024-02-09 07:30:28 +00:00
|
|
|
EOF
|
2023-11-19 00:53:18 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM build AS install
|
2024-02-09 07:30:28 +00:00
|
|
|
RUN <<-EOF
|
|
|
|
set -eux
|
|
|
|
mkdir -p /rootfs/usr/bin/
|
|
|
|
cp ninja /rootfs/usr/bin/
|
|
|
|
EOF
|
2023-11-19 00:53:18 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM stagex/filesystem AS package
|
2024-03-01 18:30:23 +00:00
|
|
|
COPY --from=install /rootfs/. /
|