pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/security/lua-bcrypt lua-bcrypt: update to 2.2.1



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7c15ffa6453c
branches:  trunk
changeset: 371900:7c15ffa6453c
user:      nia <nia%pkgsrc.org@localhost>
date:      Sun Jan 16 13:41:13 2022 +0000

description:
lua-bcrypt: update to 2.2.1

Contains various cleanups.

diffstat:

 security/lua-bcrypt/Makefile                      |  21 ++++++++----
 security/lua-bcrypt/distinfo                      |   9 +++--
 security/lua-bcrypt/files/Makefile                |  15 +++++++++
 security/lua-bcrypt/patches/patch-src_ggentropy.c |  37 +++++++++++++++++++++++
 4 files changed, 70 insertions(+), 12 deletions(-)

diffs (117 lines):

diff -r 184ea6d98510 -r 7c15ffa6453c security/lua-bcrypt/Makefile
--- a/security/lua-bcrypt/Makefile      Sun Jan 16 13:27:03 2022 +0000
+++ b/security/lua-bcrypt/Makefile      Sun Jan 16 13:41:13 2022 +0000
@@ -1,11 +1,11 @@
-# $NetBSD: Makefile,v 1.3 2020/07/14 11:45:23 nia Exp $
+# $NetBSD: Makefile,v 1.4 2022/01/16 13:41:13 nia Exp $
 
-DISTNAME=      lua-bcrypt-2.1.6
-PKGNAME=       ${DISTNAME:S/lua-/${LUA_PKGPREFIX}-/1}
+DISTNAME=      lua-bcrypt-2.2-1
+PKGNAME=       ${DISTNAME:S/lua-/${LUA_PKGPREFIX}-/1:S/-1/.1/g}
 CATEGORIES=    security lua
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=mikejsavage/}
 GITHUB_PROJECT=        lua-bcrypt
-GITHUB_TAG=    v2.1-6
+GITHUB_TAG=    v2.2-1
 
 MAINTAINER=    nia%NetBSD.org@localhost
 HOMEPAGE=      https://github.com/mikejsavage/lua-bcrypt
@@ -14,14 +14,19 @@
 
 USE_TOOLS+=    gmake
 
-CFLAGS.SunOS+= -Du_int8_t=uint8_t
-CFLAGS.SunOS+= -Du_int16_t=uint16_t
-CFLAGS.SunOS+= -Du_int32_t=uint32_t
+BUILD_DIRS+=   src
 
 INSTALLATION_DIRS+=    ${LUA_CDIR}
 
+pre-build:
+       ${CP} -f ${FILESDIR}/Makefile ${WRKSRC}/src/Makefile
+
 do-install:
-       ${INSTALL_LIB} ${WRKSRC}/bcrypt.so ${DESTDIR}${PREFIX}/${LUA_CDIR}
+       ${INSTALL_LIB} ${WRKSRC}/src/bcrypt.so ${DESTDIR}${PREFIX}/${LUA_CDIR}
+
+do-test:
+       cd ${WRKSRC}/src && \
+           ${LUA_INTERPRETER} ${WRKSRC}/test-digest.lua
 
 .include "../../lang/lua/module.mk"
 .include "../../mk/bsd.prefs.mk"
diff -r 184ea6d98510 -r 7c15ffa6453c security/lua-bcrypt/distinfo
--- a/security/lua-bcrypt/distinfo      Sun Jan 16 13:27:03 2022 +0000
+++ b/security/lua-bcrypt/distinfo      Sun Jan 16 13:41:13 2022 +0000
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.5 2021/10/26 11:17:18 nia Exp $
+$NetBSD: distinfo,v 1.6 2022/01/16 13:41:13 nia Exp $
 
-BLAKE2s (lua-bcrypt-2.1.6.tar.gz) = ae26f73b1681ec469ef3b0e9c95a3359dd5aab31427ebbc1819871854e334d44
-SHA512 (lua-bcrypt-2.1.6.tar.gz) = d2b4077e5c0e9fbdbd2c7d9f1bed6c99537198ead52079b56c1e4f1d9af151551458f0515e51729d187ff9de9190ff75aaac8fce08a67558215be6fb0c3619fc
-Size (lua-bcrypt-2.1.6.tar.gz) = 35882 bytes
+BLAKE2s (lua-bcrypt-2.2-1.tar.gz) = a69df3c11f0fcc3ae098664b2ea0d3509b5edbd84e670af3d33340a18ab8af93
+SHA512 (lua-bcrypt-2.2-1.tar.gz) = 58e8c9624770b0b4f6a7a3dc872920c0fb04ecc4e3eca5ca9062266b2908b6d85d40498f5026c2624ad106c19ecbf51c7313d81d47fd2b08803503e98f6ce598
+Size (lua-bcrypt-2.2-1.tar.gz) = 17265 bytes
+SHA1 (patch-src_ggentropy.c) = e79117f2e9644b1136f70e3c545b1e41f6cbcca2
diff -r 184ea6d98510 -r 7c15ffa6453c security/lua-bcrypt/files/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/lua-bcrypt/files/Makefile        Sun Jan 16 13:41:13 2022 +0000
@@ -0,0 +1,15 @@
+# $NetBSD: Makefile,v 1.1 2022/01/16 13:41:13 nia Exp $
+
+OBJS+= main.o
+OBJS+= bcrypt.o
+OBJS+= blowfish.o
+OBJS+= ggentropy.o
+OBJS+= safebfuns.o
+
+all: bcrypt.so
+
+.c.o:
+       $(CC) $(CFLAGS) -fPIC -c $<
+
+bcrypt.so: $(OBJS)
+       $(CC) $(LDFLAGS) -shared -o $@ $(OBJS)
diff -r 184ea6d98510 -r 7c15ffa6453c security/lua-bcrypt/patches/patch-src_ggentropy.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/security/lua-bcrypt/patches/patch-src_ggentropy.c Sun Jan 16 13:41:13 2022 +0000
@@ -0,0 +1,37 @@
+$NetBSD: patch-src_ggentropy.c,v 1.1 2022/01/16 13:41:13 nia Exp $
+
+Add portable path for SunOS.
+https://github.com/mikejsavage/lua-bcrypt/pull/18
+
+--- src/ggentropy.c.orig       2021-12-22 18:57:54.000000000 +0000
++++ src/ggentropy.c
+@@ -27,9 +27,6 @@
+ 
+ #elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ )
+ #  define PLATFORM_HAS_ARC4RANDOM 1
+-
+-#else
+-#  error new platform
+ #endif
+ 
+ #include <stdbool.h>
+@@ -71,5 +68,18 @@ bool ggentropy( void * buf, size_t n ) {
+ }
+ 
+ #else
+-#error new platform
++
++#include <fcntl.h>
++#include <unistd.h>
++
++bool ggentropy( void * buf, size_t n ) {
++      int fd = open("/dev/urandom", O_RDONLY);
++
++      if (fd != -1) {
++              int ret = read(fd, buf, n);
++              close(fd);
++              return ret == n;
++      }
++      return false;
++}
+ #endif



Home | Main Index | Thread Index | Old Index