1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, pythonOlder 5, rustPlatform 6, setuptools-rust 7}: 8 9buildPythonPackage rec { 10 pname = "cryptg"; 11 version = "0.4"; 12 format = "setuptools"; 13 14 disabled = pythonOlder "3.7"; 15 16 src = fetchFromGitHub { 17 owner = "cher-nov"; 18 repo = pname; 19 rev = "v${version}"; 20 hash = "sha256-2HP1mKGPr8wOL5B0APJks3EVBicX2iMFI7vLJGTa1PM="; 21 }; 22 23 cargoDeps = rustPlatform.fetchCargoTarball { 24 inherit src; 25 hash = "sha256-AqSVFOB9Lfvk9h3GtoYlEOXBEt7YZYLhCDNKM9upQ2U="; 26 }; 27 28 nativeBuildInputs = with rustPlatform;[ 29 setuptools-rust 30 cargoSetupHook 31 rust.rustc 32 rust.cargo 33 ]; 34 35 # has no tests 36 doCheck = false; 37 38 pythonImportsCheck = [ "cryptg" ]; 39 40 meta = with lib; { 41 description = "Official Telethon extension to provide much faster cryptography for Telegram API requests"; 42 homepage = "https://github.com/cher-nov/cryptg"; 43 license = licenses.cc0; 44 maintainers = with maintainers; [ nickcao ]; 45 }; 46}