about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/vdo/default.nix
diff options
context:
space:
mode:
authorsternenseemann <sternenseemann@systemli.org>2022-04-05 21:21:42 +0200
committersternenseemann <sternenseemann@systemli.org>2022-04-05 21:21:42 +0200
commitfb2fc3b4a4fc71d53e89c661428ca59abce1706c (patch)
tree847cb4ba60c7a1592458afa229a838595a3a1a20 /pkgs/os-specific/linux/vdo/default.nix
parenta964dcad739fe70ed5e01646594aafdfb2be4560 (diff)
parentbef07673d323a9c489a664ba7dee3dd10468a293 (diff)
Merge remote-tracking branch 'origin/master' into haskell-updates
Diffstat (limited to 'pkgs/os-specific/linux/vdo/default.nix')
-rw-r--r--pkgs/os-specific/linux/vdo/default.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/vdo/default.nix b/pkgs/os-specific/linux/vdo/default.nix
new file mode 100644
index 0000000000000..1904445d4c2c5
--- /dev/null
+++ b/pkgs/os-specific/linux/vdo/default.nix
@@ -0,0 +1,64 @@
+{ lib, stdenv
+, fetchFromGitHub
+, installShellFiles
+, libuuid
+, lvm2_dmeventd  # <libdevmapper-event.h>
+, zlib
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "vdo";
+  version = "8.1.1.360";  # kvdo uses this!
+
+  src = fetchFromGitHub {
+    owner = "dm-vdo";
+    repo = pname;
+    rev = version;
+    sha256 = "1zp8aaw0diramnlx5z96jcpbm6x0r204xf1vwq6k21rzcazczkwv";
+  };
+
+  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 ];
+  };
+}