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