2022-04-27 09:35:20 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-09-30 11:47:45 +00:00
|
|
|
, rustPlatform
|
2022-04-27 09:35:20 +00:00
|
|
|
, setuptools
|
2022-09-30 11:47:45 +00:00
|
|
|
, setuptools-rust
|
2022-04-27 09:35:20 +00:00
|
|
|
, isPyPy
|
|
|
|
, fetchPypi
|
|
|
|
, pythonOlder
|
|
|
|
, cffi
|
|
|
|
, pytestCheckHook
|
2022-09-30 11:47:45 +00:00
|
|
|
, libiconv
|
|
|
|
, stdenv
|
|
|
|
# for passthru.tests
|
|
|
|
, asyncssh
|
|
|
|
, django_4
|
|
|
|
, fastapi
|
|
|
|
, paramiko
|
|
|
|
, twisted
|
2022-04-27 09:35:20 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bcrypt";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "4.0.0";
|
2022-04-27 09:35:20 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-09-30 11:47:45 +00:00
|
|
|
hash = "sha256-xZwXD8kiX6rQTd4bph2FtBOUbozi5fX1/zDf1nKD8xk=";
|
|
|
|
};
|
|
|
|
|
|
|
|
cargoRoot = "src/_bcrypt";
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
sourceRoot = "${pname}-${version}/${cargoRoot}";
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
hash = "sha256-HvfRLyUhlXVuvxWrtSDKx3rMKJbjvuiMcDY6g+pYFS0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
2022-09-30 11:47:45 +00:00
|
|
|
setuptools-rust
|
|
|
|
] ++ (with rustPlatform; [
|
|
|
|
cargoSetupHook
|
|
|
|
rust.cargo
|
|
|
|
rust.rustc
|
|
|
|
]);
|
|
|
|
|
|
|
|
# Remove when https://github.com/NixOS/nixpkgs/pull/190093 lands.
|
|
|
|
buildInputs = lib.optional stdenv.isDarwin libiconv;
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
cffi
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedNativeBuildInputs = [
|
|
|
|
cffi
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-04-27 09:35:20 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"bcrypt"
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit asyncssh django_4 fastapi paramiko twisted;
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Modern password hashing for your software and your servers";
|
|
|
|
homepage = "https://github.com/pyca/bcrypt/";
|
2022-04-27 09:35:20 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ domenkozar ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|