From a429badcc86601a41a4b2e43ce983ab6f44da75d Mon Sep 17 00:00:00 2001
From: Damien Diederen
Date: Wed, 25 Nov 2020 10:33:26 +0100
Subject: [PATCH] perlPackages.NetZooKeeper: adapt to zookeeper_mt 3.6.2
---
nixos/tests/zookeeper.nix | 16 ++++++++++++++--
pkgs/top-level/perl-packages.nix | 25 +++++++++++++++++++------
2 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/nixos/tests/zookeeper.nix b/nixos/tests/zookeeper.nix
index 42cf20b39c5..2bcf5ff0faa 100644
--- a/nixos/tests/zookeeper.nix
+++ b/nixos/tests/zookeeper.nix
@@ -1,7 +1,12 @@
-import ./make-test-python.nix ({ pkgs, ...} : {
+import ./make-test-python.nix ({ pkgs, ...} :
+let
+
+ perlEnv = pkgs.perl.withPackages (p: [p.NetZooKeeper]);
+
+in {
name = "zookeeper";
meta = with pkgs.stdenv.lib.maintainers; {
- maintainers = [ nequissimus ];
+ maintainers = [ nequissimus ztzg ];
};
nodes = {
@@ -30,5 +35,12 @@ import ./make-test-python.nix ({ pkgs, ...} : {
server.wait_until_succeeds(
"${pkgs.zookeeper}/bin/zkCli.sh -server localhost:2181 get /foo | grep hello"
)
+
+ server.wait_until_succeeds(
+ "${perlEnv}/bin/perl -E 'use Net::ZooKeeper qw(:acls); $z=Net::ZooKeeper->new(q(localhost:2181)); $z->create(qw(/perl foo acl), ZOO_OPEN_ACL_UNSAFE) || die $z->get_error()'"
+ )
+ server.wait_until_succeeds(
+ "${perlEnv}/bin/perl -E 'use Net::ZooKeeper qw(:acls); $z=Net::ZooKeeper->new(q(localhost:2181)); $z->get(qw(/perl)) eq qw(foo) || die $z->get_error()'"
+ )
'';
})
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index bdcece18adc..2475b1ab6be 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -15752,18 +15752,31 @@ let
NetZooKeeper = buildPerlPackage {
pname = "Net-ZooKeeper";
- version = "0.41";
- src = fetchurl {
- url = "mirror://cpan/authors/id/M/MA/MAF/Net-ZooKeeper-0.41.tar.gz";
- sha256 = "91c177f30f82302eaf3173356eef05c21bc82163df752acb469177bd14a72db9";
+ version = "0.42pre";
+ src = fetchFromGitHub {
+ owner = "mark-5";
+ repo = "p5-net-zookeeper";
+ rev = "66e1a360aff9c39af728c36092b540a4b6045f70";
+ sha256 = "0xl8lcv9gfv0nn8vrrxa4az359whqdhmzw4r51nn3add8pn3s9ip";
};
buildInputs = [ pkgs.zookeeper_mt ];
+ nativeBuildInputs = [ pkgs.gnused ];
# fix "error: format not a string literal and no format arguments [-Werror=format-security]"
hardeningDisable = [ "format" ];
- NIX_CFLAGS_COMPILE = "-I${pkgs.zookeeper_mt}/include";
+ # Make the async API accessible
+ NIX_CFLAGS_COMPILE = "-DTHREADED";
NIX_CFLAGS_LINK = "-L${pkgs.zookeeper_mt.out}/lib -lzookeeper_mt";
+ # Most tests are skipped as no server is available in the sandbox.
+ # `t/35_log.t` seems to suffer from a race condition; remove it. See
+ # https://github.com/NixOS/nixpkgs/pull/104889#issuecomment-737144513
+ preCheck = ''
+ rm t/35_log.t
+ '' + stdenv.lib.optionalString stdenv.isDarwin ''
+ rm t/30_connect.t
+ rm t/45_class.t
+ '';
meta = {
- maintainers = [ maintainers.limeytexan ];
+ maintainers = with maintainers; [ limeytexan ztzg ];
homepage = "https://github.com/mark-5/p5-net-zookeeper";
license = stdenv.lib.licenses.asl20;
};