2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
openssl,
|
|
|
|
rsa,
|
|
|
|
pyaes,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
2022-09-30 11:47:45 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "telethon";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "1.26.1";
|
2022-09-30 11:47:45 +00:00
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "LonamiWebs";
|
|
|
|
repo = "Telethon";
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-RxnC+PVSnLeCZ1xap6n6CjpeA8Ig6oLGiB0LDxqUmsA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-12-25 13:55:36 +00:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace telethon/crypto/libssl.py --replace \
|
2022-04-03 18:54:34 +00:00
|
|
|
"ctypes.util.find_library('ssl')" "'${lib.getLib openssl}/lib/libssl.so'"
|
2020-12-25 13:55:36 +00:00
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
rsa
|
|
|
|
pyaes
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "tests/telethon" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/LonamiWebs/Telethon";
|
|
|
|
description = "Full-featured Telegram client library for Python 3";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ nyanloutre ];
|
|
|
|
};
|
|
|
|
}
|