Fix bit32 patch

More lua 5.4 fixes
This commit is contained in:
Orion Poplawski 2020-07-03 16:31:06 -06:00
parent ab21b8d142
commit bf5b350a32
4 changed files with 56 additions and 21 deletions

View File

@ -1,12 +0,0 @@
diff -up luaposix-release-v34.1.1/ext/include/_helpers.c.54 luaposix-release-v34.1.1/ext/include/_helpers.c
--- luaposix-release-v34.1.1/ext/include/_helpers.c.54 2020-07-03 11:48:23.799667686 -0600
+++ luaposix-release-v34.1.1/ext/include/_helpers.c 2020-07-03 11:49:11.907158779 -0600
@@ -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
#endif

View File

@ -1,6 +1,18 @@
diff -up luaposix-release-v34.1.1/lib/posix/_base.lua.pbit32 luaposix-release-v34.1.1/lib/posix/_base.lua
--- luaposix-release-v34.1.1/lib/posix/_base.lua.pbit32 2019-07-28 19:52:15.000000000 -0600
+++ luaposix-release-v34.1.1/lib/posix/_base.lua 2020-07-03 15:47:57.208581988 -0600
@@ -26,7 +26,7 @@ local _ENV = require 'posix._strict' {
S_IXOTH = require 'posix.sys.stat'.S_IXOTH,
S_ISUID = require 'posix.sys.stat'.S_ISUID,
S_ISGID = require 'posix.sys.stat'.S_ISGID,
- band = require 'bit32'.band,
+ band = require 'posix.bit32'.band,
concat = table.concat,
error = error,
format = string.format,
diff -up luaposix-release-v34.1.1/lib/posix/compat.lua.pbit32 luaposix-release-v34.1.1/lib/posix/compat.lua
--- luaposix-release-v34.1.1/lib/posix/compat.lua.pbit32 2020-07-03 11:44:29.279360146 -0600
+++ luaposix-release-v34.1.1/lib/posix/compat.lua 2020-07-03 11:46:56.268014630 -0600
--- luaposix-release-v34.1.1/lib/posix/compat.lua.pbit32 2019-07-28 19:52:15.000000000 -0600
+++ luaposix-release-v34.1.1/lib/posix/compat.lua 2020-07-03 12:20:26.753414331 -0600
@@ -34,9 +34,9 @@ local S_IXUSR = require 'posix.sys.stat'
local argerror = require 'posix._base'.argerror
local argscheck = require 'posix._base'.argscheck
@ -15,8 +27,8 @@ diff -up luaposix-release-v34.1.1/lib/posix/compat.lua.pbit32 luaposix-release-v
local gsub = string.gsub
local match = string.match
diff -up luaposix-release-v34.1.1/lib/posix/deprecated.lua.pbit32 luaposix-release-v34.1.1/lib/posix/deprecated.lua
--- luaposix-release-v34.1.1/lib/posix/deprecated.lua.pbit32 2020-07-03 11:44:29.281360122 -0600
+++ luaposix-release-v34.1.1/lib/posix/deprecated.lua 2020-07-03 11:47:43.726321553 -0600
--- luaposix-release-v34.1.1/lib/posix/deprecated.lua.pbit32 2019-07-28 19:52:15.000000000 -0600
+++ luaposix-release-v34.1.1/lib/posix/deprecated.lua 2020-07-03 12:20:26.754414341 -0600
@@ -59,7 +59,7 @@ local _ENV = require 'posix._strict' {
argerror = require 'posix._base'.argerror,
argscheck = require 'posix._base'.argscheck,
@ -27,8 +39,8 @@ diff -up luaposix-release-v34.1.1/lib/posix/deprecated.lua.pbit32 luaposix-relea
clock_gettime = require 'posix.time'.clock_gettime or false,
connect = require 'posix.sys.socket'.connect,
diff -up luaposix-release-v34.1.1/lib/posix/init.lua.pbit32 luaposix-release-v34.1.1/lib/posix/init.lua
--- luaposix-release-v34.1.1/lib/posix/init.lua.pbit32 2020-07-03 11:44:29.282360110 -0600
+++ luaposix-release-v34.1.1/lib/posix/init.lua 2020-07-03 11:47:26.787212000 -0600
--- luaposix-release-v34.1.1/lib/posix/init.lua.pbit32 2019-07-28 19:52:15.000000000 -0600
+++ luaposix-release-v34.1.1/lib/posix/init.lua 2020-07-03 12:20:26.754414341 -0600
@@ -29,7 +29,7 @@ local _ENV = require 'posix._strict' {
access = require 'posix.unistd'.access,
argscheck = require 'posix._base'.argscheck,

30
lua-posix-lua-5.4.patch Normal file
View File

@ -0,0 +1,30 @@
diff -up luaposix-release-v34.1.1/ext/include/_helpers.c.54 luaposix-release-v34.1.1/ext/include/_helpers.c
--- luaposix-release-v34.1.1/ext/include/_helpers.c.54 2019-07-28 19:52:15.000000000 -0600
+++ luaposix-release-v34.1.1/ext/include/_helpers.c 2020-07-03 15:52:36.736850636 -0600
@@ -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
#endif
diff -up luaposix-release-v34.1.1/lib/posix/init.lua.54 luaposix-release-v34.1.1/lib/posix/init.lua
--- luaposix-release-v34.1.1/lib/posix/init.lua.54 2020-07-03 15:52:36.731850626 -0600
+++ luaposix-release-v34.1.1/lib/posix/init.lua 2020-07-03 16:27:29.414853510 -0600
@@ -327,10 +327,12 @@ do
end
-- Inject deprecated APIs (overwriting submodules) for backwards compatibility.
- for k, v in next, require 'posix.deprecated' do
+ local funcs = require 'posix.deprecated'
+ for k, v in next, funcs do
M[k] = v
end
- for k, v in next, require 'posix.compat' do
+ funcs = require 'posix.compat'
+ for k, v in next, funcs do
M[k] = v
end
end

View File

@ -6,7 +6,7 @@
Name: lua-posix
Version: 34.1.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A POSIX library for Lua
License: MIT
URL: http://luaforge.net/projects/luaposix/
@ -18,7 +18,8 @@ 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
# Other fixes for lua 5.4
Patch1: lua-posix-lua-5.4.patch
BuildRequires: gcc
BuildRequires: lua-devel
%{?lua_requires}
@ -38,7 +39,7 @@ build-aux/luke CFLAGS="%build_cflags"
%install
build-aux/luke PREFIX=%{buildroot}%{_prefix} install
cp -a %{SOURCE1} %{buildroot}%{lua_pkgdir}/posix/
install -pm0644 %{SOURCE1} %{buildroot}%{lua_pkgdir}/posix/
# Fix install location
# https://github.com/luaposix/luaposix/issues/331
%if "%_lib" != "lib"
@ -58,6 +59,10 @@ mv %{buildroot}%{_prefix}/lib %{buildroot}%{_prefix}/%{_lib}
%changelog
* Fri Jul 03 2020 Orion Poplawski <orion@nwra.com> - 34.1.1-2
- Fix bit32 patch
- More lua 5.4 fixes
* Fri Jul 03 2020 Orion Poplawski <orion@nwra.com> - 34.1.1-1
- Update to 34.1.1 (bz#1849450)