hack this ancient beastie to work with lua 5.4, maintainer, please update this to the current upstream release at your earliest convenience
This commit is contained in:
parent
d26cf6065b
commit
54024c2ba9
54
bit32.lua
Normal file
54
bit32.lua
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
local bit32 = {}
|
||||||
|
|
||||||
|
function bit32.bnot (a)
|
||||||
|
return ~a & 0xFFFFFFFF
|
||||||
|
end
|
||||||
|
|
||||||
|
function bit32.band (x, y, z, ...)
|
||||||
|
if not z then
|
||||||
|
return ((x or -1) & (y or -1)) & 0xFFFFFFFF
|
||||||
|
else
|
||||||
|
local arg = {...}
|
||||||
|
local res = x & y & z
|
||||||
|
for i = 1, #arg do res = res & arg[i] end
|
||||||
|
return res & 0xFFFFFFFF
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function bit32.bor (x, y, z, ...)
|
||||||
|
if not z then
|
||||||
|
return ((x or 0) | (y or 0)) & 0xFFFFFFFF
|
||||||
|
else
|
||||||
|
local arg = {...}
|
||||||
|
local res = x | y | z
|
||||||
|
for i = 1, #arg do res = res | arg[i] end
|
||||||
|
return res & 0xFFFFFFFF
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return bit32
|
||||||
|
|
||||||
|
--[[
|
||||||
|
*****************************************************************************
|
||||||
|
* Copyright (C) 1994-2016 Lua.org, PUC-Rio.
|
||||||
|
*
|
||||||
|
* Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
* a copy of this software and associated documentation files (the
|
||||||
|
* "Software"), to deal in the Software without restriction, including
|
||||||
|
* without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
* permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
* the following conditions:
|
||||||
|
*
|
||||||
|
* The above copyright notice and this permission notice shall be
|
||||||
|
* included in all copies or substantial portions of the Software.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
*****************************************************************************
|
||||||
|
]]
|
12
lua-posix-helpers-5.4.patch
Normal file
12
lua-posix-helpers-5.4.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -up luaposix-release-v33.3.1/ext/include/_helpers.c.54 luaposix-release-v33.3.1/ext/include/_helpers.c
|
||||||
|
--- luaposix-release-v33.3.1/ext/include/_helpers.c.54 2020-06-29 23:52:30.433291702 -0400
|
||||||
|
+++ luaposix-release-v33.3.1/ext/include/_helpers.c 2020-06-29 23:52:53.714914130 -0400
|
||||||
|
@@ -67,7 +67,7 @@
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#if LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503
|
||||||
|
+#if LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 || LUA_VERSION_NUM == 504
|
||||||
|
# define lua_objlen lua_rawlen
|
||||||
|
# define lua_strlen lua_rawlen
|
||||||
|
# define luaL_openlib(L,n,l,nup) luaL_setfuncs((L),(l),(nup))
|
138
lua-posix-local-bit32.patch
Normal file
138
lua-posix-local-bit32.patch
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
diff -up luaposix-release-v33.3.1/lib/posix/compat.lua.pbit32 luaposix-release-v33.3.1/lib/posix/compat.lua
|
||||||
|
--- luaposix-release-v33.3.1/lib/posix/compat.lua.pbit32 2020-06-30 00:18:20.418176545 -0400
|
||||||
|
+++ luaposix-release-v33.3.1/lib/posix/compat.lua 2020-06-30 00:18:54.540622774 -0400
|
||||||
|
@@ -11,7 +11,7 @@
|
||||||
|
]]
|
||||||
|
|
||||||
|
local _argcheck = require "posix._argcheck"
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
|
||||||
|
local argerror, argtypeerror, badoption =
|
||||||
|
_argcheck.argerror, _argcheck.argtypeerror, _argcheck.badoption
|
||||||
|
@@ -137,7 +137,7 @@ local M = {
|
||||||
|
-- @see chmod(2)
|
||||||
|
-- @usage P.chmod ('bin/dof', '+x')
|
||||||
|
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
local st = require "posix.sys.stat"
|
||||||
|
|
||||||
|
local _chmod, stat = st.chmod, st.stat
|
||||||
|
@@ -179,7 +179,7 @@ end
|
||||||
|
-- @usage
|
||||||
|
-- fd = P.creat ("data", "rw-r-----")
|
||||||
|
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
local fcntl = require "posix.fcntl"
|
||||||
|
local st = require "posix.sys.stat"
|
||||||
|
|
||||||
|
@@ -218,7 +218,7 @@ end
|
||||||
|
-- @treturn[2] string error message
|
||||||
|
-- @treturn[2] int errnum
|
||||||
|
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
local st = require "posix.sys.stat"
|
||||||
|
|
||||||
|
local _mkdir = st.mkdir
|
||||||
|
@@ -248,7 +248,7 @@ end
|
||||||
|
-- @treturn[2] string error message
|
||||||
|
-- @treturn[2] int errnum
|
||||||
|
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
local st = require "posix.sys.stat"
|
||||||
|
|
||||||
|
local _mkfifo = st.mkfifo
|
||||||
|
@@ -281,7 +281,7 @@ end
|
||||||
|
-- @treturn[2] int errnum
|
||||||
|
-- @see msgget(2)
|
||||||
|
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
local msg = require "posix.sys.msg"
|
||||||
|
local st = require "posix.sys.stat"
|
||||||
|
|
||||||
|
@@ -332,7 +332,7 @@ end
|
||||||
|
-- @usage
|
||||||
|
-- fd = P.open ("data", bit.bor (P.O_CREAT, P.O_RDWR), "rw-r-----")
|
||||||
|
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
local fcntl = require "posix.fcntl"
|
||||||
|
|
||||||
|
local _open, O_CREAT = fcntl.open, fcntl.O_CREAT
|
||||||
|
@@ -376,7 +376,7 @@ end
|
||||||
|
-- @treturn[2] string error message
|
||||||
|
-- @treturn[2] int errnum
|
||||||
|
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
local log = require "posix.syslog"
|
||||||
|
|
||||||
|
local bor = bit.bor
|
||||||
|
diff -up luaposix-release-v33.3.1/lib/posix/deprecated.lua.pbit32 luaposix-release-v33.3.1/lib/posix/deprecated.lua
|
||||||
|
--- luaposix-release-v33.3.1/lib/posix/deprecated.lua.pbit32 2020-06-30 00:19:01.594508297 -0400
|
||||||
|
+++ luaposix-release-v33.3.1/lib/posix/deprecated.lua 2020-06-30 00:19:16.466266944 -0400
|
||||||
|
@@ -11,7 +11,7 @@
|
||||||
|
]]
|
||||||
|
|
||||||
|
local _argcheck = require "posix._argcheck"
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
|
||||||
|
-- Lua 5.3 has table.unpack but not _G.unpack
|
||||||
|
-- Lua 5.2 has table.unpack and _G.unpack
|
||||||
|
@@ -748,7 +748,7 @@ end
|
||||||
|
-- `LOG_LOCAL0` through `LOG_LOCAL7`
|
||||||
|
-- @see syslog(3)
|
||||||
|
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
local log = require "posix.syslog"
|
||||||
|
|
||||||
|
local bor = bit.bor
|
||||||
|
diff -up luaposix-release-v33.3.1/lib/posix/init.lua.pbit32 luaposix-release-v33.3.1/lib/posix/init.lua
|
||||||
|
--- luaposix-release-v33.3.1/lib/posix/init.lua.pbit32 2020-06-30 00:17:53.219617951 -0400
|
||||||
|
+++ luaposix-release-v33.3.1/lib/posix/init.lua 2020-06-30 00:18:10.467338039 -0400
|
||||||
|
@@ -14,7 +14,7 @@
|
||||||
|
@module posix
|
||||||
|
]]
|
||||||
|
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -151,7 +151,7 @@ end
|
||||||
|
-- @return[2] nil
|
||||||
|
-- @treturn[2] string error message
|
||||||
|
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
local fcntl = require "posix.fcntl"
|
||||||
|
local stdlib = require "posix.stdlib"
|
||||||
|
local unistd = require "posix.unistd"
|
||||||
|
diff -up luaposix-release-v33.3.1/lib/posix.lua.in.pbit32 luaposix-release-v33.3.1/lib/posix.lua.in
|
||||||
|
--- luaposix-release-v33.3.1/lib/posix.lua.in.pbit32 2020-06-30 00:19:28.732067880 -0400
|
||||||
|
+++ luaposix-release-v33.3.1/lib/posix.lua.in 2020-06-30 00:19:40.803871968 -0400
|
||||||
|
@@ -14,7 +14,7 @@
|
||||||
|
@module posix
|
||||||
|
]]
|
||||||
|
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -151,7 +151,7 @@ end
|
||||||
|
-- @return[2] nil
|
||||||
|
-- @treturn[2] string error message
|
||||||
|
|
||||||
|
-local bit = require "bit32"
|
||||||
|
+local bit = require "posix.bit32"
|
||||||
|
local fcntl = require "posix.fcntl"
|
||||||
|
local stdlib = require "posix.stdlib"
|
||||||
|
local unistd = require "posix.unistd"
|
@ -6,11 +6,19 @@
|
|||||||
|
|
||||||
Name: lua-posix
|
Name: lua-posix
|
||||||
Version: 33.3.1
|
Version: 33.3.1
|
||||||
Release: 16%{?dist}
|
Release: 17%{?dist}
|
||||||
Summary: A POSIX library for Lua
|
Summary: A POSIX library for Lua
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: http://luaforge.net/projects/luaposix/
|
URL: http://luaforge.net/projects/luaposix/
|
||||||
Source0: https://github.com/luaposix/luaposix/archive/release-v%{version}.tar.gz
|
Source0: https://github.com/luaposix/luaposix/archive/release-v%{version}.tar.gz
|
||||||
|
# bit32 is gone in lua 5.4
|
||||||
|
# this file is a hack to add functions that use the lua native bitwise operators
|
||||||
|
# taken from lua-5.4.0-tests/bitwise.lua
|
||||||
|
Source1: bit32.lua
|
||||||
|
# This patch tells lua-posix to use the local bit32
|
||||||
|
Patch0: lua-posix-local-bit32.patch
|
||||||
|
# Use the same tricks that the helpers use for 5.2/5.3
|
||||||
|
Patch1: lua-posix-helpers-5.4.patch
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: lua-devel
|
BuildRequires: lua-devel
|
||||||
BuildRequires: ncurses-devel
|
BuildRequires: ncurses-devel
|
||||||
@ -24,7 +32,11 @@ to Lua programs.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n luaposix-release-v%{version}
|
%setup -q -n luaposix-release-v%{version}
|
||||||
|
%patch0 -p1 -b .pbit32
|
||||||
|
%patch1 -p1 -b .54
|
||||||
|
|
||||||
|
# allow lua 5.4
|
||||||
|
sed -i 's|5.4|5.5|g' configure
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%configure --libdir=%{lua_libdir} --datadir=/%{lua_pkgdir}
|
%configure --libdir=%{lua_libdir} --datadir=/%{lua_pkgdir}
|
||||||
@ -33,7 +45,7 @@ make V=1 %{?_smp_mflags}
|
|||||||
|
|
||||||
%install
|
%install
|
||||||
make install DESTDIR=$RPM_BUILD_ROOT
|
make install DESTDIR=$RPM_BUILD_ROOT
|
||||||
|
cp -a %{SOURCE1} $RPM_BUILD_ROOT%{lua_pkgdir}/posix/
|
||||||
|
|
||||||
%check
|
%check
|
||||||
make V=1 check
|
make V=1 check
|
||||||
@ -49,6 +61,10 @@ make V=1 check
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Jun 29 2020 Tom Callaway <spot@fedoraproject.org> - 33.3.1-17
|
||||||
|
- hack this ancient beastie to work with lua 5.4
|
||||||
|
- maintainer, please update this to the current upstream release at your earliest convenience
|
||||||
|
|
||||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 33.3.1-16
|
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 33.3.1-16
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user