summary refs log tree commit diff
path: root/pkgs/tools/filesystems/zkfuse
diff options
context:
space:
mode:
authorCharles Strahan <charles.c.strahan@gmail.com>2015-11-19 19:53:34 -0500
committerCharles Strahan <charles.c.strahan@gmail.com>2015-11-19 19:55:44 -0500
commit3b73b726d4975d821b90fb759b421a70e388e71d (patch)
tree0d0e80342b8d8a3394c43143f504e9eadb7e3817 /pkgs/tools/filesystems/zkfuse
parentca186286d73676c3a80884279d6e4a4e238f9ef4 (diff)
downloadnixpkgs-3b73b726d4975d821b90fb759b421a70e388e71d.tar
nixpkgs-3b73b726d4975d821b90fb759b421a70e388e71d.tar.gz
nixpkgs-3b73b726d4975d821b90fb759b421a70e388e71d.tar.bz2
nixpkgs-3b73b726d4975d821b90fb759b421a70e388e71d.tar.lz
nixpkgs-3b73b726d4975d821b90fb759b421a70e388e71d.tar.xz
nixpkgs-3b73b726d4975d821b90fb759b421a70e388e71d.tar.zst
nixpkgs-3b73b726d4975d821b90fb759b421a70e388e71d.zip
zkfuse: init
Diffstat (limited to 'pkgs/tools/filesystems/zkfuse')
-rw-r--r--pkgs/tools/filesystems/zkfuse/default.nix25
-rw-r--r--pkgs/tools/filesystems/zkfuse/zookeeper-1929.patch15
2 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/tools/filesystems/zkfuse/default.nix b/pkgs/tools/filesystems/zkfuse/default.nix
new file mode 100644
index 00000000000..04755108bc0
--- /dev/null
+++ b/pkgs/tools/filesystems/zkfuse/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, lib, zookeeper, zookeeper_mt, fuse, pkgconfig, autoreconfHook, log4cxx, boost, tree }:
+
+stdenv.mkDerivation rec {
+  name = "zkfuse";
+
+  src = zookeeper.src;
+  patches = [
+    # see: https://issues.apache.org/jira/browse/ZOOKEEPER-1929
+    ./zookeeper-1929.patch
+  ];
+
+  setSourceRoot = "export sourceRoot=${zookeeper.name}/src/contrib/zkfuse";
+
+  buildInputs = [ autoreconfHook zookeeper_mt log4cxx boost fuse ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -v src/zkfuse $out/bin
+  '';
+
+  meta = with lib; {
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}
diff --git a/pkgs/tools/filesystems/zkfuse/zookeeper-1929.patch b/pkgs/tools/filesystems/zkfuse/zookeeper-1929.patch
new file mode 100644
index 00000000000..e99dbdf33e0
--- /dev/null
+++ b/pkgs/tools/filesystems/zkfuse/zookeeper-1929.patch
@@ -0,0 +1,15 @@
+diff --git a/src/contrib/zkfuse/src/zkadapter.cc b/src/contrib/zkfuse/src/zkadapter.cc
+index 886051d..93dbef5 100644
+--- a/src/zkadapter.cc
++++ b/src/zkadapter.cc
+@@ -845,7 +845,10 @@ ZooKeeperAdapter::getNodeData(const string &path,
+             string("Unable to get data of node ") + path, rc 
+         );
+     } else {
+-        return string( buffer, buffer + len );
++        if (len == -1) {
++            len = 0;
++        };
++        return string( buffer, len );
+     }
+ }