Skip to content

Commit cb824a6

Browse files
committed
100 gar???
1 parent a5dcedd commit cb824a6

File tree

1 file changed

+9
-62
lines changed

1 file changed

+9
-62
lines changed

.github/workflows/build-lua.yml

Lines changed: 9 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -43,75 +43,22 @@ jobs:
4343
4444
cd "lua-5.4.7"
4545
46-
# Create patches
47-
cat > lua-shared-lib.patch << 'EOF'
48-
diff --git a/Makefile b/Makefile
49-
index 416f444..eeaff03 100644
50-
--- a/Makefile
51-
+++ b/Makefile
52-
@@ -52,7 +52,7 @@ R= $V.0
53-
all: $(PLAT)
54-
55-
$(PLATS) help test clean:
56-
- @cd src && $(MAKE) $@
57-
+ @cd src && $(MAKE) $@ V=$(V) R=$(R)
58-
59-
install: dummy
60-
cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
61-
diff --git a/src/Makefile b/src/Makefile
62-
index 514593d..372a6dc 100644
63-
--- a/src/Makefile
64-
+++ b/src/Makefile
65-
@@ -33,6 +33,7 @@ CMCFLAGS= -Os
66-
PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris
67-
68-
LUA_A= liblua.a
69-
+LUA_SO= liblua.so
70-
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
71-
LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o
72-
BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
73-
@@ -44,7 +45,7 @@ LUAC_T= luac
74-
LUAC_O= luac.o
75-
76-
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
77-
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
78-
+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
79-
ALL_A= $(LUA_A)
80-
81-
# Targets start here.
82-
@@ -60,6 +61,12 @@ $(LUA_A): $(BASE_O)
83-
$(AR) $@ $(BASE_O)
84-
$(RANLIB) $@
85-
86-
+$(LUA_SO): $(CORE_O) $(LIB_O)
87-
+ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS)
88-
+ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V)
89-
+ ln -sf $(LUA_SO).$(R) $(LUA_SO)
90-
+
91-
+
92-
$(LUA_T): $(LUA_O) $(LUA_A)
93-
$(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
94-
EOF
95-
46+
# Download and apply patch
47+
curl -fsSL "https://gist.githubusercontent.com/ZeWaka/5d8a24ded388763bfd2e5213093eac95/raw/63d7664347bbdd59389a8af6eeeb5531335af35c/liblua.so.patch" -o lua-shared-lib.patch
9648
patch -p1 < lua-shared-lib.patch
9749
98-
cd src
99-
100-
# Clean build first
101-
make clean
50+
# Build with patched Makefile
51+
make linux
10252
103-
# Build all object files
104-
gcc -std=gnu99 -O2 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_USE_LINUX $(SYSCFLAGS) $(MYCFLAGS) -fPIC -c *.c
105-
106-
# Build shared library directly
107-
gcc -shared -o liblua5.4.so *.o -lm -ldl -o liblua5.4.so
53+
cd src
10854
10955
# Test the library
110-
nm -D liblua5.4.so | grep ' T ' || echo "No exported symbols found!"
111-
ldd liblua5.4.so || echo "Library dependencies not found!"
56+
nm -D liblua.so | grep ' T ' || echo "No exported symbols found!"
57+
ldd liblua.so || echo "Library dependencies not found!"
11258
59+
# Copy and rename
11360
mkdir -p /work/artifacts
114-
cp liblua5.4.so /work/artifacts/
61+
cp liblua.so /work/artifacts/liblua5.4.so
11562
11663
# Verify copy
11764
if [ ! -f /work/artifacts/liblua5.4.so ]; then

0 commit comments

Comments
 (0)