nixpkgs-suyu/pkgs/tools/backup/borgbackup/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

128 lines
2.7 KiB
Nix
Raw Normal View History

2021-07-13 01:38:38 +02:00
{ lib
, stdenv
, acl
, e2fsprogs
, libb2
, lz4
, openssh
, openssl
, python3
, zstd
, installShellFiles
2021-07-13 01:38:38 +02:00
, nixosTests
}:
python3.pkgs.buildPythonApplication rec {
2018-03-31 22:11:31 +02:00
pname = "borgbackup";
version = "1.2.2";
format = "pyproject";
2018-03-31 22:11:31 +02:00
src = python3.pkgs.fetchPypi {
2018-03-31 22:11:31 +02:00
inherit pname version;
sha256 = "sha256-1zBodEPxvrYCsdcrrjYxj2+WVIGPzcUEWFQOxXnlcmA=";
};
2021-07-13 01:38:38 +02:00
postPatch = ''
# sandbox does not support setuid/setgid/sticky bits
substituteInPlace src/borg/testsuite/archiver.py \
--replace "0o4755" "0o0755"
'';
nativeBuildInputs = with python3.pkgs; [
cython
setuptools-scm
# docs
2022-08-23 15:46:52 +02:00
sphinxHook
2021-07-13 01:38:38 +02:00
guzzle_sphinx_theme
# shell completions
installShellFiles
2016-01-24 04:02:27 +01:00
];
2021-07-13 01:38:38 +02:00
2022-08-23 15:46:52 +02:00
sphinxBuilders = [ "singlehtml" "man" ];
buildInputs = [
2021-07-13 01:38:38 +02:00
libb2
lz4
zstd
openssl
] ++ lib.optionals stdenv.isLinux [
acl
];
propagatedBuildInputs = with python3.pkgs; [
msgpack
packaging
(if stdenv.isLinux then pyfuse3 else llfuse)
2020-01-24 20:09:23 +01:00
];
preConfigure = ''
export BORG_OPENSSL_PREFIX="${openssl.dev}"
2016-09-09 17:24:00 +02:00
export BORG_LZ4_PREFIX="${lz4.dev}"
export BORG_LIBB2_PREFIX="${libb2}"
export BORG_LIBZSTD_PREFIX="${zstd.dev}"
'';
makeWrapperArgs = [
''--prefix PATH ':' "${openssh}/bin"''
];
2016-01-24 04:02:27 +01:00
postInstall = ''
installShellCompletion --cmd borg \
--bash scripts/shell_completions/bash/borg \
--fish scripts/shell_completions/fish/borg.fish \
--zsh scripts/shell_completions/zsh/_borg
2016-01-24 04:02:27 +01:00
'';
checkInputs = with python3.pkgs; [
2021-07-13 01:38:38 +02:00
e2fsprogs
python-dateutil
2021-07-13 01:38:38 +02:00
pytest-benchmark
pytest-xdist
pytestCheckHook
2018-08-13 00:16:34 +02:00
];
2021-07-13 01:38:38 +02:00
pytestFlagsArray = [
"--benchmark-skip"
"--pyargs" "borg.testsuite"
];
2018-08-13 00:16:34 +02:00
2021-07-13 01:38:38 +02:00
disabledTests = [
# fuse: device not found, try 'modprobe fuse' first
"test_fuse"
"test_fuse_allow_damaged_files"
"test_fuse_mount_hardlinks"
"test_fuse_mount_options"
"test_fuse_versions_view"
"test_migrate_lock_alive"
2021-07-13 01:38:38 +02:00
"test_readonly_mount"
# Error: Permission denied while trying to write to /var/{,tmp}
"test_get_cache_dir"
"test_get_keys_dir"
"test_get_security_dir"
"test_get_config_dir"
# https://github.com/borgbackup/borg/issues/6573
"test_basic_functionality"
2021-07-13 01:38:38 +02:00
];
preCheck = ''
export HOME=$TEMP
'';
2018-08-13 00:16:34 +02:00
2021-03-23 12:08:12 +01:00
passthru.tests = {
inherit (nixosTests) borgbackup;
};
outputs = [ "out" "doc" "man" ];
2021-03-29 17:27:24 +02:00
meta = with lib; {
description = "Deduplicating archiver with compression and encryption";
homepage = "https://www.borgbackup.org";
license = licenses.bsd3;
platforms = platforms.unix; # Darwin and FreeBSD mentioned on homepage
2022-06-06 03:30:31 +02:00
mainProgram = "borg";
maintainers = with maintainers; [ dotlambda globin ];
};
}