nixpkgs/pkgs/development/tools/backblaze-b2/default.nix

66 lines
1.6 KiB
Nix
Raw Normal View History

2020-11-25 00:36:26 +03:00
{ fetchFromGitHub, lib, python3Packages }:
2016-02-04 02:45:01 +03:00
let
python3Packages2 = python3Packages.override {
overrides = self: super: {
arrow = self.callPackage ../../python-modules/arrow/2.nix { };
};
};
in
let
python3Packages = python3Packages2; # two separate let … in to avoid infinite recursion
in
2020-09-25 23:29:52 +03:00
python3Packages.buildPythonApplication rec {
2017-12-02 16:42:13 +03:00
pname = "backblaze-b2";
2021-08-10 12:53:15 +03:00
version = "3.0.1";
2016-02-04 02:45:01 +03:00
src = python3Packages.fetchPypi {
inherit version;
pname = "b2";
2021-08-10 12:53:15 +03:00
sha256 = "sha256-Zr+5J6MCjfth+5fOSfHXpT/CAgD754ZpS1b1NqeGid8=";
2016-02-04 02:45:01 +03:00
};
postPatch = ''
substituteInPlace requirements.txt \
--replace 'docutils==0.16' 'docutils'
substituteInPlace setup.py \
--replace 'setuptools_scm<6.0' 'setuptools_scm'
'';
2020-09-25 23:29:52 +03:00
propagatedBuildInputs = with python3Packages; [
b2sdk
2020-11-25 00:36:26 +03:00
phx-class-registry
2020-09-25 23:29:52 +03:00
setuptools
docutils
rst2ansi
];
nativeBuildInputs = with python3Packages; [
setuptools-scm
2020-09-25 23:29:52 +03:00
];
2016-03-06 20:14:25 +03:00
2020-11-25 00:36:26 +03:00
checkInputs = with python3Packages; [ pytestCheckHook ];
2016-02-04 02:45:01 +03:00
2020-11-25 00:36:26 +03:00
disabledTests = [
"test_files_headers"
"test_integration"
];
2016-03-06 20:14:25 +03:00
postInstall = ''
mv "$out/bin/b2" "$out/bin/backblaze-b2"
2020-09-25 23:29:52 +03:00
sed 's/b2/backblaze-b2/' -i contrib/bash_completion/b2
2016-03-06 20:14:25 +03:00
mkdir -p "$out/share/bash-completion/completions"
cp contrib/bash_completion/b2 "$out/share/bash-completion/completions/backblaze-b2"
2016-02-04 02:45:01 +03:00
'';
2017-12-02 16:42:13 +03:00
meta = with lib; {
description = "Command-line tool for accessing the Backblaze B2 storage service";
homepage = "https://github.com/Backblaze/B2_Command_Line_Tool";
2016-03-06 20:14:25 +03:00
license = licenses.mit;
maintainers = with maintainers; [ hrdinka kevincox ];
platforms = platforms.unix;
2016-02-04 02:45:01 +03:00
};
}