about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific/linux/vdo/default.nix
blob: d9033e65876bd8bbb1e8d5b2c76af1985c07c389 (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{ lib, stdenv
, fetchFromGitHub
, installShellFiles
, libuuid
, lvm2_dmeventd  # <libdevmapper-event.h>
, zlib
, python3
}:

stdenv.mkDerivation rec {
  pname = "vdo";
  version = "8.2.0.2";  # kvdo uses this!

  src = fetchFromGitHub {
    owner = "dm-vdo";
    repo = pname;
    rev = version;
    hash = "sha256-IP/nL4jQ+rIWuUxXUiBtlIKTMZCNelvxgTfTcaB1it0=";
  };

  nativeBuildInputs = [
    installShellFiles
  ];

  buildInputs = [
    libuuid
    lvm2_dmeventd
    zlib
    python3.pkgs.wrapPython
  ];

  propagatedBuildInputs = with python3.pkgs; [
    pyyaml
  ];

  pythonPath = propagatedBuildInputs;

  makeFlags = [
    "DESTDIR=${placeholder "out"}"
    "INSTALLOWNER="
    # all of these paths are relative to DESTDIR and have defaults that don't work for us
    "bindir=/bin"
    "defaultdocdir=/share/doc"
    "mandir=/share/man"
    "python3_sitelib=${python3.sitePackages}"
  ];

  enableParallelBuilding = true;

  postInstall = ''
    installShellCompletion --bash $out/bash_completion.d/*
    rm -r $out/bash_completion.d

    wrapPythonPrograms
  '';

  meta = with lib; {
    homepage = "https://github.com/dm-vdo/vdo";
    description = "A set of userspace tools for managing pools of deduplicated and/or compressed block storage";
    platforms = platforms.linux;
    license = with licenses; [ gpl2Plus ];
    maintainers = with maintainers; [ ajs124 ];
  };
}