2020-09-25 21:29:52 +01:00
|
|
|
{
|
|
|
|
fetchFromGitHub,
|
|
|
|
lib,
|
|
|
|
python3Packages,
|
2017-12-02 13:42:13 +00:00
|
|
|
}:
|
2016-02-03 23:45:01 +00:00
|
|
|
|
2020-09-25 21:29:52 +01:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2017-12-02 13:42:13 +00:00
|
|
|
pname = "backblaze-b2";
|
2020-09-25 21:29:52 +01:00
|
|
|
version = "2.0.2";
|
2016-02-03 23:45:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Backblaze";
|
|
|
|
repo = "B2_Command_Line_Tool";
|
2017-12-02 13:42:13 +00:00
|
|
|
rev = "v${version}";
|
2020-09-25 21:29:52 +01:00
|
|
|
sha256 = "00zs0a580vvfm2w4ja68mc46360p475wlgagjkq1hi4m8s4qwd75";
|
2016-02-03 23:45:01 +00:00
|
|
|
};
|
|
|
|
|
2020-09-25 21:29:52 +01:00
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
b2sdk
|
|
|
|
class-registry
|
|
|
|
setuptools
|
|
|
|
];
|
2016-03-06 17:14:25 +00:00
|
|
|
|
2020-09-25 21:29:52 +01:00
|
|
|
checkInputs = with python3Packages; [
|
|
|
|
nose
|
|
|
|
];
|
2016-02-03 23:45:01 +00:00
|
|
|
|
2020-09-25 21:29:52 +01:00
|
|
|
# doCheck = false;
|
|
|
|
checkPhase = ''
|
|
|
|
nosetests
|
2018-09-02 07:45:09 +01:00
|
|
|
'';
|
|
|
|
|
2016-03-06 17:14:25 +00:00
|
|
|
postInstall = ''
|
|
|
|
mv "$out/bin/b2" "$out/bin/backblaze-b2"
|
|
|
|
|
2020-09-25 21:29:52 +01:00
|
|
|
sed 's/b2/backblaze-b2/' -i contrib/bash_completion/b2
|
2016-03-06 17:14:25 +00:00
|
|
|
|
|
|
|
mkdir -p "$out/etc/bash_completion.d"
|
|
|
|
cp contrib/bash_completion/b2 "$out/etc/bash_completion.d/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 02:11:51 +01:00
|
|
|
homepage = "https://github.com/Backblaze/B2_Command_Line_Tool";
|
2016-03-06 17:14:25 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hrdinka kevincox ];
|
|
|
|
platforms = platforms.unix;
|
2016-02-03 23:45:01 +00:00
|
|
|
};
|
|
|
|
}
|