summaryrefslogtreecommitdiff
path: root/luafilesystem
diff options
context:
space:
mode:
Diffstat (limited to 'luafilesystem')
-rw-r--r--luafilesystem/1.8.0/0001-Makefile-Replace-.so-with-.a.patch40
-rw-r--r--luafilesystem/1.8.0/Dockerfile21
2 files changed, 61 insertions, 0 deletions
diff --git a/luafilesystem/1.8.0/0001-Makefile-Replace-.so-with-.a.patch b/luafilesystem/1.8.0/0001-Makefile-Replace-.so-with-.a.patch
new file mode 100644
index 0000000..addf538
--- /dev/null
+++ b/luafilesystem/1.8.0/0001-Makefile-Replace-.so-with-.a.patch
@@ -0,0 +1,40 @@
+From ff291767f7a52ccedfde41e544fcf3b7c5fe2a45 Mon Sep 17 00:00:00 2001
+From: Xavier Del Campo Romero <xavi.dcr@tutanota.com>
+Date: Tue, 24 Oct 2023 16:04:03 +0200
+Subject: [PATCH] Makefile: Replace .so with .a
+
+---
+ Makefile | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index a7312a4..e22c2c9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -9,17 +9,17 @@ include $(CONFIG)
+ SRCS= src/$T.c
+ OBJS= src/$T.o
+
+-lib: src/lfs.so
++LIB=src/liblfs.a
+
+-src/lfs.so: $(OBJS)
+- MACOSX_DEPLOYMENT_TARGET=$(MACOSX_DEPLOYMENT_TARGET); export MACOSX_DEPLOYMENT_TARGET; $(CC) $(LIB_OPTION) -o src/lfs.so $(OBJS)
++$(LIB): $(OBJS)
++ $(AR) $(ARFLAGS) $@ $(OBJS)
+
+-test: lib
++test: $(LIB)
+ LUA_CPATH=./src/?.so lua tests/test.lua
+
+-install:
++install: $(LIB)
+ mkdir -p $(DESTDIR)$(LUA_LIBDIR)
+- cp src/lfs.so $(DESTDIR)$(LUA_LIBDIR)
++ cp $< $(DESTDIR)$(LUA_LIBDIR)
+
+ clean:
+ rm -f src/lfs.so $(OBJS)
+--
+2.34.1
+
diff --git a/luafilesystem/1.8.0/Dockerfile b/luafilesystem/1.8.0/Dockerfile
new file mode 100644
index 0000000..bfbc115
--- /dev/null
+++ b/luafilesystem/1.8.0/Dockerfile
@@ -0,0 +1,21 @@
+FROM alpine
+RUN apk update && apk add \
+ make \
+ gcc \
+ git \
+ musl-dev \
+ wget
+COPY --from=lua:5.4.6 /opt/spm/lua-5.4.6/ /usr/local/
+RUN wget https://github.com/lunarmodules/luafilesystem/archive/refs/tags/v1_8_0.tar.gz
+RUN tar -xf v1_8_0.tar.gz
+WORKDIR /luafilesystem-1_8_0
+RUN mkdir patches
+COPY 0001-Makefile-Replace-.so-with-.a.patch patches/
+RUN git apply patches/0001-Makefile-Replace-.so-with-.a.patch
+ARG PREFIX=/opt/spm/luafilesystem-1.8.0
+RUN make \
+ CFLAGS="-Os -ffunction-sections -fdata-sections -pedantic \
+ -I/usr/local/include" \
+ LUA_VERSION=5.4 \
+ LIB_OPTION=
+RUN make install LUA_LIBDIR=$PREFIX/lib/