2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, fetchFromGitHub
|
2021-08-08 23:34:03 +00:00
|
|
|
, withE2BE ? true
|
2022-09-09 14:08:57 +00:00
|
|
|
, withHQthumbnails ? false
|
2021-08-08 23:34:03 +00:00
|
|
|
}:
|
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 {
|
|
|
|
packageOverrides = self: super: {
|
2021-12-06 16:07:01 +00:00
|
|
|
tulir-telethon = self.telethon.overridePythonAttrs (oldAttrs: rec {
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "1.26.0a5";
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "tulir-telethon";
|
2022-09-30 11:47:45 +00:00
|
|
|
src = super.fetchPypi {
|
2021-12-06 16:07:01 +00:00
|
|
|
inherit pname version;
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-s6pj9kHqcl6XU1KQ/aOw1XWQ3CyDotaDl0m7aj9SbW4=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
2022-09-30 11:47:45 +00:00
|
|
|
doCheck = false;
|
2021-12-06 16:07:01 +00:00
|
|
|
});
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in python.pkgs.buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "mautrix-telegram";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "0.12.1";
|
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";
|
2021-08-22 07:53:02 +00:00
|
|
|
rev = "v${version}";
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-ecNcoNz++HtuDZnDLsXfPL0MRF+XMQ1BU/NFkKPbD5U=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
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
|
2022-09-09 14:08:57 +00:00
|
|
|
CommonMark
|
|
|
|
aiohttp
|
|
|
|
yarl
|
|
|
|
mautrix
|
2021-12-06 16:07:01 +00:00
|
|
|
tulir-telethon
|
2022-09-09 14:08:57 +00:00
|
|
|
asyncpg
|
|
|
|
Mako
|
|
|
|
# optional
|
|
|
|
cryptg
|
|
|
|
cchardet
|
|
|
|
aiodns
|
|
|
|
brotli
|
2020-04-24 23:36:52 +00:00
|
|
|
pillow
|
2022-09-09 14:08:57 +00:00
|
|
|
qrcode
|
|
|
|
phonenumbers
|
2021-10-06 13:57:05 +00:00
|
|
|
prometheus-client
|
2022-09-09 14:08:57 +00:00
|
|
|
aiosqlite
|
|
|
|
] ++ lib.optionals withHQthumbnails [
|
|
|
|
moviepy
|
2021-08-08 23:34:03 +00:00
|
|
|
] ++ lib.optionals withE2BE [
|
|
|
|
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";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A Matrix-Telegram hybrid puppeting/relaybot bridge";
|
|
|
|
license = licenses.agpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
2022-09-09 14:08:57 +00:00
|
|
|
maintainers = with maintainers; [ nyanloutre ma27 nickcao ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|