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

58 lines
1.5 KiB
Docker

FROM scratch AS base
ARG ARCH=x86_64
ENV VERSION=10.43
ENV SRC_HASH=f0048e26b02bdfaf43b8cec75030a9c2fe28552bf5caa693d3ccbf4d886fa930
ENV SRC_FILE=pcre2-${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/PCRE2Project/pcre2/archive/refs/tags/${SRC_FILE}
FROM base AS fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} ${SRC_FILE}
FROM fetch AS build
COPY --from=stagex/zlib . /
COPY --from=stagex/gawk . /
COPY --from=stagex/bzip2 . /
COPY --from=stagex/readline . /
COPY --from=stagex/libzstd . /
COPY --from=stagex/perl . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/busybox . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/make . /
COPY --from=stagex/libtool . /
COPY --from=stagex/m4 . /
COPY --from=stagex/libedit . /
COPY --from=stagex/ncurses . /
RUN tar -xf $SRC_FILE
WORKDIR /pcre2-pcre2-${VERSION}
RUN --network=none <<-EOF
set -eux
./autogen.sh
./configure \
CFLAGS="-O3" \
--disable-shared \
--build=${ARCH}-unknown-linux-musl \
--host=${ARCH}-unknown-linux-musl \
--prefix=/usr \
--docdir=/usr/share/doc/pcre2-10.43 \
--htmldir=/usr/share/doc/pcre2-10.43/html \
--enable-pcre2-16 \
--enable-pcre2-32 \
--enable-pcre2grep-libz \
--enable-pcre2test-libedit \
# --enable-jit
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/. /