2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
|
|
|
cargo,
|
|
|
|
rustPlatform,
|
|
|
|
rustc,
|
2024-10-23 06:41:50 +00:00
|
|
|
setuptools,
|
2024-06-05 15:53:02 +00:00
|
|
|
setuptools-rust,
|
|
|
|
libiconv,
|
2022-09-09 14:08:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cryptg";
|
2024-10-23 06:41:50 +00:00
|
|
|
version = "0.5";
|
|
|
|
pyproject = true;
|
2022-09-09 14:08:57 +00:00
|
|
|
|
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}";
|
2024-10-23 06:41:50 +00:00
|
|
|
hash = "sha256-uJfMetplTyRT95P/8ljz4H4ASYMXEM7jROWSpjftKjU=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
2024-10-23 06:41:50 +00:00
|
|
|
hash = "sha256-HDMztt7/ZpPlpy0IMGuWGGo4vwKhraFTmTTPr9tC+Ok=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2024-10-23 06:41:50 +00:00
|
|
|
build-system = [
|
|
|
|
setuptools
|
2022-09-09 14:08:57 +00:00
|
|
|
setuptools-rust
|
2024-10-23 06:41:50 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-05-24 13:37:59 +00:00
|
|
|
rustPlatform.cargoSetupHook
|
|
|
|
rustc
|
|
|
|
cargo
|
2022-09-09 14:08:57 +00:00
|
|
|
];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
# has no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "cryptg" ];
|
|
|
|
|
2024-10-23 06:41:50 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml --replace-fail "setuptools[core]" "setuptools"
|
|
|
|
'';
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|