From edaeba56fafdbcb7f26624747cfaf2aa33491e98 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Fri, 15 Nov 2024 21:45:40 +0800 Subject: [PATCH] rebuild for lua 5.4 (cherry picked from commit 24e7360b3bdf048d0480df4e387a5e519796bf64) --- ...a.so-to-shared-modules-so-that-all-t.patch | 40 +++++++++++++++++++ lua-socket.spec | 27 +++++++------ lua-socket.yaml | 2 +- 3 files changed, 55 insertions(+), 14 deletions(-) create mode 100644 0001-add-LDLIBS-liblua.so-to-shared-modules-so-that-all-t.patch diff --git a/0001-add-LDLIBS-liblua.so-to-shared-modules-so-that-all-t.patch b/0001-add-LDLIBS-liblua.so-to-shared-modules-so-that-all-t.patch new file mode 100644 index 0000000..bfb387d --- /dev/null +++ b/0001-add-LDLIBS-liblua.so-to-shared-modules-so-that-all-t.patch @@ -0,0 +1,40 @@ +From 6d0f6f2c643035b39a6d895991441a5ba2799def Mon Sep 17 00:00:00 2001 +From: Funda Wang +Date: Fri, 15 Nov 2024 21:42:30 +0800 +Subject: [PATCH] add LDLIBS "liblua.so" to shared modules, so that all the + references are resolved. + +--- + src/makefile | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/makefile b/src/makefile +index 06f4d19..97a314e 100644 +--- a/src/makefile ++++ b/src/makefile +@@ -396,18 +396,18 @@ none: + all: $(SOCKET_SO) $(MIME_SO) + + $(SOCKET_SO): $(SOCKET_OBJS) +- $(LD) $(SOCKET_OBJS) $(LDFLAGS)$@ ++ $(LD) $(SOCKET_OBJS) $(LDFLAGS)$@ -llua + + $(MIME_SO): $(MIME_OBJS) +- $(LD) $(MIME_OBJS) $(LDFLAGS)$@ ++ $(LD) $(MIME_OBJS) $(LDFLAGS)$@ -llua + + all-unix: all $(UNIX_SO) $(SERIAL_SO) + + $(UNIX_SO): $(UNIX_OBJS) +- $(LD) $(UNIX_OBJS) $(LDFLAGS)$@ ++ $(LD) $(UNIX_OBJS) $(LDFLAGS)$@ -llua + + $(SERIAL_SO): $(SERIAL_OBJS) +- $(LD) $(SERIAL_OBJS) $(LDFLAGS)$@ ++ $(LD) $(SERIAL_OBJS) $(LDFLAGS)$@ -llua + + install: + $(INSTALL_DIR) $(INSTALL_TOP_LDIR) +-- +2.46.0 + diff --git a/lua-socket.spec b/lua-socket.spec index d30fbd2..188a6ab 100644 --- a/lua-socket.spec +++ b/lua-socket.spec @@ -1,13 +1,14 @@ Name: lua-socket Version: 3.1.0 -Release: 1 +Release: 2 Summary: Network support for the Lua language License: MIT -URL: https://www.tecgraf.puc-rio.br/~diego/professional/luasocket/ +URL: https://lunarmodules.github.io/luasocket/ Source0: https://github.com/diegonehab/luasocket/archive/luasocket-%{version}.tar.gz +Patch0001: 0001-add-LDLIBS-liblua.so-to-shared-modules-so-that-all-t.patch BuildRequires: gcc make lua lua-devel /usr/bin/iconv -Requires: lua >= 5.3 +%{?lua_requires} %description LuaSocket is a Lua extension library that is composed by two parts: a C core @@ -26,37 +27,37 @@ Lua using %{name} %package_help %prep -%setup -q -n luasocket-%{version} +%autosetup -p1 -n luasocket-%{version} %build -%make_build LUAV=5.3 OPTFLAGS="%{optflags} -fPIC" LDFLAGS="%{?__global_ldflags} -shared -o " linux +%make_build LUAV=%lua_version CFLAGS_linux="%{build_cflags} -fPIC -I%{_includedir} -DLUASOCKET_NODEBUG -DLUA_COMPAT_APIINTCASTS" LDFLAGS="%{?__global_ldflags} -shared -o " linux /usr/bin/iconv -f ISO8859-1 -t UTF8 LICENSE >LICENSE.UTF8 mv -f LICENSE.UTF8 LICENSE %install make install-unix OPTFLAGS="%{optflags}" INSTALL_TOP=$RPM_BUILD_ROOT \ - INSTALL_TOP_CDIR=$RPM_BUILD_ROOT%{_libdir}/lua/5.3 \ - INSTALL_TOP_LDIR=$RPM_BUILD_ROOT%{_datadir}/lua/5.3 + INSTALL_TOP_CDIR=$RPM_BUILD_ROOT%{lua_libdir} \ + INSTALL_TOP_LDIR=$RPM_BUILD_ROOT%{lua_pkgdir} install -d $RPM_BUILD_ROOT%{_includedir}/luasocket install -p src/*.h $RPM_BUILD_ROOT%{_includedir}/luasocket %files -%defattr(-,root,root) -%{!?_licensedir:%global license %%doc} %license LICENSE -%{_libdir}/lua/5.3/* -%{_datadir}/lua/5.3/* +%{lua_libdir}/* +%{lua_pkgdir}/* %files devel -%defattr(-,root,root) %{_includedir}/luasocket %files help -%defattr(-,root,root) %doc CHANGELOG.md README.md docs/*.html docs/*.css docs/*.png %changelog +* Fri Nov 01 2024 Funda Wang - 3.1.0-2 +- rebuild for lua 5.4 +- add LDLIBS "liblua.so" + * Tue Feb 21 2023 li-long315 - 3.1.0-1 - Upgrade to 3.1.0 diff --git a/lua-socket.yaml b/lua-socket.yaml index e4be9f9..b364985 100644 --- a/lua-socket.yaml +++ b/lua-socket.yaml @@ -1,4 +1,4 @@ version_control: github src_repo: diegonehab/luasocket tag_prefix: ^v -seperator: . +separator: . -- Gitee