1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, openssl
5, rsa
6, pyaes
7, pythonOlder
8, setuptools
9, pytest-asyncio
10, pytestCheckHook
11}:
12
13buildPythonPackage rec {
14 pname = "telethon";
15 version = "1.25.1";
16 format = "pyproject";
17 disabled = pythonOlder "3.5";
18
19 src = fetchFromGitHub {
20 owner = "LonamiWebs";
21 repo = "Telethon";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-xmFoCUqYo600RH72KWG/aM7hKGiTYdCBsbPOFipxIzA=";
24 };
25
26 patchPhase = ''
27 substituteInPlace telethon/crypto/libssl.py --replace \
28 "ctypes.util.find_library('ssl')" "'${lib.getLib openssl}/lib/libssl.so'"
29 '';
30
31 nativeBuildInputs = [
32 setuptools
33 ];
34
35 propagatedBuildInputs = [
36 rsa
37 pyaes
38 ];
39
40 checkInputs = [
41 pytest-asyncio
42 pytestCheckHook
43 ];
44
45 pytestFlagsArray = [
46 "tests/telethon"
47 ];
48
49 meta = with lib; {
50 homepage = "https://github.com/LonamiWebs/Telethon";
51 description = "Full-featured Telegram client library for Python 3";
52 license = licenses.mit;
53 maintainers = with maintainers; [ nyanloutre ];
54 };
55}