stagex/packages/libgcrypt/Containerfile

50 lines
1.2 KiB
Text
Raw Normal View History

2024-02-12 02:47:17 +00:00
FROM scratch as base
ENV VERSION=1.10.3
2024-02-12 02:47:17 +00:00
ENV SRC_HASH=8b0870897ac5ac67ded568dcfadf45969cfa8a6beb0fd60af2a9eadc2a3272aa
ENV SRC_FILE=libgcrypt-${VERSION}.tar.bz2
2024-02-12 02:47:17 +00:00
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=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/libgpg-error . /
2024-02-12 02:47:17 +00:00
RUN tar -xvf $SRC_FILE
WORKDIR libgcrypt-${VERSION}
ENV SOURCE_DATE_EPOCH=1
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=/usr/bin \
2024-02-12 02:47:17 +00:00
--mandir=/usr/share/man \
--infodir=/usr/share/info
make -j "$(nproc)"
2024-02-12 02:47:17 +00:00
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=stagex/busybox . /
2024-02-12 02:47:17 +00:00
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 stagex/filesystem as package
COPY --from=install /rootfs/. /