Browse Source

fix for lua 5.4

tags/lua-ldap-1.1.0-19
Tom Callaway 8 months ago
parent
commit
6607168687
2 changed files with 41 additions and 1 deletions
  1. +7
    -1
      lua-ldap.spec
  2. +34
    -0
      lualdap-1.1.0-lua54.patch

+ 7
- 1
lua-ldap.spec View File

@ -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 <spot@fedoraproject.org> - 1.1.0-17
- fix for lua 5.4
* Tue Jun 30 2020 Björn Esser <besser82@fedoraproject.org> - 1.1.0-16
- Rebuilt for Lua 5.4


+ 34
- 0
lualdap-1.1.0-lua54.patch View File

@ -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

Loading…
Cancel
Save