2021-07-12 23:38:38 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
acl,
|
|
|
|
e2fsprogs,
|
2024-03-30 00:56:35 +00:00
|
|
|
fetchFromGitHub,
|
2021-07-12 23:38:38 +00:00
|
|
|
libb2,
|
|
|
|
lz4,
|
|
|
|
openssh,
|
|
|
|
openssl,
|
2024-03-30 00:56:35 +00:00
|
|
|
python3,
|
2022-12-25 01:40:25 +00:00
|
|
|
xxHash,
|
2021-07-12 23:38:38 +00:00
|
|
|
zstd,
|
2022-08-23 16:40:08 +00:00
|
|
|
installShellFiles,
|
2021-07-12 23:38:38 +00:00
|
|
|
nixosTests,
|
|
|
|
}:
|
2015-07-21 18:41:13 +00:00
|
|
|
|
2023-12-13 14:35:39 +00:00
|
|
|
let
|
2024-03-30 00:56:35 +00:00
|
|
|
python = python3;
|
2023-12-13 14:35:39 +00:00
|
|
|
in
|
|
|
|
python.pkgs.buildPythonApplication rec {
|
2018-03-31 20:11:31 +00:00
|
|
|
pname = "borgbackup";
|
2024-07-03 11:29:35 +00:00
|
|
|
version = "1.4.0";
|
2024-03-30 00:56:35 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "borgbackup";
|
|
|
|
repo = "borg";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-07-03 11:29:35 +00:00
|
|
|
hash = "sha256-n1hCM7Sp0t2bOJEzErEd1PS/Xc7c+KDmJ4PjQuuF140=";
|
2015-07-21 18:41:13 +00:00
|
|
|
};
|
|
|
|
|
2021-07-12 23:38:38 +00:00
|
|
|
postPatch = ''
|
|
|
|
# sandbox does not support setuid/setgid/sticky bits
|
|
|
|
substituteInPlace src/borg/testsuite/archiver.py \
|
2024-03-30 18:49:14 +00:00
|
|
|
--replace-fail "0o4755" "0o0755"
|
2021-07-12 23:38:38 +00:00
|
|
|
'';
|
|
|
|
|
2024-03-30 18:49:14 +00:00
|
|
|
build-system = with python.pkgs; [
|
2022-05-31 02:07:54 +00:00
|
|
|
cython
|
2021-03-23 11:14:33 +00:00
|
|
|
setuptools-scm
|
2022-12-25 01:40:25 +00:00
|
|
|
pkgconfig
|
2024-03-30 18:49:14 +00:00
|
|
|
];
|
2022-08-23 16:40:08 +00:00
|
|
|
|
2024-03-30 18:49:14 +00:00
|
|
|
nativeBuildInputs = with python.pkgs; [
|
2022-08-23 16:40:08 +00:00
|
|
|
# docs
|
2022-08-23 13:46:52 +00:00
|
|
|
sphinxHook
|
2023-10-16 05:55:46 +00:00
|
|
|
guzzle-sphinx-theme
|
2022-08-23 16:40:08 +00:00
|
|
|
|
|
|
|
# shell completions
|
|
|
|
installShellFiles
|
2016-01-24 03:02:27 +00:00
|
|
|
];
|
2021-07-12 23:38:38 +00:00
|
|
|
|
2022-08-23 13:46:52 +00:00
|
|
|
sphinxBuilders = [
|
|
|
|
"singlehtml"
|
|
|
|
"man"
|
2021-07-12 23:38:38 +00:00
|
|
|
];
|
|
|
|
|
2016-12-31 19:44:47 +00:00
|
|
|
buildInputs =
|
2024-12-10 19:26:33 +00:00
|
|
|
[
|
|
|
|
libb2
|
|
|
|
lz4
|
|
|
|
xxHash
|
|
|
|
zstd
|
|
|
|
openssl
|
|
|
|
]
|
2021-07-12 23:38:38 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
2024-12-10 19:26:33 +00:00
|
|
|
acl
|
|
|
|
];
|
|
|
|
|
2024-03-30 18:49:14 +00:00
|
|
|
dependencies = with python.pkgs; [
|
2022-02-22 22:54:35 +00:00
|
|
|
msgpack
|
2021-07-12 21:40:50 +00:00
|
|
|
packaging
|
2022-05-31 01:26:14 +00:00
|
|
|
(if stdenv.hostPlatform.isLinux then pyfuse3 else llfuse)
|
2020-01-24 19:09:23 +00:00
|
|
|
];
|
2015-07-21 18:41:13 +00:00
|
|
|
|
2017-10-28 12:13:48 +00:00
|
|
|
makeWrapperArgs = [
|
|
|
|
''--prefix PATH ':' "${openssh}/bin"''
|
|
|
|
];
|
|
|
|
|
2016-01-24 03:02:27 +00:00
|
|
|
postInstall = ''
|
2022-08-23 16:40:08 +00:00
|
|
|
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 03:02:27 +00:00
|
|
|
'';
|
|
|
|
|
2023-12-13 14:35:39 +00:00
|
|
|
nativeCheckInputs = with python.pkgs; [
|
2021-07-12 23:38:38 +00:00
|
|
|
e2fsprogs
|
2023-01-03 01:01:33 +00:00
|
|
|
py
|
2021-07-12 23:38:38 +00:00
|
|
|
pytest-benchmark
|
|
|
|
pytest-xdist
|
|
|
|
pytestCheckHook
|
2018-08-12 22:16:34 +00:00
|
|
|
];
|
|
|
|
|
2021-07-12 23:38:38 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"--benchmark-skip"
|
|
|
|
"--pyargs"
|
|
|
|
"borg.testsuite"
|
|
|
|
];
|
2018-08-12 22:16:34 +00:00
|
|
|
|
2021-07-12 23:38:38 +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-02-22 22:54:35 +00:00
|
|
|
"test_migrate_lock_alive"
|
2021-07-12 23:38:38 +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-12 14:29:56 +00:00
|
|
|
# https://github.com/borgbackup/borg/issues/6573
|
|
|
|
"test_basic_functionality"
|
2021-07-12 23:38:38 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TEMP
|
|
|
|
'';
|
2018-08-12 22:16:34 +00:00
|
|
|
|
2021-03-23 11:08:12 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit (nixosTests) borgbackup;
|
|
|
|
};
|
|
|
|
|
2022-08-20 23:10:33 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"doc"
|
|
|
|
"man"
|
|
|
|
];
|
2021-03-29 15:27:24 +00:00
|
|
|
|
2024-07-03 11:29:35 +00:00
|
|
|
disabled = python.pythonOlder "3.9";
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2024-03-30 00:56:35 +00:00
|
|
|
changelog = "https://github.com/borgbackup/borg/blob/${src.rev}/docs/changes.rst";
|
2020-10-16 14:21:36 +00:00
|
|
|
description = "Deduplicating archiver with compression and encryption";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.borgbackup.org";
|
2015-07-21 18:41:13 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.unix; # Darwin and FreeBSD mentioned on homepage
|
2022-06-06 01:30:31 +00:00
|
|
|
mainProgram = "borg";
|
2022-10-15 15:21:24 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
dotlambda
|
|
|
|
globin
|
|
|
|
];
|
2015-07-21 18:41:13 +00:00
|
|
|
};
|
|
|
|
}
|