37 lines
965 B
Docker
37 lines
965 B
Docker
FROM scratch AS base
|
|
ENV VERSION=3.1
|
|
ENV SRC_HASH=087c44de0400fb15caafde09fd72edc7381e688a35ef505ee65e0e3d2fac688b
|
|
ENV SRC_FILE=${VERSION}.tar.gz
|
|
ENV SRC_SITE=https://github.com/skvadrik/re2c/archive/refs/tags/${SRC_FILE}
|
|
|
|
FROM base AS fetch
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
|
|
|
FROM fetch AS build
|
|
COPY --from=stagex/autoconf . /
|
|
COPY --from=stagex/automake . /
|
|
COPY --from=stagex/binutils . /
|
|
COPY --from=stagex/busybox . /
|
|
COPY --from=stagex/libtool . /
|
|
COPY --from=stagex/perl . /
|
|
COPY --from=stagex/python . /
|
|
COPY --from=stagex/gcc . /
|
|
COPY --from=stagex/make . /
|
|
COPY --from=stagex/m4 . /
|
|
COPY --from=stagex/musl . /
|
|
RUN tar -xvf $SRC_FILE
|
|
WORKDIR re2c-${VERSION}
|
|
RUN --network=none <<-EOF
|
|
set -eux
|
|
autoreconf -i -W all
|
|
./configure \
|
|
--prefix=/usr
|
|
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/. /
|