2016-03-06 17:14:25 +00:00
|
|
|
{ fetchFromGitHub, makeWrapper, pythonPackages, stdenv }:
|
2016-02-03 23:45:01 +00:00
|
|
|
|
2016-03-06 17:14:25 +00:00
|
|
|
pythonPackages.buildPythonApplication rec {
|
|
|
|
name = "backblaze-b2-${version}";
|
2016-07-21 19:45:35 +01:00
|
|
|
version = "0.6.2";
|
2016-02-03 23:45:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Backblaze";
|
|
|
|
repo = "B2_Command_Line_Tool";
|
2016-07-21 19:45:35 +01:00
|
|
|
rev = "3a4cd3f0b5309f79f98c2e0d51afc19fb2fe4201";
|
|
|
|
sha256 = "1gl1z7zg3s1xgx45i6b1bvx9iwviiiinl4my00h66qkhrw7ag8p1";
|
2016-02-03 23:45:01 +00:00
|
|
|
};
|
|
|
|
|
2017-05-01 05:16:38 +01:00
|
|
|
propagatedBuildInputs = with pythonPackages; [ futures requests2 six tqdm ];
|
2016-03-06 17:14:25 +00:00
|
|
|
|
2016-02-03 23:45:01 +00:00
|
|
|
checkPhase = ''
|
|
|
|
python test_b2_command_line.py test
|
|
|
|
'';
|
|
|
|
|
2016-03-06 17:14:25 +00:00
|
|
|
postInstall = ''
|
|
|
|
mv "$out/bin/b2" "$out/bin/backblaze-b2"
|
|
|
|
|
|
|
|
sed 's/^have b2 \&\&$/have backblaze-b2 \&\&/' -i contrib/bash_completion/b2
|
|
|
|
sed 's/^\(complete -F _b2\) b2/\1 backblaze-b2/' -i contrib/bash_completion/b2
|
|
|
|
|
|
|
|
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
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2016-02-27 17:24:00 +00:00
|
|
|
description = "Command-line tool for accessing the Backblaze B2 storage service";
|
2016-03-06 17:14:25 +00:00
|
|
|
homepage = https://github.com/Backblaze/B2_Command_Line_Tool;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hrdinka kevincox ];
|
|
|
|
platforms = platforms.unix;
|
2016-02-03 23:45:01 +00:00
|
|
|
};
|
|
|
|
}
|