2020-11-30 08:33:03 +00:00
|
|
|
{ fetchFromGitHub, lib, python3Packages }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "backblaze-b2";
|
2022-09-22 12:36:57 +00:00
|
|
|
version = "3.6.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
src = python3Packages.fetchPypi {
|
|
|
|
inherit version;
|
|
|
|
pname = "b2";
|
2022-09-22 12:36:57 +00:00
|
|
|
sha256 = "sha256-qHnnUTSLY1yncqIjG+IMLoNauvgwU04qsvH7dZZ8AlI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
postPatch = ''
|
2021-06-28 23:13:55 +00:00
|
|
|
substituteInPlace requirements.txt \
|
2022-08-21 13:32:41 +00:00
|
|
|
--replace 'tabulate==0.8.10' 'tabulate'
|
2021-05-20 23:08:51 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'setuptools_scm<6.0' 'setuptools_scm'
|
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
nativeBuildInputs = with python3Packages; [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
b2sdk
|
2020-11-30 08:33:03 +00:00
|
|
|
phx-class-registry
|
2020-10-07 09:15:18 +00:00
|
|
|
setuptools
|
2021-05-20 23:08:51 +00:00
|
|
|
docutils
|
|
|
|
rst2ansi
|
2022-08-21 13:32:41 +00:00
|
|
|
tabulate
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
checkInputs = with python3Packages; [
|
2022-08-21 13:32:41 +00:00
|
|
|
backoff
|
2022-09-22 12:36:57 +00:00
|
|
|
more-itertools
|
2021-10-28 06:52:43 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
disabledTests = [
|
2022-08-12 12:06:08 +00:00
|
|
|
# require network
|
2020-11-30 08:33:03 +00:00
|
|
|
"test_files_headers"
|
|
|
|
"test_integration"
|
2022-08-21 13:32:41 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# requires network
|
|
|
|
"test/integration/test_b2_command_line.py"
|
2020-11-30 08:33:03 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv "$out/bin/b2" "$out/bin/backblaze-b2"
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
sed 's/b2/backblaze-b2/' -i contrib/bash_completion/b2
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
mkdir -p "$out/share/bash-completion/completions"
|
|
|
|
cp contrib/bash_completion/b2 "$out/share/bash-completion/completions/backblaze-b2"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Command-line tool for accessing the Backblaze B2 storage service";
|
|
|
|
homepage = "https://github.com/Backblaze/B2_Command_Line_Tool";
|
|
|
|
license = licenses.mit;
|
2022-08-21 13:32:41 +00:00
|
|
|
maintainers = with maintainers; [ hrdinka kevincox tomhoule ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|