projects/aports·blob master · refs

184 lines · 7.2 KiB

1From dc891ba243e6dc7c327e8c63ad404a40314c61e3 Mon Sep 17 00:00:00 2001
2From: Achill Gilgenast <[email protected]>
3Date: Tue, 23 Dec 2025 15:49:27 +0100
4Subject: [PATCH] Support Lua 5.5
5
6Signed-off-by: Achill Gilgenast <[email protected]>
7---
8 GNUmakefile | 7 +++++--
9 src/GNUmakefile | 21 +++++++++++++++++----
10 vendor/compat53/c-api/compat-5.3.h | 6 +++---
11 3 files changed, 25 insertions(+), 9 deletions(-)
12
13diff --git a/GNUmakefile b/GNUmakefile
14index 0105102f3d13..69d14a1cd285 100644
15--- a/GNUmakefile
16+++ b/GNUmakefile
17@@ -12,7 +12,7 @@ all: # default target
18 #
19 # G N U M A K E F U N C T I O N S
20 #
21-KNOWN_APIS = 5.1 5.2 5.3 5.4
22+KNOWN_APIS = 5.1 5.2 5.3 5.4 5.5
23
24 # template for invoking luapath script
25 LUAPATH := $(d)/mk/luapath
26@@ -42,6 +42,8 @@ lua53cpath ?= $(libdir)/lua/5.3
27 lua53path ?= $(datadir)/lua/5.3
28 lua54cpath ?= $(libdir)/lua/5.4
29 lua54path ?= $(datadir)/lua/5.4
30+lua55cpath ?= $(libdir)/lua/5.5
31+lua55path ?= $(datadir)/lua/5.5
32
33
34 AR ?= ar
35@@ -99,7 +101,7 @@ endif
36
37 # set LUA_APIS if empty or "?"
38 ifeq ($(or $(strip $(LUA_APIS)),?),?)
39-override LUA_APIS := $(call HAVE_API_FN,5.1) $(call HAVE_API_FN,5.2) $(call HAVE_API_FN,5.3) $(call HAVE_API_FN,5.4)
40+override LUA_APIS := $(call HAVE_API_FN,5.1) $(call HAVE_API_FN,5.2) $(call HAVE_API_FN,5.3) $(call HAVE_API_FN,5.4 )$(call HAVE_API_FN,5.5)
41 endif
42
43 define LUAXY_template
44@@ -135,6 +137,7 @@ $(eval $(call LUAXY_template,5.1))
45 $(eval $(call LUAXY_template,5.2))
46 $(eval $(call LUAXY_template,5.3))
47 $(eval $(call LUAXY_template,5.4))
48+$(eval $(call LUAXY_template,5.5))
49
50 #
51 # A U T O D E T E C T C O M P I L A T I O N F L A G S
52diff --git a/src/GNUmakefile b/src/GNUmakefile
53index f7462af51345..76ecb161ef1c 100644
54--- a/src/GNUmakefile
55+++ b/src/GNUmakefile
56@@ -41,6 +41,7 @@ $$(d)/$(1)/%.o: $$(d)/%.c $$(d)/config.h
57
58 ifneq ($(1), 5.3)
59 ifneq ($(1), 5.4)
60+ifneq ($(1), 5.5)
61 $$(d)/$(1)/compat53.o: $$(d)/../vendor/compat53/c-api/compat-5.3.c $$(d)/../vendor/compat53/c-api/compat-5.3.h $$(d)/config.h
62 $$(MKDIR) -p $$(@D)
63 $$(CC) $$(CFLAGS_$(d)) $$(ALL_LUA$(subst .,,$(1))_CPPFLAGS) $$(CPPFLAGS_$(d)) -c -o $$@ $$<
64@@ -50,6 +51,7 @@ $$(d)/$(1)/%.o: $$(d)/../vendor/compat53/c-api/compat-5.3.h
65 $$(d)/$(1)/openssl.so: $$(d)/$(1)/compat53.o
66 endif
67 endif
68+endif
69
70 .SECONDARY: liblua$(1)-openssl openssl$(1) openssl
71
72@@ -61,14 +63,16 @@ $(eval $(call BUILD_$(d),5.1))
73 $(eval $(call BUILD_$(d),5.2))
74 $(eval $(call BUILD_$(d),5.3))
75 $(eval $(call BUILD_$(d),5.4))
76+$(eval $(call BUILD_$(d),5.5))
77
78 ifneq "$(filter $(abspath $(d)/..)/%, $(abspath $(firstword $(MAKEFILE_LIST))))" ""
79-.SECONDARY: all all5.1 all5.2 all5.3 all5.4
80+.SECONDARY: all all5.1 all5.2 all5.3 all5.4 all5.5
81
82 all5.1: liblua5.1-openssl
83 all5.2: liblua5.2-openssl
84 all5.3: liblua5.3-openssl
85 all5.4: liblua5.4-openssl
86+all5.5: liblua5.5-openssl
87 all: $(foreach API,$(strip $(LUA_APIS)),all$(API))
88
89 endif
90@@ -157,23 +161,26 @@ $(eval $(call INSTALL_$(d),5.1,$$(lua51cpath),$$(lua51path)))
91 $(eval $(call INSTALL_$(d),5.2,$$(lua52cpath),$$(lua52path)))
92 $(eval $(call INSTALL_$(d),5.3,$$(lua53cpath),$$(lua53path)))
93 $(eval $(call INSTALL_$(d),5.4,$$(lua54cpath),$$(lua54path)))
94+$(eval $(call INSTALL_$(d),5.5,$$(lua55cpath),$$(lua55path)))
95
96 ifneq "$(filter $(abspath $(d)/..)/%, $(abspath $(firstword $(MAKEFILE_LIST))))" ""
97
98-.SECONDARY: install5.1 install5.2 install5.3 install5.4 install
99+.SECONDARY: install5.1 install5.2 install5.3 install5.4 install5.5 install
100
101 install5.1: liblua5.1-openssl-install
102 install5.2: liblua5.2-openssl-install
103 install5.3: liblua5.3-openssl-install
104 install5.4: liblua5.4-openssl-install
105+install5.5: liblua5.5-openssl-install
106 install: $(foreach API,$(strip $(LUA_APIS)),install$(API))
107
108-.PHONY: uninstall5.1 uninstall5.2 uninstall5.3 uninstall5.4 uninstall
109+.PHONY: uninstall5.1 uninstall5.2 uninstall5.3 uninstall5.4 uninstall5.5 uninstall
110
111 uninstall5.1: liblua5.1-openssl-uninstall
112 uninstall5.2: liblua5.2-openssl-uninstall
113 uninstall5.3: liblua5.3-openssl-uninstall
114 uninstall5.4: liblua5.4-openssl-uninstall
115+uninstall5.5: liblua5.5-openssl-uninstall
116 uninstall: $(foreach API,$(strip $(LUA_APIS)),uninstall$(API))
117
118 endif
119@@ -185,7 +192,7 @@ endif
120 .PHONY: $(d)/clean $(d)/clean~ clean clean~
121
122 $(d)/clean:
123- $(RM) -fr $(@D)/config.h $(@D)/*.dSYM $(@D)/5.1 $(@D)/5.2 $(@D)/5.3 $(@D)/5.4
124+ $(RM) -fr $(@D)/config.h $(@D)/*.dSYM $(@D)/5.1 $(@D)/5.2 $(@D)/5.3 $(@D)/5.4 $(@D)/5.5
125
126 $(d)/clean~: $(d)/clean
127 $(RM) -f $(@D)/*~
128@@ -209,16 +216,19 @@ $(d)/help:
129 @echo " all5.2 - build 5.2/openssl.so"
130 @echo " all5.3 - build 5.3/openssl.so"
131 @echo " all5.4 - build 5.4/openssl.so"
132+ @echo " all5.5 - build 5.5/openssl.so"
133 @echo " install - install all API targets"
134 @echo " install5.1 - install openssl Lua 5.1 modules"
135 @echo " install5.2 - install openssl Lua 5.2 modules"
136 @echo " install5.3 - install openssl Lua 5.3 modules"
137 @echo " install5.4 - install openssl Lua 5.4 modules"
138+ @echo " install5.5 - install openssl Lua 5.5 modules"
139 @echo " uninstall - uninstall all API targets"
140 @echo "uninstall5.1 - uninstall openssl Lua 5.1 modules"
141 @echo "uninstall5.2 - uninstall openssl Lua 5.2 modules"
142 @echo "uninstall5.3 - uninstall openssl Lua 5.3 modules"
143 @echo "uninstall5.4 - uninstall openssl Lua 5.4 modules"
144+ @echo "uninstall5.5 - uninstall openssl Lua 5.5 modules"
145 @echo " clean - rm binary targets, object files, debugging symbols, etc"
146 @echo " clean~ - clean + rm *~"
147 @echo " help - echo this help message"
148@@ -235,11 +245,14 @@ $(d)/help:
149 @echo 'lua53cpath - install path for Lua 5.3 C modules ($(value lua53cpath))'
150 @echo ' lua54path - install path for Lua 5.4 modules ($(value lua54path))'
151 @echo 'lua54cpath - install path for Lua 5.4 C modules ($(value lua54cpath))'
152+ @echo ' lua55path - install path for Lua 5.5 modules ($(value lua54path))'
153+ @echo 'lua55cpath - install path for Lua 5.5 C modules ($(value lua54cpath))'
154 @echo ""
155 @echo 'LUA51_CPPFLAGS - cpp flags for Lua 5.1 headers ($(LUA51_CPPFLAGS))'
156 @echo 'LUA52_CPPFLAGS - cpp flags for Lua 5.2 headers ($(LUA52_CPPFLAGS))'
157 @echo 'LUA53_CPPFLAGS - cpp flags for Lua 5.3 headers ($(LUA53_CPPFLAGS))'
158 @echo 'LUA54_CPPFLAGS - cpp flags for Lua 5.4 headers ($(LUA54_CPPFLAGS))'
159+ @echo 'LUA55_CPPFLAGS - cpp flags for Lua 5.5 headers ($(LUA54_CPPFLAGS))'
160 @echo ""
161 @echo "(NOTE: all the common GNU-style paths are supported, including"
162 @echo "prefix, bindir, libdir, datadir, includedir, and DESTDIR.)"
163diff --git a/vendor/compat53/c-api/compat-5.3.h b/vendor/compat53/c-api/compat-5.3.h
164index b730a4b8af46..845f803968ce 100644
165--- a/vendor/compat53/c-api/compat-5.3.h
166+++ b/vendor/compat53/c-api/compat-5.3.h
167@@ -399,11 +399,11 @@ COMPAT53_API void luaL_requiref (lua_State *L, const char *modname,
168
169
170 /* other Lua versions */
171-#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 504
172+#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 || LUA_VERSION_NUM > 505
173
174-# error "unsupported Lua version (i.e. not Lua 5.1, 5.2, 5.3, or 5.4)"
175+# error "unsupported Lua version (i.e. not Lua 5.1, 5.2, 5.3, 5.4, or 5.5)"
176
177-#endif /* other Lua versions except 5.1, 5.2, 5.3, and 5.4 */
178+#endif /* other Lua versions except 5.1, 5.2, 5.3, 5.4, and 5.5 */
179
180
181
182--
1832.52.0
184