2021-07-14 22:03:04 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, acl
|
|
|
|
, e2fsprogs
|
|
|
|
, libb2
|
|
|
|
, lz4
|
|
|
|
, openssh
|
|
|
|
, openssl
|
|
|
|
, python3
|
2023-01-11 07:51:40 +00:00
|
|
|
, xxHash
|
2021-07-14 22:03:04 +00:00
|
|
|
, zstd
|
2022-09-09 14:08:57 +00:00
|
|
|
, installShellFiles
|
2021-07-14 22:03:04 +00:00
|
|
|
, nixosTests
|
2023-01-11 07:51:40 +00:00
|
|
|
, fetchpatch
|
2021-07-14 22:03:04 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "borgbackup";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "1.2.3";
|
2022-06-16 17:23:12 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = python3.pkgs.fetchPypi {
|
|
|
|
inherit pname version;
|
2023-01-11 07:51:40 +00:00
|
|
|
hash = "sha256-4yQY+GM8lvqWgTUqVutjuY4pQgNHLBFKUkJwnTaWZ4U=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
# Fix HashIndexSizeTestCase.test_size_on_disk_accurate problems on ZFS,
|
|
|
|
# see https://github.com/borgbackup/borg/issues/7250
|
2023-01-20 10:41:00 +00:00
|
|
|
url = "https://github.com/borgbackup/borg/pull/7252/commits/fe3775cf8078c18d8fe39a7f42e52e96d3ecd054.patch";
|
|
|
|
hash = "sha256-gdssHfhdkmRfSAOeXsq9Afg7xqGM3NLIq4QnzmPBhw4=";
|
2023-01-11 07:51:40 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
postPatch = ''
|
|
|
|
# sandbox does not support setuid/setgid/sticky bits
|
|
|
|
substituteInPlace src/borg/testsuite/archiver.py \
|
|
|
|
--replace "0o4755" "0o0755"
|
|
|
|
'';
|
2021-06-28 23:13:55 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = with python3.pkgs; [
|
2022-06-16 17:23:12 +00:00
|
|
|
cython
|
2021-03-20 04:20:00 +00:00
|
|
|
setuptools-scm
|
2023-01-11 07:51:40 +00:00
|
|
|
pkgconfig
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
# docs
|
|
|
|
sphinxHook
|
2021-07-14 22:03:04 +00:00
|
|
|
guzzle_sphinx_theme
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
# shell completions
|
|
|
|
installShellFiles
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2021-07-14 22:03:04 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
sphinxBuilders = [ "singlehtml" "man" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2021-07-14 22:03:04 +00:00
|
|
|
libb2
|
|
|
|
lz4
|
2023-01-11 07:51:40 +00:00
|
|
|
xxHash
|
2021-07-14 22:03:04 +00:00
|
|
|
zstd
|
|
|
|
openssl
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
acl
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
2022-03-05 16:20:37 +00:00
|
|
|
msgpack
|
2021-07-14 22:03:04 +00:00
|
|
|
packaging
|
2022-06-16 17:23:12 +00:00
|
|
|
(if stdenv.isLinux then pyfuse3 else llfuse)
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
makeWrapperArgs = [
|
|
|
|
''--prefix PATH ':' "${openssh}/bin"''
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2022-09-09 14:08:57 +00:00
|
|
|
installShellCompletion --cmd borg \
|
|
|
|
--bash scripts/shell_completions/bash/borg \
|
|
|
|
--fish scripts/shell_completions/fish/borg.fish \
|
|
|
|
--zsh scripts/shell_completions/zsh/_borg
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = with python3.pkgs; [
|
2021-07-14 22:03:04 +00:00
|
|
|
e2fsprogs
|
2023-01-20 10:41:00 +00:00
|
|
|
py
|
2022-03-05 16:20:37 +00:00
|
|
|
python-dateutil
|
2021-07-14 22:03:04 +00:00
|
|
|
pytest-benchmark
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"--benchmark-skip"
|
|
|
|
"--pyargs" "borg.testsuite"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00: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"
|
2022-03-05 16:20:37 +00:00
|
|
|
"test_migrate_lock_alive"
|
2021-07-14 22:03:04 +00: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"
|
2022-04-27 09:35:20 +00:00
|
|
|
# https://github.com/borgbackup/borg/issues/6573
|
|
|
|
"test_basic_functionality"
|
2021-07-14 22:03:04 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TEMP
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) borgbackup;
|
|
|
|
};
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
outputs = [ "out" "doc" "man" ];
|
2021-04-05 15:23:46 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-16 20:44:37 +00:00
|
|
|
description = "Deduplicating archiver with compression and encryption";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.borgbackup.org";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.unix; # Darwin and FreeBSD mentioned on homepage
|
2022-06-16 17:23:12 +00:00
|
|
|
mainProgram = "borg";
|
2022-10-21 18:38:19 +00:00
|
|
|
maintainers = with maintainers; [ dotlambda globin ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|