2024-08-17 04:41:04 +00:00
|
|
|
FROM scratch AS base
|
2024-08-16 19:26:04 +00:00
|
|
|
ARG ARCH=x86_64
|
|
|
|
ENV VERSION=1.20.0
|
|
|
|
ENV SRC_HASH=0b86b262dbe971edb4ff233bc370dfad9f241d09f078a3f6d5b7f4b8ea4430db
|
|
|
|
ENV SRC_FILE=util-macros-${VERSION}.tar.xz
|
|
|
|
ENV SRC_SITE=https://www.x.org/releases/individual/util/${SRC_FILE}
|
|
|
|
|
2024-08-17 04:41:04 +00:00
|
|
|
FROM base AS fetch
|
2024-08-16 19:26:04 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
|
|
|
|
|
2024-08-17 04:41:04 +00:00
|
|
|
FROM fetch AS build
|
2024-08-16 19:26:04 +00:00
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/gcc . /
|
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/bash . /
|
|
|
|
COPY --from=stagex/binutils . /
|
|
|
|
COPY --from=stagex/make . /
|
|
|
|
COPY --from=stagex/pkgconf . /
|
|
|
|
COPY --from=stagex/m4 . /
|
|
|
|
COPY --from=stagex/gawk . /
|
|
|
|
RUN tar -xf ${SRC_FILE}
|
|
|
|
WORKDIR util-macros-${VERSION}
|
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
2024-08-17 14:33:38 +00:00
|
|
|
./configure \
|
2024-08-16 19:26:04 +00:00
|
|
|
--build=${ARCH}-linux-musl \
|
|
|
|
--host=${ARCH}-linux-musl \
|
|
|
|
--prefix=/usr
|
2024-08-17 04:41:04 +00:00
|
|
|
make -j "$(nproc)"
|
2024-08-16 19:26:04 +00:00
|
|
|
EOF
|
|
|
|
|
2024-08-17 04:41:04 +00:00
|
|
|
FROM build AS install
|
2024-08-16 19:26:04 +00:00
|
|
|
RUN make DESTDIR=/rootfs install
|
|
|
|
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
|
|
|
|
2024-08-17 04:41:04 +00:00
|
|
|
FROM stagex/filesystem AS package
|
2024-08-16 19:26:04 +00:00
|
|
|
COPY --from=install /rootfs/. /
|