summary refs log tree commit diff
path: root/pkgs/tools/filesystems/zkfuse/default.nix
blob: 14938113a1e0e2f0a37b87356611f502131587ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ stdenv
, lib
, autoreconfHook
, gnused
, boost
, fuse
, log4cxx
, zookeeper
, zookeeper_mt
}:

stdenv.mkDerivation rec {
  pname = "zkfuse";
  inherit (zookeeper_mt) version src;

  sourceRoot = "apache-${zookeeper.pname}-${version}/zookeeper-contrib/zookeeper-contrib-zkfuse";

  nativeBuildInputs = [ autoreconfHook gnused ];
  buildInputs = [ zookeeper_mt log4cxx boost fuse ];

  postPatch = ''
    # Make the async API accessible, and use the proper include path.
    sed -i src/zkadapter.h \
        -e '/"zookeeper\.h"/i#define THREADED' \
        -e 's,"zookeeper\.h",<zookeeper/zookeeper.h>,'
  '';

  # c++17 (gcc-11's default) breaks the build as:
  #   zkadapter.h:616:33: error: ISO C++17 does not allow dynamic exception specifications
  NIX_CFLAGS_COMPILE = [ "-std=c++14" ];

  installPhase = ''
    mkdir -p $out/bin
    cp -v src/zkfuse $out/bin
  '';

  meta = with lib; {
    platforms = platforms.linux;
    maintainers = with maintainers; [ cstrahan ztzg ];
    license = licenses.asl20;
  };
}