add flex standalone build

This commit is contained in:
Lance Vick 2024-02-03 05:24:28 -08:00
parent d472f74fe8
commit a449fc6afd
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
2 changed files with 7 additions and 49 deletions

View File

@ -1,7 +1,6 @@
ARG REGISTRY=local
from ${REGISTRY}/binutils as binutils
from ${REGISTRY}/m4 as m4
from ${REGISTRY}/lex as lex
from ${REGISTRY}/gcc as gcc
from ${REGISTRY}/musl as musl
from ${REGISTRY}/make as make
@ -13,10 +12,10 @@ from ${REGISTRY}/bison as bison
from ${REGISTRY}/busybox as busybox
FROM busybox as base
ENV SRC_VERSION=2.5.11
ENV SRC_SITE=http://download.nust.na/pub2/openpkg1/sources/DST/flex/flex-2.5.11.tar.gz
ENV SRC_HASH=bc79b890f35ca38d66ff89a6e3758226131e51ccbd10ef78d5ff150b7bd73689
ENV SRC_FILE=flex-${SRC_VERSION}.tar.gz
ENV VERSION=2.6.4
ENV SRC_SITE=https://github.com/westes/flex/releases/download/v${VERSION}/flex-${VERSION}.tar.gz
ENV SRC_HASH=e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995
ENV SRC_FILE=flex-${VERSION}.tar.gz
FROM base as fetch
RUN set -eux; \
@ -36,6 +35,7 @@ COPY --from=automake . /
COPY --from=bison . /
COPY --from=gettext . /
COPY --from=musl . /
RUN set -eux; \
./autogen.sh; \
./configure \
@ -44,10 +44,8 @@ RUN set -eux; \
--prefix=/usr \
--bindir=/bin \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-shared \
--disable-static; \
make
--infodir=/usr/share/info; \
make LDFLAGS=-static
FROM build as install
USER 0:0

View File

@ -1,40 +0,0 @@
ARG REGISTRY=local
FROM ${REGISTRY}/gcc:latest as gcc
FROM ${REGISTRY}/binutils:latest as binutils
FROM ${REGISTRY}/musl:latest as musl
FROM ${REGISTRY}/make:latest as make
FROM ${REGISTRY}/busybox:latest as busybox
FROM busybox as base
COPY --from=gcc . /
COPY --from=binutils . /
COPY --from=make . /
COPY --from=musl . /
ENV SRC_VERSION 070527
ENV SRC_FILE heirloom-devtools-${SRC_VERSION}.tar.bz2
ENV SRC_SITE=http://downloads.sourceforge.net/project/heirloom/heirloom-devtools/${SRC_VERSION}/${SRC_FILE}
ENV SRC_HASH=9f233d8b78e4351fe9dd2d50d83958a0e5af36f54e9818521458a08e058691ba
FROM base as fetch
RUN wget ${SRC_SITE}
RUN echo "${SRC_HASH} ${SRC_FILE}" | sha256sum -c
FROM fetch as build
RUN tar -xjf ${SRC_FILE}
WORKDIR heirloom-devtools-${SRC_VERSION}
RUN set -eux; \
make yacc/Makefile lex/Makefile; \
make -C yacc LDFLAGS=-static; \
make -C lex LDFLAGS=-static
FROM build as install
USER 0:0
RUN set -eux; \
mkdir -p /rootfs/usr/bin; \
install lex/lex /rootfs/usr/bin
RUN find /rootfs -exec touch -hcd "@0" "{}" +
FROM scratch as package
COPY --from=install /rootfs /
ENTRYPOINT ["/usr/bin/lex"]
CMD ["-V"]