stagex/packages/ninja/Containerfile

37 lines
892 B
Text
Raw Normal View History

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
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
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
RUN find /rootfs -exec touch -hcd "@0" "{}" +
2023-11-19 00:53:18 +00:00
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /