forked from pool/lua-mpack
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.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -21,3 +21,4 @@
|
|||||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.changes merge=merge-changes
|
||||||
|
|||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1 +1,6 @@
|
|||||||
.osc
|
.osc
|
||||||
|
*.obscpio
|
||||||
|
*.osc
|
||||||
|
_build.*
|
||||||
|
.pbuild
|
||||||
|
lua*-mpack-*-build/
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:66811e30b316b53d1e3c4225248d4813b8b852c3e19121ba5ad47a9d4537d1ae
|
|
||||||
size 14557
|
|
||||||
@@ -1,3 +1,13 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Oct 13 13:21:48 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||||
|
|
||||||
|
- 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 <mvetter@suse.com>
|
Thu Feb 22 09:55:44 UTC 2024 - Michael Vetter <mvetter@suse.com>
|
||||||
|
|
||||||
|
|||||||
@@ -19,24 +19,22 @@
|
|||||||
%define flavor @BUILD_FLAVOR@
|
%define flavor @BUILD_FLAVOR@
|
||||||
%define libmpack_version 1.0.5
|
%define libmpack_version 1.0.5
|
||||||
%define mod_name mpack
|
%define mod_name mpack
|
||||||
Version: 1.0.6
|
Version: 1.0.12
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Implementation of MessagePack for Lua 5.1
|
Summary: Implementation of MessagePack for Lua 5.1
|
||||||
License: MIT
|
License: MIT
|
||||||
Group: Development/Libraries/Other
|
Group: Development/Libraries/Other
|
||||||
URL: https://github.com/libmpack/libmpack-lua
|
URL: https://github.com/libmpack/libmpack-lua
|
||||||
Source: https://github.com/libmpack/libmpack-lua/archive/%{version}.tar.gz
|
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, next release should build
|
# libmpack source is necessary to build lua-mpack, need to package mpack to Factory
|
||||||
# fine against system version
|
Source1: https://github.com/libmpack/libmpack/archive/refs/tags/%{libmpack_version}.tar.gz#/libmpack-%{libmpack_version}.tar.gz
|
||||||
# The latest source can be downloaded from: https://github.com/libmpack/libmpack
|
# PATCH-FIX-UPSTREAM luajit-build.patch gh#libmpack/libmpack-lua!34 mcepl@suse.com
|
||||||
Source1: https://github.com/libmpack/libmpack/archive/%{libmpack_version}/libmpack-%{libmpack_version}.tar.gz
|
# Add #define to mask Lua API 5.1 / 5.2 incompatibility
|
||||||
# PATCH-FIX-UPSTREAM lua51-mpack-fix-gcc7.patch gh#libmpack/libmpack-lua#3 -- Fix compilation error when using GCC7.
|
Patch2: luajit-build.patch
|
||||||
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
|
|
||||||
BuildRequires: %{flavor}-devel
|
BuildRequires: %{flavor}-devel
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: libtool
|
BuildRequires: libtool
|
||||||
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: lua-macros
|
BuildRequires: lua-macros
|
||||||
Requires: %{flavor}
|
Requires: %{flavor}
|
||||||
%lua_provides
|
%lua_provides
|
||||||
@@ -54,12 +52,8 @@ and msgpack-rpc specifications.
|
|||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n libmpack-lua-%{version}
|
%autosetup -p1 -n libmpack-lua-%{version}
|
||||||
|
|
||||||
# Extract the libmpack source to the right directory.
|
( mkdir -p "mpack-src" && cd "mpack-src"
|
||||||
mkdir -p mpack-src
|
tar --extract --strip-components=1 --file %{SOURCE1} )
|
||||||
pushd mpack-src
|
|
||||||
cp %{SOURCE1} ./
|
|
||||||
tar --strip-components=1 -xzf libmpack-%{libmpack_version}.tar.gz
|
|
||||||
popd
|
|
||||||
|
|
||||||
# Fix lua directory.
|
# Fix lua directory.
|
||||||
sed -i 's|LUA_CMOD_INSTALLDIR :=.*|LUA_CMOD_INSTALLDIR := $(shell echo "%{lua_archdir}")|g' Makefile
|
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
|
%build
|
||||||
make %{?_make_output_sync} %{?_smp_mflags} \
|
make %{?_make_output_sync} %{?_smp_mflags} \
|
||||||
USE_SYSTEM_LUA=yes \
|
USE_SYSTEM_LUA=yes \
|
||||||
MPACK_LUA_VERSION=%{lua_version} \
|
USE_SYSTEM_MPACK=no \
|
||||||
CFLAGS="%{optflags} -fPIC"
|
LUA_IMPL="lua" \
|
||||||
|
CFLAGS="%{optflags} -fPIC %(pkgconf --cflags --libs lua)"
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install USE_SYSTEM_LUA=yes
|
%make_install USE_SYSTEM_LUA=yes \
|
||||||
|
LUA_CMOD_INSTALLDIR="%{lua_archdir}"
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc mpack-src/LICENSE-MIT README.md
|
%doc mpack-src/LICENSE-MIT README.md
|
||||||
%dir %{lua_archdir}
|
%{lua_archdir}/mpack.so
|
||||||
%{lua_archdir}/*
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
|||||||
@@ -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)
|
|
||||||
@@ -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
|
|
||||||
19
luajit-build.patch
Normal file
19
luajit-build.patch
Normal file
@@ -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)
|
||||||
BIN
mpack-1.0.12.tar.gz
(Stored with Git LFS)
Normal file
BIN
mpack-1.0.12.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
Reference in New Issue
Block a user