From 69c377b06a3a5865c5a57ecdeeed6c6f87b9df00c69d3b3caa7344b9caf9d592 Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Mon, 12 Sep 2022 11:11:11 +0000 Subject: [PATCH 1/2] Accepting request 1002891 from home:gmbr3:Lua - Add shared_link.patch: fix dynamic linking executable - Stop building static library OBS-URL: https://build.opensuse.org/request/show/1002891 OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua53?expand=0&rev=38 --- lua-build-system.patch | 11 ++++++----- lua53.changes | 6 ++++++ lua53.spec | 3 +-- shared-link.patch | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 shared-link.patch diff --git a/lua-build-system.patch b/lua-build-system.patch index 2072d8f..0296465 100644 --- a/lua-build-system.patch +++ b/lua-build-system.patch @@ -40,9 +40,10 @@ Index: lua-5.3.4/Makefile # How to install. If your install program does not support "-p", then # you may have to run ranlib on the installed liblua.a. INSTALL= install -p - INSTALL_EXEC= $(INSTALL) -m 0755 +-INSTALL_EXEC= $(INSTALL) -m 0755 ++INSTALL_EXEC= $(LIBTOOL) --mode=install install -m 0755 INSTALL_DATA= $(INSTALL) -m 0644 -+INSTALL_LIBTOOL= $(LIBTOOL) --mode=install install -m 0644 ++INSTALL_LIBTOOL= $(LIBTOOL) --mode=install install -m 0755 # # If you don't have "install" you can use "cp" instead. # INSTALL= cp -p @@ -134,15 +135,15 @@ Index: lua-5.3.4/src/Makefile $(LUA_A): $(BASE_O) - $(AR) $@ $(BASE_O) - $(RANLIB) $@ -+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -lm -ldl $(BASE_O:.o=.lo) -rpath /usr/lib -version-info 8:0:3 -o liblua$(V).la ++ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -lm -ldl $(BASE_O:.o=.lo) -rpath /usr/lib -shared -version-info 8:0:3 -o liblua$(V).la $(LUA_T): $(LUA_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) -+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LIBS) -static liblua$(V).la -Wl,-E lua.lo -o $@ ++ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LIBS) $(LUA_A) -Wl,-E lua.lo -o $@ $(LUAC_T): $(LUAC_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) -+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -static liblua$(V).la luac.lo -o $@ ++ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LUA_A) luac.lo -o $@ clean: $(RM) $(ALL_T) $(ALL_O) diff --git a/lua53.changes b/lua53.changes index 24b9e5b..b76a565 100644 --- a/lua53.changes +++ b/lua53.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Sep 12 11:10:48 UTC 2022 - Callum Farmer + +- Add shared_link.patch: fix dynamic linking executable +- Stop building static library + ------------------------------------------------------------------- Fri Sep 25 14:46:59 UTC 2020 - Callum Farmer diff --git a/lua53.spec b/lua53.spec index 9d78962..100c00d 100644 --- a/lua53.spec +++ b/lua53.spec @@ -33,6 +33,7 @@ Patch0: lua-build-system.patch #Patch1: upstream-bugs.patch # PATCH-FIX-UPSTREAM https://www.lua.org/bugs.html#5.4.0 #Patch2: upstream-bugs-backport-lua54.patch +Patch3: shared-link.patch BuildRequires: libtool BuildRequires: lua-macros BuildRequires: pkgconfig @@ -142,7 +143,6 @@ make install \ V=%{major_version} \ INSTALL_TOP="%{buildroot}%{_prefix}" \ INSTALL_LIB="%{buildroot}%{_libdir}" - find %{buildroot} -type f -name "*.la" -delete -print # create pkg-config file @@ -241,7 +241,6 @@ fi %{_includedir}/lua%{major_version}/lua.hpp %{_includedir}/lua%{major_version}/luaconf.h %{_includedir}/lua%{major_version}/lualib.h -%{_libdir}/liblua%{major_version}.a %{_libdir}/liblua%{major_version}.so %{_libdir}/pkgconfig/lua%{major_version}.pc # alternatives diff --git a/shared-link.patch b/shared-link.patch new file mode 100644 index 0000000..a31d77e --- /dev/null +++ b/shared-link.patch @@ -0,0 +1,33 @@ +--- a/src/lundump.h ++++ b/src/lundump.h +@@ -26,7 +26,7 @@ + LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name); + + /* dump one chunk; from ldump.c */ +-LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, ++LUA_API int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, + void* data, int strip); + + #endif + +--- a/src/lopcodes.h ++++ b/src/lopcodes.h +@@ -278,7 +278,7 @@ + OpArgK /* argument is a constant or register/constant */ + }; + +-LUAI_DDEC const lu_byte luaP_opmodes[NUM_OPCODES]; ++LUA_API const lu_byte luaP_opmodes[NUM_OPCODES]; + + #define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3)) + #define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3)) +@@ -287,7 +287,7 @@ + #define testTMode(m) (luaP_opmodes[m] & (1 << 7)) + + +-LUAI_DDEC const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ ++LUA_API const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ + + + /* number of list items to accumulate before a SETLIST instruction */ + From 5493c37d11705c156fc72666d1a36580e0a61e4a06c597a40d3eb7742e1ca30f Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Mon, 12 Sep 2022 11:11:27 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua53?expand=0&rev=39 --- lua53.changes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua53.changes b/lua53.changes index b76a565..999b25d 100644 --- a/lua53.changes +++ b/lua53.changes @@ -1,7 +1,7 @@ ------------------------------------------------------------------- Mon Sep 12 11:10:48 UTC 2022 - Callum Farmer -- Add shared_link.patch: fix dynamic linking executable +- Add shared-link.patch: fix dynamic linking executable - Stop building static library -------------------------------------------------------------------