1{ lib, stdenv
2, fetchFromGitHub
3, installShellFiles
4, libuuid
5, lvm2_dmeventd # <libdevmapper-event.h>
6, zlib
7, python3
8}:
9
10stdenv.mkDerivation rec {
11 pname = "vdo";
12 version = "8.2.0.2"; # kvdo uses this!
13
14 src = fetchFromGitHub {
15 owner = "dm-vdo";
16 repo = pname;
17 rev = version;
18 hash = "sha256-IP/nL4jQ+rIWuUxXUiBtlIKTMZCNelvxgTfTcaB1it0=";
19 };
20
21 nativeBuildInputs = [
22 installShellFiles
23 ];
24
25 buildInputs = [
26 libuuid
27 lvm2_dmeventd
28 zlib
29 python3.pkgs.wrapPython
30 ];
31
32 propagatedBuildInputs = with python3.pkgs; [
33 pyyaml
34 ];
35
36 pythonPath = propagatedBuildInputs;
37
38 makeFlags = [
39 "DESTDIR=${placeholder "out"}"
40 "INSTALLOWNER="
41 # all of these paths are relative to DESTDIR and have defaults that don't work for us
42 "bindir=/bin"
43 "defaultdocdir=/share/doc"
44 "mandir=/share/man"
45 "python3_sitelib=${python3.sitePackages}"
46 ];
47
48 enableParallelBuilding = true;
49
50 postInstall = ''
51 installShellCompletion --bash $out/bash_completion.d/*
52 rm -r $out/bash_completion.d
53
54 wrapPythonPrograms
55 '';
56
57 meta = with lib; {
58 homepage = "https://github.com/dm-vdo/vdo";
59 description = "A set of userspace tools for managing pools of deduplicated and/or compressed block storage";
60 platforms = platforms.linux;
61 license = with licenses; [ gpl2Plus ];
62 maintainers = with maintainers; [ ajs124 ];
63 };
64}