stagex/packages/lua/Containerfile

64 lines
1.5 KiB
Text
Raw Permalink Normal View History

2024-08-08 07:47:42 +00:00
FROM scratch AS base
2024-03-26 22:24:46 +00:00
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}
2024-08-08 07:47:42 +00:00
FROM base AS fetch
2024-03-26 22:24:46 +00:00
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
2024-08-08 07:47:42 +00:00
FROM fetch AS build
2024-03-26 22:24:46 +00:00
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
2024-08-26 01:18:52 +00:00
WORKDIR /lua-${VERSION}
2024-03-26 22:24:46 +00:00
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
2024-08-08 07:47:42 +00:00
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
2024-08-08 07:47:42 +00:00
FROM stagex/filesystem AS package
2024-03-26 22:24:46 +00:00
COPY --from=install /rootfs/. /