From 232e0386cdc73d7c2eecc3b6b2aa97a971c9c7d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9-Patrick=20Bubel?= <code@apb.name>
Date: Sun, 15 Apr 2018 23:54:00 +0200
Subject: [PATCH 1/2] borgbackup: add blake2 library to build inputs

---
 pkgs/tools/backup/borg/default.nix | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pkgs/tools/backup/borg/default.nix b/pkgs/tools/backup/borg/default.nix
index 77d7626a526a..43dcc5dfd7bf 100644
--- a/pkgs/tools/backup/borg/default.nix
+++ b/pkgs/tools/backup/borg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, python3Packages, acl, lz4, openssl, openssh }:
+{ stdenv, python3Packages, acl, libb2, lz4, openssl, openssh }:
 
 python3Packages.buildPythonApplication rec {
   pname = "borgbackup";
@@ -19,7 +19,7 @@ python3Packages.buildPythonApplication rec {
     sphinx guzzle_sphinx_theme
   ];
   buildInputs = [
-    lz4 openssl python3Packages.setuptools_scm
+    libb2 lz4 openssl python3Packages.setuptools_scm
   ] ++ stdenv.lib.optionals stdenv.isLinux [ acl ];
   propagatedBuildInputs = with python3Packages; [
     cython msgpack-python
@@ -28,6 +28,7 @@ python3Packages.buildPythonApplication rec {
   preConfigure = ''
     export BORG_OPENSSL_PREFIX="${openssl.dev}"
     export BORG_LZ4_PREFIX="${lz4.dev}"
+    export BORG_LIBB2_PREFIX="${libb2}"
   '';
 
   makeWrapperArgs = [

From 406749c82cb8e4e243caa122425004631426c778 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert=20Sch=C3=BCtz?=
 <robert.schuetz@stud.uni-heidelberg.de>
Date: Mon, 16 Apr 2018 08:32:28 +0200
Subject: [PATCH 2/2] borgbackup: use system zstd

---
 pkgs/tools/backup/borg/default.nix | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pkgs/tools/backup/borg/default.nix b/pkgs/tools/backup/borg/default.nix
index 43dcc5dfd7bf..43f45a1783f5 100644
--- a/pkgs/tools/backup/borg/default.nix
+++ b/pkgs/tools/backup/borg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, python3Packages, acl, libb2, lz4, openssl, openssh }:
+{ stdenv, python3Packages, acl, libb2, lz4, zstd, openssl, openssh }:
 
 python3Packages.buildPythonApplication rec {
   pname = "borgbackup";
@@ -19,7 +19,7 @@ python3Packages.buildPythonApplication rec {
     sphinx guzzle_sphinx_theme
   ];
   buildInputs = [
-    libb2 lz4 openssl python3Packages.setuptools_scm
+    libb2 lz4 zstd openssl python3Packages.setuptools_scm
   ] ++ stdenv.lib.optionals stdenv.isLinux [ acl ];
   propagatedBuildInputs = with python3Packages; [
     cython msgpack-python
@@ -29,6 +29,7 @@ python3Packages.buildPythonApplication rec {
     export BORG_OPENSSL_PREFIX="${openssl.dev}"
     export BORG_LZ4_PREFIX="${lz4.dev}"
     export BORG_LIBB2_PREFIX="${libb2}"
+    export BORG_LIBZSTD_PREFIX="${zstd}"
   '';
 
   makeWrapperArgs = [