2023-05-25 12:52:27 +00:00
|
|
|
{ lib, python3Packages, fetchPypi }:
|
2016-02-03 23:45:01 +00:00
|
|
|
|
2020-09-25 20:29:52 +00:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2017-12-02 13:42:13 +00:00
|
|
|
pname = "backblaze-b2";
|
2023-02-09 05:44:48 +00:00
|
|
|
version = "3.7.0";
|
2016-02-03 23:45:01 +00:00
|
|
|
|
2023-05-25 12:52:27 +00:00
|
|
|
src = fetchPypi {
|
2021-05-08 11:53:30 +00:00
|
|
|
inherit version;
|
|
|
|
pname = "b2";
|
2023-02-09 05:44:48 +00:00
|
|
|
sha256 = "sha256-sW6gaZWUh3WX+0+qHRlQ4gZzKU4bL8ePPNKWo9rdF84=";
|
2016-02-03 23:45:01 +00:00
|
|
|
};
|
|
|
|
|
2021-05-08 11:53:30 +00:00
|
|
|
postPatch = ''
|
2023-02-09 05:44:48 +00:00
|
|
|
substituteInPlace requirements.txt \
|
|
|
|
--replace 'phx-class-registry==4.0.5' 'phx-class-registry'
|
2021-06-21 10:47:02 +00:00
|
|
|
substituteInPlace requirements.txt \
|
2022-08-14 16:47:13 +00:00
|
|
|
--replace 'tabulate==0.8.10' 'tabulate'
|
2021-05-08 11:53:30 +00:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace 'setuptools_scm<6.0' 'setuptools_scm'
|
|
|
|
'';
|
|
|
|
|
2022-07-20 12:31:25 +00:00
|
|
|
nativeBuildInputs = with python3Packages; [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2020-09-25 20:29:52 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
b2sdk
|
2020-11-24 21:36:26 +00:00
|
|
|
phx-class-registry
|
2020-09-25 20:29:52 +00:00
|
|
|
setuptools
|
2021-05-08 11:53:30 +00:00
|
|
|
docutils
|
|
|
|
rst2ansi
|
2022-08-14 16:47:13 +00:00
|
|
|
tabulate
|
2021-05-08 11:53:30 +00:00
|
|
|
];
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = with python3Packages; [
|
2022-08-14 16:47:13 +00:00
|
|
|
backoff
|
2022-09-20 06:19:04 +00:00
|
|
|
more-itertools
|
2021-10-24 19:20:04 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2016-02-03 23:45:01 +00:00
|
|
|
|
2022-08-14 16:47:13 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2020-11-24 21:36:26 +00:00
|
|
|
disabledTests = [
|
2022-07-20 12:31:25 +00:00
|
|
|
# require network
|
2020-11-24 21:36:26 +00:00
|
|
|
"test_files_headers"
|
|
|
|
"test_integration"
|
2022-08-14 16:47:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# requires network
|
|
|
|
"test/integration/test_b2_command_line.py"
|
2020-11-24 21:36:26 +00:00
|
|
|
];
|
2018-09-02 06:45:09 +00:00
|
|
|
|
2016-03-06 17:14:25 +00:00
|
|
|
postInstall = ''
|
|
|
|
mv "$out/bin/b2" "$out/bin/backblaze-b2"
|
|
|
|
|
2020-09-25 20:29:52 +00:00
|
|
|
sed 's/b2/backblaze-b2/' -i contrib/bash_completion/b2
|
2016-03-06 17:14:25 +00:00
|
|
|
|
2020-11-12 21:22:18 +00:00
|
|
|
mkdir -p "$out/share/bash-completion/completions"
|
|
|
|
cp contrib/bash_completion/b2 "$out/share/bash-completion/completions/backblaze-b2"
|
2016-02-03 23:45:01 +00:00
|
|
|
'';
|
|
|
|
|
2017-12-02 13:42:13 +00:00
|
|
|
meta = with lib; {
|
2016-02-27 17:24:00 +00:00
|
|
|
description = "Command-line tool for accessing the Backblaze B2 storage service";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/Backblaze/B2_Command_Line_Tool";
|
2023-09-04 15:02:27 +00:00
|
|
|
changelog = "https://github.com/Backblaze/B2_Command_Line_Tool/blob/v${version}/CHANGELOG.md";
|
2016-03-06 17:14:25 +00:00
|
|
|
license = licenses.mit;
|
2022-08-14 16:48:25 +00:00
|
|
|
maintainers = with maintainers; [ hrdinka kevincox tomhoule ];
|
2016-02-03 23:45:01 +00:00
|
|
|
};
|
|
|
|
}
|