2020-10-07 09:15:18 +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";
|
2020-10-07 09:15:18 +00:00
|
|
|
version = "2.0.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Backblaze";
|
|
|
|
repo = "B2_Command_Line_Tool";
|
|
|
|
rev = "v${version}";
|
2020-10-07 09:15:18 +00:00
|
|
|
sha256 = "00zs0a580vvfm2w4ja68mc46360p475wlgagjkq1hi4m8s4qwd75";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
b2sdk
|
|
|
|
class-registry
|
|
|
|
setuptools
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
checkInputs = with python3Packages; [
|
|
|
|
nose
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
# doCheck = false;
|
|
|
|
checkPhase = ''
|
|
|
|
nosetests
|
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;
|
|
|
|
maintainers = with maintainers; [ hrdinka kevincox ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|