lua

Details
Source
FROM scratch AS build
ARG VERSION
COPY --from=stagex/core-busybox . /
COPY --from=stagex/core-musl . /
COPY --from=stagex/core-gcc . /
COPY --from=stagex/core-binutils . /
COPY --from=stagex/core-libtool . /
COPY --from=stagex/core-perl . /
COPY --from=stagex/core-autoconf . /
COPY --from=stagex/core-automake . /
COPY --from=stagex/core-ncurses . /
COPY --from=stagex/core-readline . /
COPY --from=stagex/core-m4 . /
COPY --from=stagex/core-make . /
COPY --from=stagex/core-cmake . /
COPY --from=stagex/core-zlib . /
ADD fetch/lua-${VERSION}.tar.gz .
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 \
		--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
	make \
		V="${VERSION}" \
		INSTALL_TOP="/rootfs/usr" \
		INSTALL_INC="/rootfs/usr/include/lua" \
		INSTALL_LIB="/rootfs/usr/lib/lua" \
		install
EOF
FROM stagex/core-filesystem AS package
COPY --from=build /rootfs/ /