about summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2022-07-28 17:10:27 +0800
committerNick Cao <nickcao@nichi.co>2022-09-04 19:14:37 +0800
commit9997578fae6965ec8244b294e285dc81c03944ea (patch)
tree128c8d2033afc428d251cbebdccbd8e84a10a124 /pkgs/servers
parentcb46b008b62665613b6e1c65a68ebdcf807e7aa0 (diff)
mautrix-telegram: 0.11.3 -> 0.12.0 and rework packaging
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/mautrix-telegram/default.nix61
1 files changed, 27 insertions, 34 deletions
diff --git a/pkgs/servers/mautrix-telegram/default.nix b/pkgs/servers/mautrix-telegram/default.nix
index eb6372b12037a..5b021cd809857 100644
--- a/pkgs/servers/mautrix-telegram/default.nix
+++ b/pkgs/servers/mautrix-telegram/default.nix
@@ -1,5 +1,8 @@
-{ lib, python3, mautrix-telegram, fetchFromGitHub
+{ lib
+, python3
+, fetchFromGitHub
 , withE2BE ? true
+, withHQthumbnails ? false
 }:
 
 let
@@ -21,75 +24,65 @@ let
         };
       });
       tulir-telethon = self.telethon.overridePythonAttrs (oldAttrs: rec {
-        version = "1.25.0a7";
+        version = "1.25.0a20";
         pname = "tulir-telethon";
         src = oldAttrs.src.override {
           inherit pname version;
-          sha256 = "sha256-+wHRrBluM0ejdHjIvSk28wOIfCfIyibBcmwG/ksbiac=";
+          sha256 = "sha256-X9oo+YCNMqQrJvQa/PIi9dFgaeQxbrlnwUJnwjRb6Jc=";
         };
       });
     };
   };
-
-  # officially supported database drivers
-  dbDrivers = with python.pkgs; [
-    psycopg2
-    aiosqlite
-    # sqlite driver is already shipped with python by default
-  ];
-
 in python.pkgs.buildPythonPackage rec {
   pname = "mautrix-telegram";
-  version = "0.11.3";
+  version = "0.12.0";
   disabled = python.pythonOlder "3.8";
 
   src = fetchFromGitHub {
     owner = "mautrix";
     repo = "telegram";
     rev = "v${version}";
-    sha256 = "sha256-PfER/wqJ607w0xVrFZadzmxYyj72O10c2lIvCW7LT8Y=";
+    sha256 = "sha256-SUwiRrTY8NgOGQ643prsm3ZklOlwX/59m/u1aewFuik=";
   };
 
   patches = [ ./0001-Re-add-entrypoint.patch ];
 
   propagatedBuildInputs = with python.pkgs; ([
-    Mako
-    aiohttp
-    mautrix
-    sqlalchemy
-    CommonMark
     ruamel-yaml
     python-magic
+    CommonMark
+    aiohttp
+    yarl
+    mautrix
     tulir-telethon
-    telethon-session-sqlalchemy
+    asyncpg
+    Mako
+    # optional
+    cryptg
+    cchardet
+    aiodns
+    brotli
     pillow
-    lxml
-    setuptools
+    qrcode
+    phonenumbers
     prometheus-client
+    aiosqlite
+  ] ++ lib.optionals withHQthumbnails [
+    moviepy
   ] ++ lib.optionals withE2BE [
-    asyncpg
     python-olm
     pycryptodome
     unpaddedbase64
-  ]) ++ dbDrivers;
+  ]);
 
-  # Tests are broken and throw the following for every test:
-  #   TypeError: 'Mock' object is not subscriptable
-  #
-  # The tests were touched the last time in 2019 and upstream CI doesn't even build
-  # those, so it's safe to assume that this part of the software is abandoned.
+  # has no tests
   doCheck = false;
-  checkInputs = with python.pkgs; [
-    pytest
-    pytest-mock
-    pytest-asyncio
-  ];
 
   meta = with lib; {
     homepage = "https://github.com/mautrix/telegram";
     description = "A Matrix-Telegram hybrid puppeting/relaybot bridge";
     license = licenses.agpl3Plus;
     platforms = platforms.linux;
-    maintainers = with maintainers; [ nyanloutre ma27 ];
+    maintainers = with maintainers; [ nyanloutre ma27 nickcao ];
   };
 }