2024-02-12 02:47:17 +00:00
|
|
|
FROM scratch as base
|
2024-02-15 15:22:38 +00:00
|
|
|
ENV VERSION=1.6
|
2024-02-12 02:47:17 +00:00
|
|
|
ENV SRC_HASH=1393abd9adcf0762d34798dc34fdcf4d0d22a8410721e76f1e3afcd1daa4e2d1
|
2024-02-15 15:22:38 +00:00
|
|
|
ENV SRC_FILE=npth-${VERSION}.tar.bz2
|
2024-02-12 02:47:17 +00:00
|
|
|
ENV SRC_SITE=https://gnupg.org/ftp/gcrypt/npth/${SRC_FILE}
|
|
|
|
|
|
|
|
FROM base as fetch
|
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
|
|
|
|
|
|
|
|
FROM fetch as build
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/gcc . /
|
|
|
|
COPY --from=stagex/binutils . /
|
|
|
|
COPY --from=stagex/make . /
|
2024-02-12 02:47:17 +00:00
|
|
|
RUN tar -xvf $SRC_FILE
|
2024-02-15 15:22:38 +00:00
|
|
|
WORKDIR npth-${VERSION}
|
2024-02-12 02:47:17 +00:00
|
|
|
RUN --network=none <<-EOF
|
|
|
|
set -eux
|
|
|
|
./configure \
|
|
|
|
--build=x86_64-unknown-linux-musl \
|
|
|
|
--host=x86_64-unknown-linux-musl \
|
|
|
|
--prefix=/usr \
|
|
|
|
--bindir=/bin \
|
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--infodir=/usr/share/info \
|
|
|
|
make
|
|
|
|
EOF
|
|
|
|
|
|
|
|
FROM build as install
|
|
|
|
RUN make DESTDIR=/rootfs install
|
2024-02-15 04:03:57 +00:00
|
|
|
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
2024-02-12 02:47:17 +00:00
|
|
|
|
|
|
|
FROM base as test
|
|
|
|
COPY --from=install /rootfs /
|
2024-02-15 15:22:38 +00:00
|
|
|
COPY --from=stagex/zlib . /
|
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/busybox . /
|
2024-02-12 02:47:17 +00:00
|
|
|
RUN /bin/sh <<-EOF
|
|
|
|
set -eux
|
2024-02-15 15:22:38 +00:00
|
|
|
EXPECTED_NPTH_VERSION="${VERSION}"
|
2024-02-12 02:47:17 +00:00
|
|
|
NPTH_VERSION=\$(npth-config --version)
|
|
|
|
if [ "\$NPTH_VERSION" != "\$EXPECTED_NPTH_VERSION" ]; then
|
|
|
|
echo "Expected npth version is \$EXPECTED_NPTH_VERSION, but got \$NPTH_VERSION"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
EOF
|
|
|
|
|
|
|
|
FROM scratch as package
|
2024-02-15 04:03:57 +00:00
|
|
|
COPY --from=install /rootfs /
|