2024-02-09 07:30:28 +00:00
|
|
|
FROM scratch as base
|
|
|
|
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
|
|
|
|
2023-12-16 23:50:40 +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
|
|
|
|
|
|
|
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}
|
|
|
|
WORKDIR ninja-${VERSION}
|
|
|
|
ADD *.patch .
|
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
2024-02-10 11:28:57 +00:00
|
|
|
cp -R /usr/lib64/* /usr/lib/
|
2024-02-09 07:30:28 +00:00
|
|
|
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
|
|
|
|
2023-12-16 23:50:40 +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
|
2024-02-09 18:19:36 +00:00
|
|
|
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
2023-11-19 00:53:18 +00:00
|
|
|
|
2023-12-12 17:45:39 +00:00
|
|
|
FROM scratch as package
|
2023-12-16 23:50:40 +00:00
|
|
|
COPY --from=install /rootfs /
|