diff --git a/.gitattributes b/.gitattributes index 9b03811..a9bfeea 100644 --- a/.gitattributes +++ b/.gitattributes @@ -21,3 +21,4 @@ *.xz filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text +*.changes merge=merge-changes diff --git a/.gitignore b/.gitignore index 57affb6..c8811e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,6 @@ .osc +*.obscpio +*.osc +_build.* +.pbuild +lua*-mpack-*-build/ diff --git a/1.0.6.tar.gz b/1.0.6.tar.gz deleted file mode 100644 index 4b5c2d2..0000000 --- a/1.0.6.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:66811e30b316b53d1e3c4225248d4813b8b852c3e19121ba5ad47a9d4537d1ae -size 14557 diff --git a/lua-mpack.changes b/lua-mpack.changes index a8ca212..d98b6c1 100644 --- a/lua-mpack.changes +++ b/lua-mpack.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Oct 13 13:21:48 UTC 2025 - Matej Cepl + +- Make the package buildable with LuaJIT. +- Removed upstreamed patches: + - lua51-mpack-fix-compilation.patch + - lua51-mpack-fix-gcc7.patch +- Add luajit-build.patch to make the source compatible with Lua + API < 5.2 (gh#libmpack/libmpack-lua!34). + ------------------------------------------------------------------- Thu Feb 22 09:55:44 UTC 2024 - Michael Vetter diff --git a/lua-mpack.spec b/lua-mpack.spec index ff108a7..8935a58 100644 --- a/lua-mpack.spec +++ b/lua-mpack.spec @@ -19,24 +19,22 @@ %define flavor @BUILD_FLAVOR@ %define libmpack_version 1.0.5 %define mod_name mpack -Version: 1.0.6 +Version: 1.0.12 Release: 0 Summary: Implementation of MessagePack for Lua 5.1 License: MIT Group: Development/Libraries/Other URL: https://github.com/libmpack/libmpack-lua -Source: https://github.com/libmpack/libmpack-lua/archive/%{version}.tar.gz -# libmpack source is necessary to build lua-mpack, next release should build -# fine against system version -# The latest source can be downloaded from: https://github.com/libmpack/libmpack -Source1: https://github.com/libmpack/libmpack/archive/%{libmpack_version}/libmpack-%{libmpack_version}.tar.gz -# PATCH-FIX-UPSTREAM lua51-mpack-fix-gcc7.patch gh#libmpack/libmpack-lua#3 -- Fix compilation error when using GCC7. -Patch0: lua51-mpack-fix-gcc7.patch -# PATCH-FIX-UPSTREAM lua51-mpack-fix-compilation.patch gh#libmpack/libmpack-lua#2 -- Fix compilation error when using `USE_SYSTEM_LUA=1`. -Patch1: lua51-mpack-fix-compilation.patch +Source: https://github.com/libmpack/libmpack-lua/archive/refs/tags/%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz +# libmpack source is necessary to build lua-mpack, need to package mpack to Factory +Source1: https://github.com/libmpack/libmpack/archive/refs/tags/%{libmpack_version}.tar.gz#/libmpack-%{libmpack_version}.tar.gz +# PATCH-FIX-UPSTREAM luajit-build.patch gh#libmpack/libmpack-lua!34 mcepl@suse.com +# Add #define to mask Lua API 5.1 / 5.2 incompatibility +Patch2: luajit-build.patch BuildRequires: %{flavor}-devel BuildRequires: gcc BuildRequires: libtool +BuildRequires: pkgconfig BuildRequires: lua-macros Requires: %{flavor} %lua_provides @@ -54,12 +52,8 @@ and msgpack-rpc specifications. %prep %autosetup -p1 -n libmpack-lua-%{version} -# Extract the libmpack source to the right directory. -mkdir -p mpack-src -pushd mpack-src -cp %{SOURCE1} ./ -tar --strip-components=1 -xzf libmpack-%{libmpack_version}.tar.gz -popd +( mkdir -p "mpack-src" && cd "mpack-src" +tar --extract --strip-components=1 --file %{SOURCE1} ) # Fix lua directory. sed -i 's|LUA_CMOD_INSTALLDIR :=.*|LUA_CMOD_INSTALLDIR := $(shell echo "%{lua_archdir}")|g' Makefile @@ -67,15 +61,16 @@ sed -i 's|LUA_CMOD_INSTALLDIR :=.*|LUA_CMOD_INSTALLDIR := $(shell echo "%{lua_ar %build make %{?_make_output_sync} %{?_smp_mflags} \ USE_SYSTEM_LUA=yes \ - MPACK_LUA_VERSION=%{lua_version} \ - CFLAGS="%{optflags} -fPIC" + USE_SYSTEM_MPACK=no \ + LUA_IMPL="lua" \ + CFLAGS="%{optflags} -fPIC %(pkgconf --cflags --libs lua)" %install -%make_install USE_SYSTEM_LUA=yes +%make_install USE_SYSTEM_LUA=yes \ + LUA_CMOD_INSTALLDIR="%{lua_archdir}" %files %doc mpack-src/LICENSE-MIT README.md -%dir %{lua_archdir} -%{lua_archdir}/* +%{lua_archdir}/mpack.so %changelog diff --git a/lua51-mpack-fix-compilation.patch b/lua51-mpack-fix-compilation.patch deleted file mode 100644 index d39d547..0000000 --- a/lua51-mpack-fix-compilation.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: libmpack-lua-1.0.6/Makefile -=================================================================== ---- libmpack-lua-1.0.6.orig/Makefile -+++ libmpack-lua-1.0.6/Makefile -@@ -99,7 +99,7 @@ $(MPACK): $(LUAROCKS) mpack-src lmpack.c - $(LUAROCKS) make CFLAGS='$(CFLAGS)' - else - $(MPACK): mpack-src lmpack.c -- $(CC) -shared $(CFLAGS) $(INCLUDES) $(LDFLAGS) $^ -o $@ $(LIBS) -+ $(CC) -shared $(CFLAGS) $(INCLUDES) $(LDFLAGS) lmpack.c -o $@ $(LIBS) - endif - - $(BUSTED): $(LUAROCKS) diff --git a/lua51-mpack-fix-gcc7.patch b/lua51-mpack-fix-gcc7.patch deleted file mode 100644 index c6fdf40..0000000 --- a/lua51-mpack-fix-gcc7.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: libmpack-lua-1.0.6/lmpack.c -=================================================================== ---- libmpack-lua-1.0.6.orig/lmpack.c -+++ libmpack-lua-1.0.6/lmpack.c -@@ -689,6 +689,7 @@ static void lmpack_unparse_enter(mpack_p - node->tok = mpack_pack_nil(); - break; - } -+ /* Fallthrough */ - default: - luaL_error(L, "can't serialize object"); - } - -%changelog diff --git a/luajit-build.patch b/luajit-build.patch new file mode 100644 index 0000000..91b873f --- /dev/null +++ b/luajit-build.patch @@ -0,0 +1,19 @@ +--- + lmpack.c | 4 ++++ + 1 file changed, 4 insertions(+) + +Index: libmpack-lua-1.0.12/lmpack.c +=================================================================== +--- libmpack-lua-1.0.12.orig/lmpack.c 2024-02-07 00:28:09.000000000 +0100 ++++ libmpack-lua-1.0.12/lmpack.c 2025-10-13 15:00:35.793539104 +0200 +@@ -54,6 +54,10 @@ + #define luaL_reg luaL_Reg + #endif + ++#if LUA_VERSION_NUM < 502 ++# define luaL_reg luaL_Reg ++#endif ++ + #if LUA_VERSION_NUM > 501 + #ifndef luaL_register + #define luaL_register(L,n,f) luaL_setfuncs(L,f,0) diff --git a/mpack-1.0.12.tar.gz b/mpack-1.0.12.tar.gz new file mode 100644 index 0000000..45195ac --- /dev/null +++ b/mpack-1.0.12.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c3f0a5fcd0d7c169fd7bc95978412628d8f59eb9da1d32cf3e8a864b741ec92 +size 16524