1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 pythonOlder, 7 replaceVars, 8 bcrypt, 9 pyopenssl, 10 python-gnupg, 11 pytestCheckHook, 12 requests, 13 openssl, 14}: 15 16buildPythonPackage rec { 17 pname = "proton-client"; 18 version = "0.7.1"; 19 format = "setuptools"; 20 disabled = pythonOlder "3.7"; 21 22 src = fetchFromGitHub { 23 owner = "ProtonMail"; 24 repo = "proton-python-client"; 25 rev = version; 26 hash = "sha256-mhPq9O/LCu3+E1jKlaJmrI8dxbA9BIwlc34qGwoxi5g="; 27 }; 28 29 propagatedBuildInputs = [ 30 bcrypt 31 pyopenssl 32 python-gnupg 33 requests 34 ]; 35 36 buildInputs = [ openssl ]; 37 38 patches = [ 39 # Patches library by fixing the openssl path 40 (replaceVars ./0001-OpenSSL-path-fix.patch { 41 openssl = openssl.out; 42 ext = stdenv.hostPlatform.extensions.sharedLibrary; 43 }) 44 ]; 45 46 nativeCheckInputs = [ pytestCheckHook ]; 47 48 disabledTests = [ 49 #ValueError: Invalid modulus 50 "test_modulus_verification" 51 ]; 52 53 pythonImportsCheck = [ "proton" ]; 54 55 meta = with lib; { 56 description = "Python Proton client module"; 57 homepage = "https://github.com/ProtonMail/proton-python-client"; 58 license = licenses.gpl3Only; 59 maintainers = [ ]; 60 platforms = platforms.linux; 61 }; 62}