treewide: stdenv.is -> stdenv.hostPlatform.is (#356363)
[NixPkgs.git] / pkgs / development / python-modules / hf-transfer / default.nix
blob8007552ef405bbc37ca08560b9393168578f547b
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
6   # build-system
7   cargo,
8   pkg-config,
9   rustPlatform,
10   rustc,
12   # buildInputs
13   openssl,
14   stdenv,
15   darwin,
16   libiconv,
19 buildPythonPackage rec {
20   pname = "hf-transfer";
21   version = "0.1.8";
22   pyproject = true;
24   src = fetchFromGitHub {
25     owner = "huggingface";
26     repo = "hf_transfer";
27     rev = "refs/tags/v${version}";
28     hash = "sha256-Uh8q14OeN0fYsywYyNrH8C3wq/qRjQKEAIufi/a5RXA=";
29   };
31   cargoDeps = rustPlatform.fetchCargoTarball {
32     inherit src;
33     name = "${pname}-${version}";
34     hash = "sha256-I4APdz1r2KJ8pTfKAg8g240wYy8gtMlHwmBye4796Tk=";
35   };
37   build-system = [
38     cargo
39     pkg-config
40     rustPlatform.cargoSetupHook
41     rustPlatform.maturinBuildHook
42     rustc
43   ];
45   buildInputs =
46     [
47       openssl
48     ]
49     ++ lib.optionals stdenv.hostPlatform.isDarwin [
50       darwin.apple_sdk.frameworks.Security
51       darwin.apple_sdk.frameworks.SystemConfiguration
52       libiconv
53     ];
55   pythonImportsCheck = [ "hf_transfer" ];
57   env = {
58     OPENSSL_NO_VENDOR = true;
59   };
61   meta = {
62     description = "High speed download python library";
63     homepage = "https://github.com/huggingface/hf_transfer";
64     changelog = "https://github.com/huggingface/hf_transfer/releases/tag/v${version}";
65     license = lib.licenses.asl20;
66     maintainers = with lib.maintainers; [ GaetanLepage ];
67   };