stagex/packages/dtc/Containerfile
2024-10-08 19:50:45 -04:00

44 lines
1.1 KiB
Docker

FROM scratch AS base
ENV VERSION=1.7.1
ENV SRC_HASH=398098bac205022b39d3dce5982b98c57f1023f3721a53ebcbb782be4cf7885e
ENV SRC_FILE=dtc-${VERSION}.tar.xz
ENV SRC_SITE=https://kernel.org/pub/software/utils/dtc/${SRC_FILE}
FROM base AS fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch AS build
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/binutils . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/perl . /
COPY --from=stagex/m4 . /
COPY --from=stagex/gcc . /
COPY --from=stagex/bison . /
COPY --from=stagex/openssl . /
COPY --from=stagex/libzstd . /
COPY --from=stagex/zlib . /
COPY --from=stagex/flex . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/coreutils . /
COPY --from=stagex/python . /
COPY --from=stagex/py-setuptools . /
RUN tar -xf ${SRC_FILE}
WORKDIR /dtc-${VERSION}
RUN --network=none <<-EOF
set -eux
sed -i s:-Werror::g Makefile
sed -i "s|@VERSION@|${VERSION}|" setup.py
make -j "$(nproc)"
EOF
FROM build AS install
RUN <<-EOF
set -eux
make DESTDIR=/rootfs PREFIX=/usr install
EOF
FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /