2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
2022-04-27 09:35:20 +00:00
|
|
|
, stdenv
|
2021-12-06 16:07:01 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
2022-04-27 09:35:20 +00:00
|
|
|
, substituteAll
|
2021-12-06 16:07:01 +00:00
|
|
|
, bcrypt
|
|
|
|
, pyopenssl
|
|
|
|
, python-gnupg
|
2022-04-27 09:35:20 +00:00
|
|
|
, pytestCheckHook
|
2021-12-06 16:07:01 +00:00
|
|
|
, requests
|
|
|
|
, openssl
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "proton-client";
|
2022-01-22 01:22:15 +00:00
|
|
|
version = "0.7.1";
|
2021-12-06 16:07:01 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ProtonMail";
|
|
|
|
repo = "proton-python-client";
|
|
|
|
rev = version;
|
2022-01-22 01:22:15 +00:00
|
|
|
sha256 = "sha256-mhPq9O/LCu3+E1jKlaJmrI8dxbA9BIwlc34qGwoxi5g=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
bcrypt
|
|
|
|
pyopenssl
|
|
|
|
python-gnupg
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [ openssl ];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
patches = [
|
|
|
|
# Patches library by fixing the openssl path
|
|
|
|
(substituteAll {
|
|
|
|
src = ./0001-OpenSSL-path-fix.patch;
|
|
|
|
openssl = openssl.out;
|
|
|
|
ext = stdenv.hostPlatform.extensions.sharedLibrary;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [ pytestCheckHook ];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
#ValueError: Invalid modulus
|
|
|
|
"test_modulus_verification"
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "proton" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python Proton client module";
|
|
|
|
homepage = "https://github.com/ProtonMail/proton-python-client";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ wolfangaukang ];
|
|
|
|
};
|
|
|
|
}
|