stagex/packages/dtc/Containerfile

45 lines
1.1 KiB
Text
Raw Normal View History

2024-08-18 23:09:39 +00:00
FROM scratch AS base
2024-10-08 23:50:45 +00:00
ENV VERSION=1.7.1
ENV SRC_HASH=398098bac205022b39d3dce5982b98c57f1023f3721a53ebcbb782be4cf7885e
2024-08-18 23:09:39 +00:00
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}
2024-08-26 01:18:52 +00:00
WORKDIR /dtc-${VERSION}
2024-08-18 23:09:39 +00:00
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/. /