stagex/packages/apr-util/Containerfile
2024-08-26 11:24:57 -07:00

53 lines
1.3 KiB
Docker

FROM scratch AS base
ARG ARCH=x86_64
ENV VERSION=1.6.3
ENV SRC_HASH=a41076e3710746326c3945042994ad9a4fcac0ce0277dd8fea076fec3c9772b5
ENV SRC_FILE=apr-util-${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/expat . /
COPY --from=stagex/gdbm . /
COPY --from=stagex/openldap . /
COPY --from=stagex/sqlite3 . /
COPY --from=stagex/openssl . /
COPY --from=stagex/postgresql . /
COPY --from=stagex/apr . /
COPY --from=stagex/libtool . /
COPY --from=stagex/util-linux . /
RUN tar -xf ${SRC_FILE}
WORKDIR /apr-util-${VERSION}
COPY *.patch .
RUN --network=none <<-EOF
set -eux
patch -p1 < musl-fix-testsuite.patch
./configure \
--prefix=/usr \
--with-apr=/usr \
--with-ldap \
--with-pgsql \
--with-mysql \
--with-sqlite3 \
--with-crypto \
--with-openssl \
--without-sqlite2 \
--with-dbm=ndbm \
--with-ndbm
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/. /