From 26b8c19a099b60e46ae8c78446d35aa58d3fa96d9b372dda1dc44b23aac56646 Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Mon, 10 May 2021 09:09:53 +0000 Subject: [PATCH] Accepting request 891994 from home:gmbr3:Lua goodbye static OBS-URL: https://build.opensuse.org/request/show/891994 OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua54?expand=0&rev=32 --- lua-build-system.patch | 20 ++++++-------------- lua54.changes | 6 ++++++ lua54.spec | 9 +++++---- shared_link.patch | 22 ++++++++++++++++++++++ 4 files changed, 39 insertions(+), 18 deletions(-) create mode 100644 shared_link.patch diff --git a/lua-build-system.patch b/lua-build-system.patch index deb19a6..09ae3d6 100644 --- a/lua-build-system.patch +++ b/lua-build-system.patch @@ -4,15 +4,6 @@ Subject: build system --- a/Makefile +++ b/Makefile -@@ -1,6 +1,8 @@ # - # Makefile for installing Lua - # See doc/readme.html for installation and customization instructions. - -+export LIBTOOL=libtool --quiet -+ - # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ======================= - - # Your platform. See PLATS for possible values. @@ -10,19 +12,20 @@ # so take care if INSTALL_TOP is not an absolute path. See the local target. # You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with @@ -33,7 +24,8 @@ Subject: build system # 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 # @@ -62,10 +54,10 @@ Subject: build system install: dummy cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) ++ cd src && $(INSTALL_LIBTOOL) $(TO_LIB) $(INSTALL_LIB) cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN) cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) - cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) -+ cd src && $(INSTALL_LIBTOOL) $(TO_LIB) $(INSTALL_LIB) cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) uninstall: @@ -132,15 +124,15 @@ Subject: build system $(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 9:0:4 -o $(LUA_A) ++ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -lm -ldl $(BASE_O:.o=.lo) -shared -rpath /usr/lib -version-info 9:0:4 -o $(LUA_A) $(LUA_T): $(LUA_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) -+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LIBS) -static $(LUA_A) -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 $(LUA_A) luac.lo -o $@ ++ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LUA_A) luac.lo -o $@ test: - ./$(LUA_T) -v diff --git a/lua54.changes b/lua54.changes index 5595274..d0615a6 100644 --- a/lua54.changes +++ b/lua54.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon May 10 08:54:04 UTC 2021 - Callum Farmer + +- Add shared_link.patch: fix dynamic linking executable +- Stop building static library + ------------------------------------------------------------------- Mon Apr 19 09:15:40 UTC 2021 - Callum Farmer diff --git a/lua54.spec b/lua54.spec index 043cdfd..e5def00 100644 --- a/lua54.spec +++ b/lua54.spec @@ -44,6 +44,7 @@ Patch3: main_test.patch # PATCH-FIX-UPSTREAM https://www.lua.org/bugs.html#5.4.3 Patch4: upstream-bugs.patch Patch5: upstream-bugs-test.patch +Patch6: shared_link.patch %if "%{flavor}" == "test" BuildRequires: lua54 %else @@ -144,6 +145,7 @@ of C functions, written in ANSI C. %setup -q -n lua-%{version} %patch0 -p1 %patch4 -p1 +%patch6 -p1 %endif # manpage @@ -152,19 +154,19 @@ cat doc/lua.1 | sed 's/TH LUA 1/TH LUA%{major_version} 1/' > doc/lua%{major_ver cat doc/luac.1 | sed 's/TH LUAC 1/TH LUAC%{major_version} 1/' > doc/luac%{major_version}.1 %build -%global _lto_cflags %{_lto_cflags} -ffat-lto-objects sed -i -e "s@lib/lua/@%{_lib}/lua/@g" src/luaconf.h -export LIBTOOL="libtool --quiet" -make -O -j3 V=1 VERBOSE=1 -C src \ +make %{_smp_mflags} VERBOSE=1 -C src \ CC="cc" \ MYCFLAGS="%{optflags} -std=gnu99 -D_GNU_SOURCE -fPIC -DLUA_USE_LINUX -DLUA_COMPAT_MODULE" \ MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" \ V=%{major_version} \ + LIBTOOL="libtool --quiet" \ all %install %make_install \ V=%{major_version} \ + LIBTOOL="libtool --quiet" \ INSTALL_TOP="%{buildroot}%{_prefix}" \ INSTALL_LIB="%{buildroot}%{_libdir}" @@ -267,7 +269,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..4e24c75 --- /dev/null +++ b/shared_link.patch @@ -0,0 +1,22 @@ +--- a/src/ldebug.h ++++ b/src/ldebug.h +@@ -36,7 +36,7 @@ + #endif + + +-LUAI_FUNC int luaG_getfuncline (const Proto *f, int pc); ++LUA_API int luaG_getfuncline (const Proto *f, int pc); + LUAI_FUNC const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n, + StkId *pos); + LUAI_FUNC l_noret luaG_typeerror (lua_State *L, const TValue *o, +--- a/src/lundump.h ++++ b/src/lundump.h +@@ -30,7 +30,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