From 6607168687f2f9fcfc8d18cae049f8a3c78a85d6 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Tue, 30 Jun 2020 12:34:59 -0400 Subject: [PATCH] fix for lua 5.4 --- lua-ldap.spec | 8 +++++++- lualdap-1.1.0-lua54.patch | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 lualdap-1.1.0-lua54.patch diff --git a/lua-ldap.spec b/lua-ldap.spec index 657768a..b1a276e 100644 --- a/lua-ldap.spec +++ b/lua-ldap.spec @@ -21,7 +21,7 @@ Name: lua-ldap Version: 1.1.0 -Release: 16%{?dist} +Release: 17%{?dist} Summary: LDAP client library for Lua, using OpenLDAP License: MIT URL: http://www.keplerproject.org/lualdap/ @@ -36,6 +36,8 @@ Patch2: fix-attempt-to-concatenate-a-nil-value.patch # https://github.com/luaforge/lualdap/pull/2 Patch3: 0001-update-test.lua-for-5.2.patch Patch4: 0002-script-to-run-test.lua-against-a-dummy-slapd.patch +# Fixup for Lua 5.4 +Patch5: lualdap-1.1.0-lua54.patch %if 0%{?fedora} >= 16 || 0%{?rhel} >= 7 Requires: lua(abi) = %{luaver} %else @@ -76,6 +78,7 @@ program to: %patch2 -p1 %patch3 -p2 %patch4 -p2 +%patch5 -p1 chmod a+x tests/run-tests.sh # LUA_VERSION_NUM is defined in lua.h, it shouldn't be set in config echo "LUA_VERSION_NUM = " >>config @@ -124,6 +127,9 @@ popd %endif %changelog +* Tue Jun 30 2020 Tom Callaway - 1.1.0-17 +- fix for lua 5.4 + * Tue Jun 30 2020 Björn Esser - 1.1.0-16 - Rebuilt for Lua 5.4 diff --git a/lualdap-1.1.0-lua54.patch b/lualdap-1.1.0-lua54.patch new file mode 100644 index 0000000..def3f71 --- /dev/null +++ b/lualdap-1.1.0-lua54.patch @@ -0,0 +1,34 @@ +diff -up lualdap-1.1.0/src/lualdap.c.lua54 lualdap-1.1.0/src/lualdap.c +--- lualdap-1.1.0/src/lualdap.c.lua54 2020-06-30 12:11:15.121638941 -0400 ++++ lualdap-1.1.0/src/lualdap.c 2020-06-30 12:10:53.802986642 -0400 +@@ -31,6 +31,18 @@ + #define luaL_getn(L,i) ((int)lua_objlen(L, i)) + #endif + ++#ifndef luaL_openlib ++#define luaL_openlib(L,n,l,nup) luaL_setfuncs((L),(l),(nup)) ++#endif ++ ++#ifndef lua_objlen ++#define lua_objlen lua_rawlen ++#endif ++ ++#ifndef lua_strlen ++#define lua_strlen lua_rawlen ++#endif ++ + #ifdef WINLDAPAPI + #define timeval l_timeval + typedef ULONG ldap_int_t; +diff -up lualdap-1.1.0/tests/test.lua.lua54 lualdap-1.1.0/tests/test.lua +--- lualdap-1.1.0/tests/test.lua.lua54 2020-06-30 12:32:41.719651337 -0400 ++++ lualdap-1.1.0/tests/test.lua 2020-06-30 12:32:58.663374792 -0400 +@@ -387,7 +387,7 @@ BASE = arg[2] + WHO = arg[3] + PASSWORD = arg[4] + +-require"lualdap" ++lualdap = require "lualdap" + assert (type(lualdap)=="table", "couldn't load LDAP library") + + for i = 1, #tests do