diff --git a/prosody-0.11.5-lua54.patch b/prosody-0.11.5-lua54.patch index 09c0804..1d293ec 100644 --- a/prosody-0.11.5-lua54.patch +++ b/prosody-0.11.5-lua54.patch @@ -1,6 +1,9 @@ -diff -up prosody-0.11.5/configure.lua54 prosody-0.11.5/configure ---- prosody-0.11.5/configure.lua54 2020-06-30 15:47:57.575906862 -0400 -+++ prosody-0.11.5/configure 2020-06-30 15:50:52.970509696 -0400 +- https://issues.prosody.im/1395 +- https://hg.prosody.im/trunk/rev/48f7cda4174d +- https://hg.prosody.im/trunk/rev/a7903de619b0 + +--- prosody-0.11.5/configure 2020-06-30 15:47:57.575906862 -0400 ++++ prosody-0.11.5/configure.lua54 2020-06-30 15:50:52.970509696 -0400 @@ -44,7 +44,7 @@ Configure $APP_NAME prior to building. Default is \$PREFIX/lib --datadir=DIR Location where the server data should be stored. @@ -41,3 +44,71 @@ diff -up prosody-0.11.5/configure.lua54 prosody-0.11.5/configure fi for suffix in "" $suffixes do +--- prosody-0.11.7/net/websocket/frames.lua 2020-05-31 22:39:34.000000000 +0200 ++++ prosody-0.11.7/net/websocket/frames.lua.lua54 2020-10-08 22:31:55.998715572 +0200 +@@ -9,8 +9,7 @@ + local softreq = require "util.dependencies".softreq; + local random_bytes = require "util.random".bytes; + +-local bit = assert(softreq"bit" or softreq"bit32", +- "No bit module found. See https://prosody.im/doc/depends#bitop"); ++local bit = require "util.bitcompat"; + local band = bit.band; + local bor = bit.bor; + local bxor = bit.bxor; +--- prosody-0.11.7/util/bit53.lua 1970-01-01 01:00:00.000000000 +0100 ++++ prosody-0.11.7/util/bit53.lua.lua54 2020-10-08 22:31:55.998715572 +0200 +@@ -0,0 +1,7 @@ ++-- Only the operators needed by net.websocket.frames are provided at this point ++return { ++ band = function (a, b) return a & b end; ++ bor = function (a, b) return a | b end; ++ bxor = function (a, b) return a ~ b end; ++}; ++ +--- prosody-0.11.7/util/bitcompat.lua 1970-01-01 01:00:00.000000000 +0100 ++++ prosody-0.11.7/util/bitcompat.lua.lua54 2020-10-08 22:31:55.998715572 +0200 +@@ -0,0 +1,32 @@ ++-- Compatibility layer for bitwise operations ++ ++-- First try the bit32 lib ++-- Lua 5.3 has it with compat enabled ++-- Lua 5.2 has it by default ++if _G.bit32 then ++ return _G.bit32; ++else ++ -- Lua 5.1 may have it as a standalone module that can be installed ++ local ok, bitop = pcall(require, "bit32") ++ if ok then ++ return bitop; ++ end ++end ++ ++do ++ -- Lua 5.3 and 5.4 would be able to use native infix operators ++ local ok, bitop = pcall(require, "util.bit53") ++ if ok then ++ return bitop; ++ end ++end ++ ++do ++ -- Lastly, try the LuaJIT bitop library ++ local ok, bitop = pcall(require, "bit") ++ if ok then ++ return bitop; ++ end ++end ++ ++error "No bit module found. See https://prosody.im/doc/depends#bitop"; +--- prosody-0.11.7/util/dependencies.lua 2020-05-31 22:39:34.000000000 +0200 ++++ prosody-0.11.7/util/dependencies.lua.lua54 2020-10-08 22:32:01.423752075 +0200 +@@ -90,7 +90,7 @@ + }, "SSL/TLS support will not be available"); + end + +- local bit = _G.bit32 or softreq"bit"; ++ local bit = softreq"util.bitcompat"; + + if not bit then + missingdep("lua-bitops", { diff --git a/prosody.spec b/prosody.spec index de654de..11ff9d5 100644 --- a/prosody.spec +++ b/prosody.spec @@ -6,7 +6,7 @@ Summary: Flexible communications server for Jabber/XMPP Name: prosody Version: 0.11.7 -Release: 1%{?dist} +Release: 2%{?dist} License: MIT URL: https://prosody.im/ Source0: https://prosody.im/downloads/source/%{name}-%{version}.tar.gz @@ -43,7 +43,7 @@ Requires: lua(abi) = %{lua_version} Requires: lua >= %{lua_version} %endif Requires: lua-filesystem, lua-expat, lua-socket, lua-sec -%if 0%{?rhel} >= 6 && 0%{?rhel} <= 7 +%if 0%{?rhel} == 6 || 0%{?rhel} == 7 Requires: lua-bitop %endif BuildRequires: lua, lua-devel @@ -206,6 +206,9 @@ fi %{_mandir}/man1/%{name}*.1* %changelog +* Thu Oct 08 2020 Robert Scheck 0.11.7-2 +- Added upstream patches for better Lua 5.4 support (#1886456) + * Thu Oct 01 2020 Robert Scheck 0.11.7-1 - Upgrade to 0.11.7 (#1877424)