2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
2023-07-15 17:15:38 +00:00
|
|
|
, fetchPypi
|
2022-09-09 14:08:57 +00:00
|
|
|
, fetchFromGitHub
|
2021-08-08 23:34:03 +00:00
|
|
|
, withE2BE ? true
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
let
|
2021-06-28 23:13:55 +00:00
|
|
|
python = python3.override {
|
2024-09-19 14:19:46 +00:00
|
|
|
self = python;
|
2021-06-28 23:13:55 +00:00
|
|
|
packageOverrides = self: super: {
|
2021-12-06 16:07:01 +00:00
|
|
|
tulir-telethon = self.telethon.overridePythonAttrs (oldAttrs: rec {
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.37.0a1";
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "tulir-telethon";
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchPypi {
|
2021-12-06 16:07:01 +00:00
|
|
|
inherit pname version;
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-FckMHqGaBsqvFbrEnDWqJAQG8j/euY2NooesnxV6Kcc=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
doCheck = false;
|
|
|
|
});
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
};
|
2023-02-02 18:25:31 +00:00
|
|
|
in
|
2023-03-04 12:14:45 +00:00
|
|
|
python.pkgs.buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "mautrix-telegram";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.15.2";
|
2022-04-27 09:35:20 +00:00
|
|
|
disabled = python.pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
src = fetchFromGitHub {
|
2021-12-06 16:07:01 +00:00
|
|
|
owner = "mautrix";
|
|
|
|
repo = "telegram";
|
2023-03-04 12:14:45 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-uR0vhp7ONyjwMKbgM1iObpFRoQzyQzJLbw4i9P58jTs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
patches = [ ./0001-Re-add-entrypoint.patch ];
|
2021-08-18 13:19:15 +00:00
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
propagatedBuildInputs = with python.pkgs; ([
|
2021-12-06 16:07:01 +00:00
|
|
|
ruamel-yaml
|
2022-05-18 14:49:53 +00:00
|
|
|
python-magic
|
2023-03-15 16:39:30 +00:00
|
|
|
commonmark
|
2022-09-09 14:08:57 +00:00
|
|
|
aiohttp
|
|
|
|
yarl
|
2024-09-19 14:19:46 +00:00
|
|
|
(mautrix.override { withOlm = withE2BE; })
|
2021-12-06 16:07:01 +00:00
|
|
|
tulir-telethon
|
2022-09-09 14:08:57 +00:00
|
|
|
asyncpg
|
2023-03-15 16:39:30 +00:00
|
|
|
mako
|
2023-03-24 00:07:29 +00:00
|
|
|
setuptools
|
2023-02-02 18:25:31 +00:00
|
|
|
# speedups
|
2022-09-09 14:08:57 +00:00
|
|
|
cryptg
|
|
|
|
aiodns
|
|
|
|
brotli
|
2023-02-02 18:25:31 +00:00
|
|
|
# qr_login
|
2020-04-24 23:36:52 +00:00
|
|
|
pillow
|
2022-09-09 14:08:57 +00:00
|
|
|
qrcode
|
2023-02-02 18:25:31 +00:00
|
|
|
# formattednumbers
|
2022-09-09 14:08:57 +00:00
|
|
|
phonenumbers
|
2023-02-02 18:25:31 +00:00
|
|
|
# metrics
|
2021-10-06 13:57:05 +00:00
|
|
|
prometheus-client
|
2023-02-02 18:25:31 +00:00
|
|
|
# sqlite
|
2022-09-09 14:08:57 +00:00
|
|
|
aiosqlite
|
2023-10-09 19:29:22 +00:00
|
|
|
# proxy support
|
|
|
|
pysocks
|
2021-08-08 23:34:03 +00:00
|
|
|
] ++ lib.optionals withE2BE [
|
2023-02-02 18:25:31 +00:00
|
|
|
# e2be
|
2021-08-08 23:34:03 +00:00
|
|
|
python-olm
|
|
|
|
pycryptodome
|
|
|
|
unpaddedbase64
|
2022-09-09 14:08:57 +00:00
|
|
|
]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
# has no tests
|
2020-11-30 08:33:03 +00:00
|
|
|
doCheck = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://github.com/mautrix/telegram";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Matrix-Telegram hybrid puppeting/relaybot bridge";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.agpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
2022-09-09 14:08:57 +00:00
|
|
|
maintainers = with maintainers; [ nyanloutre ma27 nickcao ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "mautrix-telegram";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|