2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
2023-01-20 10:41:00 +00:00
|
|
|
, stdenv
|
2022-09-09 14:08:57 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2022-11-02 22:02:43 +00:00
|
|
|
, pythonOlder
|
2023-05-24 13:37:59 +00:00
|
|
|
, cargo
|
2022-09-09 14:08:57 +00:00
|
|
|
, rustPlatform
|
2023-05-24 13:37:59 +00:00
|
|
|
, rustc
|
2022-09-09 14:08:57 +00:00
|
|
|
, setuptools-rust
|
2023-01-20 10:41:00 +00:00
|
|
|
, libiconv
|
2022-09-09 14:08:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cryptg";
|
2022-11-02 22:02:43 +00:00
|
|
|
version = "0.4";
|
2022-09-09 14:08:57 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2022-11-02 22:02:43 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "cher-nov";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-11-02 22:02:43 +00:00
|
|
|
hash = "sha256-2HP1mKGPr8wOL5B0APJks3EVBicX2iMFI7vLJGTa1PM=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
2022-11-02 22:02:43 +00:00
|
|
|
hash = "sha256-AqSVFOB9Lfvk9h3GtoYlEOXBEt7YZYLhCDNKM9upQ2U=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = [
|
2022-09-09 14:08:57 +00:00
|
|
|
setuptools-rust
|
2023-05-24 13:37:59 +00:00
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
rustc
|
|
|
|
cargo
|
2022-09-09 14:08:57 +00:00
|
|
|
];
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
libiconv
|
|
|
|
];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
# has no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "cryptg" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Official Telethon extension to provide much faster cryptography for Telegram API requests";
|
|
|
|
homepage = "https://github.com/cher-nov/cryptg";
|
|
|
|
license = licenses.cc0;
|
|
|
|
maintainers = with maintainers; [ nickcao ];
|
|
|
|
};
|
|
|
|
}
|