2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-07-21 07:28:18 +00:00
|
|
|
, fetchFromGitLab
|
2021-07-24 12:14:16 +00:00
|
|
|
, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
, librsync
|
2024-05-15 15:35:15 +00:00
|
|
|
, glib
|
2020-04-24 23:36:52 +00:00
|
|
|
, ncftp
|
|
|
|
, gnupg
|
|
|
|
, gnutar
|
|
|
|
, par2cmdline
|
2020-11-24 20:58:05 +00:00
|
|
|
, util-linux
|
2020-04-24 23:36:52 +00:00
|
|
|
, rsync
|
|
|
|
, makeWrapper
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsNoGuiHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, gettext
|
2024-04-21 15:54:59 +00:00
|
|
|
, getconf
|
|
|
|
, testers
|
|
|
|
, nix-update-script
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
let self = python3.pkgs.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "duplicity";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "3.0.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-21 07:28:18 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "duplicity";
|
|
|
|
repo = "duplicity";
|
|
|
|
rev = "rel.${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-qY6J0t6mgrbEojlKxpVFfsVhffjrAxc8R9Z/Klrp7wE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2024-04-21 15:54:59 +00:00
|
|
|
./keep-pythonpath-in-testing.patch
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs duplicity/__main__.py
|
|
|
|
|
|
|
|
# don't try to use gtar on darwin/bsd
|
|
|
|
substituteInPlace testing/functional/test_restart.py \
|
|
|
|
--replace-fail 'tarcmd = "gtar"' 'tarcmd = "tar"'
|
2024-09-26 11:04:55 +00:00
|
|
|
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2024-04-21 15:54:59 +00:00
|
|
|
# tests try to access these files in the sandbox, but can't deal with EPERM
|
|
|
|
substituteInPlace testing/unit/test_globmatch.py \
|
|
|
|
--replace-fail /var/log /test/log
|
|
|
|
substituteInPlace testing/unit/test_selection.py \
|
|
|
|
--replace-fail /usr/bin /dev
|
|
|
|
# don't use /tmp/ in tests
|
|
|
|
substituteInPlace duplicity/backends/_testbackend.py \
|
|
|
|
--replace-fail '"/tmp/' 'os.environ.get("TMPDIR")+"/'
|
2021-07-21 07:28:18 +00:00
|
|
|
'';
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-04-21 15:54:59 +00:00
|
|
|
# uses /tmp/
|
|
|
|
"testing/unit/test_cli_main.py::CommandlineTest::test_intermixed_args"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
gettext
|
2023-10-09 19:29:22 +00:00
|
|
|
python3.pkgs.wrapPython
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsNoGuiHook
|
2023-10-09 19:29:22 +00:00
|
|
|
python3.pkgs.setuptools-scm
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
librsync
|
2024-05-15 15:35:15 +00:00
|
|
|
# For Gio typelib
|
|
|
|
glib
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
pythonPath = with python3.pkgs; [
|
2020-09-25 04:45:31 +00:00
|
|
|
b2sdk
|
2021-01-05 17:05:55 +00:00
|
|
|
boto3
|
2020-04-24 23:36:52 +00:00
|
|
|
cffi
|
|
|
|
cryptography
|
|
|
|
ecdsa
|
|
|
|
idna
|
|
|
|
pygobject3
|
|
|
|
fasteners
|
|
|
|
lockfile
|
|
|
|
paramiko
|
|
|
|
pyasn1
|
|
|
|
pycrypto
|
2022-06-16 17:23:12 +00:00
|
|
|
pydrive2
|
2020-04-24 23:36:52 +00:00
|
|
|
future
|
2024-07-27 06:49:29 +00:00
|
|
|
] ++ paramiko.optional-dependencies.invoke;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
gnupg # Add 'gpg' to PATH.
|
|
|
|
gnutar # Add 'tar' to PATH.
|
|
|
|
librsync # Add 'rdiff' to PATH.
|
|
|
|
par2cmdline # Add 'par2' to PATH.
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
2020-11-24 20:58:05 +00:00
|
|
|
util-linux # Add 'setsid' to PATH.
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-04-21 15:54:59 +00:00
|
|
|
getconf
|
2023-10-09 19:29:22 +00:00
|
|
|
] ++ (with python3.pkgs; [
|
2020-04-24 23:36:52 +00:00
|
|
|
lockfile
|
|
|
|
mock
|
|
|
|
pexpect
|
2024-09-19 14:19:46 +00:00
|
|
|
pytestCheckHook
|
2024-04-21 15:54:59 +00:00
|
|
|
fasteners
|
2020-04-24 23:36:52 +00:00
|
|
|
]);
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# Prevent double wrapping, let the Python wrapper use the args in preFixup.
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
|
|
|
preFixup = let
|
2024-04-21 15:54:59 +00:00
|
|
|
binPath = lib.makeBinPath ([
|
|
|
|
gnupg
|
|
|
|
ncftp
|
|
|
|
rsync
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-04-21 15:54:59 +00:00
|
|
|
getconf
|
|
|
|
]); in ''
|
2024-05-15 15:35:15 +00:00
|
|
|
makeWrapperArgsBak=("''${makeWrapperArgs[@]}")
|
|
|
|
makeWrapperArgs+=(
|
|
|
|
"''${gappsWrapperArgs[@]}"
|
2024-04-21 15:54:59 +00:00
|
|
|
--prefix PATH : "${binPath}"
|
2024-05-15 15:35:15 +00:00
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
# Restore previous value for tests wrapping in preInstallCheck
|
|
|
|
makeWrapperArgs=("''${makeWrapperArgsBak[@]}")
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
2024-04-21 15:54:59 +00:00
|
|
|
# tests need writable $HOME
|
|
|
|
HOME=$PWD/.home
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapPythonProgramsIn "$PWD/testing/overrides/bin" "$pythonPath"
|
2024-04-21 15:54:59 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
doCheck = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script {
|
|
|
|
extraArgs = [ "--version-regex" "rel\.(.*)" ];
|
|
|
|
};
|
2021-07-21 07:28:18 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
tests.version = testers.testVersion {
|
|
|
|
package = self;
|
|
|
|
};
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-09-19 14:19:46 +00:00
|
|
|
changelog = "https://gitlab.com/duplicity/duplicity/-/blob/${src.rev}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Encrypted bandwidth-efficient backup using the rsync algorithm";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://duplicity.gitlab.io/duplicity-web/";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2024-07-27 06:49:29 +00:00
|
|
|
mainProgram = "duplicity";
|
2024-04-21 15:54:59 +00:00
|
|
|
maintainers = with maintainers; [ corngood ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in self
|