stagex/packages/gmp/Containerfile
2024-04-11 13:09:20 -07:00

36 lines
951 B
Docker

FROM scratch AS base
ARG ARCH=x86_64
ENV VERSION=6.3.0
ENV SRC_HASH=a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898
ENV SRC_FILE=gmp-${VERSION}.tar.xz
ENV SRC_SITE=https://gmplib.org/download/gmp/${SRC_FILE}
FROM base AS fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch AS build
COPY --from=stagex/busybox . /
COPY --from=stagex/binutils . /
COPY --from=stagex/musl . /
COPY --from=stagex/make . /
COPY --from=stagex/perl . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/libtool . /
COPY --from=stagex/m4 . /
COPY --from=stagex/gcc . /
RUN --network=none tar -xf ${SRC_FILE}
WORKDIR gmp-${VERSION}
RUN --network=none <<EOF
set -eux
./configure \
--prefix=/usr \
--build=${ARCH}-linux-musl
make -j "$(nproc)"
EOF
FROM build AS install
RUN --network=none DESTDIR=/rootfs make install
FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /