This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

mautrix-telegram: patch pkg_resources for setuptools>=81

+18 -1
+18 -1
2configs/services/matrix/bridges/mautrix-telegram.nix
··· 11 11 # nixpkgs default python3 moved to 3.14, but tulir_telethon (the pinned 12 12 # Telethon fork mautrix-telegram depends on) declares no 3.14 support, so 13 13 # the build errors out. Pin the bridge to python312 until upstream bumps. 14 - mautrix-telegram = prev.mautrix-telegram.override { python3 = prev.python312; }; 14 + # 15 + # python312's setuptools (>=81) dropped the bundled pkg_resources module, 16 + # which mautrix-telegram 0.15.3 still imports in its web UI → the bridge 17 + # crashes on startup with ModuleNotFoundError. Upstream's own fix was to 18 + # pin setuptools; we instead rewrite the three call sites onto the stdlib 19 + # importlib.resources equivalents (--replace-fail so a version bump that 20 + # changes this file fails the build loudly instead of silently skipping). 21 + mautrix-telegram = 22 + (prev.mautrix-telegram.override { python3 = prev.python312; }).overrideAttrs 23 + (old: { 24 + postPatch = (old.postPatch or "") + '' 25 + substituteInPlace mautrix_telegram/web/public/__init__.py \ 26 + --replace-fail "import pkg_resources" "import importlib.resources" \ 27 + --replace-fail 'pkg_resources.resource_string("mautrix_telegram", "web/public/login.html.mako")' '(importlib.resources.files("mautrix_telegram") / "web/public/login.html.mako").read_bytes()' \ 28 + --replace-fail 'pkg_resources.resource_string("mautrix_telegram", "web/public/matrix-login.html.mako")' '(importlib.resources.files("mautrix_telegram") / "web/public/matrix-login.html.mako").read_bytes()' \ 29 + --replace-fail 'pkg_resources.resource_filename("mautrix_telegram", "web/public/")' 'str(importlib.resources.files("mautrix_telegram") / "web/public")' 30 + ''; 31 + }); 15 32 }) 16 33 ]; 17 34