stagex/packages/apr/Containerfile
2024-08-30 11:35:55 -07:00

38 lines
1,004 B
Docker

FROM scratch AS base
ARG ARCH=x86_64
ENV VERSION=1.7.5
ENV SRC_HASH=cd0f5d52b9ab1704c72160c5ee3ed5d3d4ca2df4a7f8ab564e3cb352b67232f2
ENV SRC_FILE=apr-${VERSION}.tar.bz2
ENV SRC_SITE=https://www.apache.org/dist/apr/${SRC_FILE}
FROM base AS fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
FROM fetch AS build
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/busybox . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/util-linux . /
RUN tar -xf ${SRC_FILE}
WORKDIR /apr-${VERSION}
COPY *.patch .
RUN --network=none <<-EOF
set -eux \
patch -p1 apr-1.6.2-dont-test-dlclose.patch
patch -p1 semtimedop-s390x.patch
./configure \
--prefix=/usr \
--datadir=/usr/share \
--enable-nonportable-atomics=no \
--with-devrandom=/dev/urandom
make -j "$(nproc)"
EOF
FROM build AS install
RUN make DESTDIR=/rootfs install
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM stagex/filesystem AS package
COPY --from=install /rootfs/. /