2022-09-26 10:39:55 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
python3,
|
|
|
|
fetchFromGitHub,
|
|
|
|
}: let
|
|
|
|
source = builtins.fromJSON (builtins.readFile ./source.json);
|
2022-09-30 08:22:38 +00:00
|
|
|
python = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
2022-09-30 08:23:28 +00:00
|
|
|
dask = super.dask.overridePythonAttrs (_: {
|
2022-09-30 08:22:38 +00:00
|
|
|
installCheckPhase = "true";
|
|
|
|
});
|
2023-04-02 08:22:05 +00:00
|
|
|
|
|
|
|
pyarrow = super.pyarrow.overridePythonAttrs (old: {
|
|
|
|
installCheckPhase = "true";
|
|
|
|
});
|
|
|
|
tifffile = super.tifffile.overridePythonAttrs (old: {
|
|
|
|
installCheckPhase = "true";
|
|
|
|
});
|
2022-09-30 08:22:38 +00:00
|
|
|
};
|
|
|
|
};
|
2022-09-26 10:39:55 +00:00
|
|
|
in
|
|
|
|
python.pkgs.buildPythonPackage rec {
|
|
|
|
pname = "mautrix-telegram";
|
|
|
|
version = source.date;
|
|
|
|
disabled = python.pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mautrix";
|
|
|
|
repo = "telegram";
|
|
|
|
inherit (source) rev sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [./0001-Re-add-entrypoint.patch ./mautrix-telegram-sticker.patch];
|
2022-11-16 09:19:29 +00:00
|
|
|
|
2022-11-15 20:05:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
2022-11-16 09:19:29 +00:00
|
|
|
--replace "asyncpg>=0.20,<0.27" "asyncpg>=0.20"
|
2022-11-15 20:05:22 +00:00
|
|
|
'';
|
2022-09-26 10:39:55 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
|
|
|
ruamel-yaml
|
|
|
|
python-magic
|
|
|
|
CommonMark
|
|
|
|
aiohttp
|
|
|
|
yarl
|
2022-09-26 10:50:44 +00:00
|
|
|
(python.pkgs.callPackage ../../python/mautrix.nix {})
|
2022-09-26 10:39:55 +00:00
|
|
|
(python.pkgs.callPackage ../../python/tulir-telethon.nix {})
|
|
|
|
asyncpg
|
|
|
|
Mako
|
|
|
|
# optional
|
|
|
|
cryptg
|
|
|
|
cchardet
|
|
|
|
aiodns
|
|
|
|
brotli
|
|
|
|
pillow
|
|
|
|
qrcode
|
|
|
|
phonenumbers
|
|
|
|
prometheus-client
|
|
|
|
aiosqlite
|
|
|
|
moviepy
|
|
|
|
python-olm
|
|
|
|
pycryptodome
|
|
|
|
unpaddedbase64
|
2023-03-19 20:55:34 +00:00
|
|
|
setuptools
|
2022-09-26 10:39:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# has no tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/mautrix/telegram";
|
|
|
|
description = "A Matrix-Telegram hybrid puppeting/relaybot bridge";
|
|
|
|
license = licenses.agpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
2022-10-09 15:59:50 +00:00
|
|
|
broken = !(python.pkgs ? cryptg);
|
2022-09-26 10:39:55 +00:00
|
|
|
};
|
|
|
|
passthru.updateScript = [
|
|
|
|
../../scripts/update-git.sh
|
|
|
|
"https://github.com/mautrix/telegram"
|
|
|
|
"matrix/mautrix-telegram/source.json"
|
|
|
|
];
|
|
|
|
}
|