diff options
Diffstat (limited to 'nixpkgs/pkgs/tools/backup/borgbackup/default.nix')
-rw-r--r-- | nixpkgs/pkgs/tools/backup/borgbackup/default.nix | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/nixpkgs/pkgs/tools/backup/borgbackup/default.nix b/nixpkgs/pkgs/tools/backup/borgbackup/default.nix index bce54c747d71..5aaffabd9325 100644 --- a/nixpkgs/pkgs/tools/backup/borgbackup/default.nix +++ b/nixpkgs/pkgs/tools/backup/borgbackup/default.nix @@ -7,20 +7,33 @@ , openssh , openssl , python3 +, xxHash , zstd +, installShellFiles , nixosTests +, fetchpatch +, fetchPypi }: python3.pkgs.buildPythonApplication rec { pname = "borgbackup"; - version = "1.2.1"; + version = "1.2.3"; format = "pyproject"; - src = python3.pkgs.fetchPypi { + src = fetchPypi { inherit pname version; - sha256 = "sha256-n5zi0ZI8szoUfubQgXfYYJdFZ3IbEUL8pnkUoC5kxjM="; + hash = "sha256-4yQY+GM8lvqWgTUqVutjuY4pQgNHLBFKUkJwnTaWZ4U="; }; + patches = [ + (fetchpatch { + # Fix HashIndexSizeTestCase.test_size_on_disk_accurate problems on ZFS, + # see https://github.com/borgbackup/borg/issues/7250 + url = "https://github.com/borgbackup/borg/pull/7252/commits/fe3775cf8078c18d8fe39a7f42e52e96d3ecd054.patch"; + hash = "sha256-gdssHfhdkmRfSAOeXsq9Afg7xqGM3NLIq4QnzmPBhw4="; + }) + ]; + postPatch = '' # sandbox does not support setuid/setgid/sticky bits substituteInPlace src/borg/testsuite/archiver.py \ @@ -30,14 +43,22 @@ python3.pkgs.buildPythonApplication rec { nativeBuildInputs = with python3.pkgs; [ cython setuptools-scm - # For building documentation: - sphinx + pkgconfig + + # docs + sphinxHook guzzle_sphinx_theme + + # shell completions + installShellFiles ]; + sphinxBuilders = [ "singlehtml" "man" ]; + buildInputs = [ libb2 lz4 + xxHash zstd openssl ] ++ lib.optionals stdenv.isLinux [ @@ -50,38 +71,20 @@ python3.pkgs.buildPythonApplication rec { (if stdenv.isLinux then pyfuse3 else llfuse) ]; - preConfigure = '' - export BORG_OPENSSL_PREFIX="${openssl.dev}" - export BORG_LZ4_PREFIX="${lz4.dev}" - export BORG_LIBB2_PREFIX="${libb2}" - export BORG_LIBZSTD_PREFIX="${zstd.dev}" - ''; - makeWrapperArgs = [ ''--prefix PATH ':' "${openssh}/bin"'' ]; postInstall = '' - make -C docs singlehtml - mkdir -p $out/share/doc/borg - cp -R docs/_build/singlehtml $out/share/doc/borg/html - - make -C docs man - mkdir -p $out/share/man - cp -R docs/_build/man $out/share/man/man1 - - mkdir -p $out/share/bash-completion/completions - cp scripts/shell_completions/bash/borg $out/share/bash-completion/completions/ - - mkdir -p $out/share/fish/vendor_completions.d - cp scripts/shell_completions/fish/borg.fish $out/share/fish/vendor_completions.d/ - - mkdir -p $out/share/zsh/site-functions - cp scripts/shell_completions/zsh/_borg $out/share/zsh/site-functions/ + installShellCompletion --cmd borg \ + --bash scripts/shell_completions/bash/borg \ + --fish scripts/shell_completions/fish/borg.fish \ + --zsh scripts/shell_completions/zsh/_borg ''; - checkInputs = with python3.pkgs; [ + nativeCheckInputs = with python3.pkgs; [ e2fsprogs + py python-dateutil pytest-benchmark pytest-xdist @@ -119,7 +122,7 @@ python3.pkgs.buildPythonApplication rec { inherit (nixosTests) borgbackup; }; - outputs = [ "out" "doc" ]; + outputs = [ "out" "doc" "man" ]; meta = with lib; { description = "Deduplicating archiver with compression and encryption"; @@ -127,6 +130,6 @@ python3.pkgs.buildPythonApplication rec { license = licenses.bsd3; platforms = platforms.unix; # Darwin and FreeBSD mentioned on homepage mainProgram = "borg"; - maintainers = with maintainers; [ flokli dotlambda globin ]; + maintainers = with maintainers; [ dotlambda globin ]; }; } |