This commit is contained in:
Fijxu 2024-03-07 20:28:57 -03:00
commit e571c4fbe8
139 changed files with 8839 additions and 0 deletions

View file

@ -0,0 +1,46 @@
{
"name": "lua-5.3",
"buildsystem": "simple",
"build-commands": [
"make -j $FLATPAK_BUILDER_N_JOBS CFLAGS=\"$CFLAGS -fPIC -DLUA_USE_LINUX\" linux",
"make TO_LIB=liblua.so.5.3.5 INSTALL_TOP=$FLATPAK_DEST install",
"ln -sf liblua.so.5.3.5 $FLATPAK_DEST/lib/liblua.so",
"ln -sf liblua.so.5.3.5 $FLATPAK_DEST/lib/liblua.so.5.3",
"make INSTALL_TOP=${FLATPAK_DEST} pc > lua.pc",
"cat lua.pc.in >> lua.pc",
"install -Dm644 lua.pc $FLATPAK_DEST/lib/pkgconfig/lua.pc",
"ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua53.pc",
"ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua5.3.pc",
"ln -sf lua.pc $FLATPAK_DEST/lib/pkgconfig/lua-5.3.pc"
],
"sources": [
{
"type": "archive",
"url": "https://www.lua.org/ftp/lua-5.3.5.tar.gz",
"sha256": "0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac"
},
{
"type": "patch",
"path": "makefile-add-liblua.so-rule.patch"
},
{
"type": "file",
"path": "lua.pc.in"
},
{
"type": "shell",
"commands": [
"sed -i \"s|/usr/local/|$FLATPAK_DEST/|;s|LUA_IDSIZE 60|LUA_IDSIZE 512|\" src/luaconf.h",
"# Lua 5.3.5 has wrong release version in its Makefile. Fix it.",
"sed 's/^R= \$V.4/R= \$V.5/' -i Makefile",
"sed -i '12 a\\\\n#define LUA_COMPAT_5_1\\n#define LUA_COMPAT_5_2' src/luaconf.h"
]
}
],
"cleanup": [
"/bin",
"/include",
"/lib/pkgconfig",
"/man"
]
}

View file

@ -0,0 +1,8 @@
exec_prefix=${prefix}
Name: Lua
Description: An Extensible Extension Language
Version: ${version}
Requires:
Libs: -L${libdir} -llua -lm
Cflags: -I${includedir}

View file

@ -0,0 +1,47 @@
diff --git a/Makefile b/Makefile
index 7fa91c8..dccf485 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,7 @@ R= $V.0
all: $(PLAT)
$(PLATS) clean:
- cd src && $(MAKE) $@
+ cd src && $(MAKE) $@ V=$(V) R=$(R)
test: dummy
src/lua -v
diff --git a/src/Makefile b/src/Makefile
index 2e7a412..fa5769f 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -29,6 +29,7 @@ MYOBJS=
PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
LUA_A= liblua.a
+LUA_SO= liblua.so
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
ltm.o lundump.o lvm.o lzio.o
@@ -43,7 +44,7 @@ LUAC_T= luac
LUAC_O= luac.o
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
ALL_A= $(LUA_A)
# Targets start here.
@@ -59,6 +60,12 @@ $(LUA_A): $(BASE_O)
$(AR) $@ $(BASE_O)
$(RANLIB) $@
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
+ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
+ ln -sf $(LUA_SO).$(R) $(LUA_SO)
+
+
$(LUA_T): $(LUA_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)