stagex/packages/lua/Containerfile

64 lines
1.5 KiB
Text
Raw Normal View History

2024-03-26 22:24:46 +00:00
FROM scratch as base
ARG ARCH=x86_64
ENV VERSION=5.4.6
ENV SRC_HASH=7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88
ENV SRC_FILE=lua-${VERSION}.tar.gz
ENV SRC_SITE=https://www.lua.org/ftp/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/libtool . /
COPY --from=stagex/perl . /
COPY --from=stagex/autoconf . /
COPY --from=stagex/automake . /
COPY --from=stagex/ncurses . /
COPY --from=stagex/readline . /
COPY --from=stagex/m4 . /
COPY --from=stagex/make . /
COPY --from=stagex/cmake . /
COPY --from=stagex/zlib . /
RUN tar -xvf $SRC_FILE
WORKDIR lua-${VERSION}
COPY <<-EOF configure.ac
top_buildir=.
AC_INIT(src/luaconf.h)
AC_PROG_LIBTOOL
AC_OUTPUT()
EOF
RUN --network=none <<-EOF
set -eu
libtoolize --force --install
aclocal
autoconf
./configure \
--build=${ARCH}-unknown-linux-musl \
--host=${ARCH}-unknown-linux-musl \
--prefix=/usr
make \
-j "$(nproc)" \
V="${VERSION}" \
LDFLAGS="-lncurses" \
CFLAGS="-DLUA_USE_LINUX -DLUA_COMPAT_5_2 -DLUA_USE_LINENOISE" \
RPATH="/usr/lib" \
LIB_LIBS="-lpthread -lm -ldl -llinenoise" \
linux
EOF
FROM build as install
2024-04-11 20:09:20 +00:00
RUN --network=none \
2024-03-26 22:24:46 +00:00
make \
V="${VERSION}" \
INSTALL_TOP="/rootfs/usr" \
INSTALL_INC="/rootfs/usr/include/lua" \
INSTALL_LIB="/rootfs/usr/lib/lua" \
install
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /