2024-02-12 02:47:17 +00:00
|
|
|
FROM scratch as base
|
|
|
|
ENV SRC_VERSION=1.10.3
|
|
|
|
ENV SRC_HASH=8b0870897ac5ac67ded568dcfadf45969cfa8a6beb0fd60af2a9eadc2a3272aa
|
|
|
|
ENV SRC_FILE=libgcrypt-${SRC_VERSION}.tar.bz2
|
|
|
|
ENV SRC_SITE=https://gnupg.org/ftp/gcrypt/libgcrypt/${SRC_FILE}
|
|
|
|
|
|
|
|
FROM base as fetch
|
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
|
|
|
|
|
|
|
|
FROM fetch as build
|
|
|
|
COPY --from=busybox . /
|
|
|
|
COPY --from=musl . /
|
|
|
|
COPY --from=gcc . /
|
|
|
|
COPY --from=binutils . /
|
|
|
|
COPY --from=make . /
|
|
|
|
COPY --from=libgpg-error . /
|
|
|
|
RUN tar -xvf $SRC_FILE
|
|
|
|
WORKDIR libgcrypt-${SRC_VERSION}
|
|
|
|
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 /
|
|
|
|
COPY --from=busybox . /
|
|
|
|
RUN /bin/sh <<-EOF
|
|
|
|
set -eux
|
|
|
|
LIBGCRYPT_FILES_FOUND=\$(ls /usr/lib/ | grep libgcrypt || true)
|
|
|
|
if [ -z "\$LIBGCRYPT_FILES_FOUND" ]; then
|
|
|
|
echo "libgcrypt not found"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
EOF
|
|
|
|
|
|
|
|
FROM scratch as package
|
2024-02-15 04:03:57 +00:00
|
|
|
COPY --from=install /rootfs /
|