summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYureka <yuka@yuka.dev>2021-12-29 05:40:25 +0100
committerMaximilian Bosch <maximilian@mbosch.me>2022-01-23 23:34:15 +0100
commitb63d966286494c45962764caecf25d499b4fd24d (patch)
treeade9dd3b5fec2d3606e7d2fa18292b0364e56dbe
parentnixos/systemd-boot: fix error output (diff)
downloadnixpkgs-b63d966286494c45962764caecf25d499b4fd24d.tar.gz
mautrix-telegram: 0.10.2 -> 0.11.1
Backport of the commits * 4713109cae7b95cdd474194d41b609b6dd4a6185 (mautrix-telegram: 0.10.2 -> 0.11.0) * 0630d5c38180af29fc40323ed485e0e9d4b2c9a3 (mautrix-telegram: remove alembic passthru) * 2d42d654aa482de067d30285d8d5bdce5e32ec62 (mautrix-telegram: 0.11.0 -> 0.11.1) Also added an override for `mautrix` since we cannot backport these updates as it'd break at least `mautrix-signal`. While this is technically a breaking change, we don't really have a choice since Telegram expects all kinds of consuming software to also display & support "Promotions", otherwise these apps will be deactivated. To quote the message I got from Telegram in December: > We ask that you make sure that these sponsored messages are supported and > properly displayed in your app by January 1, 2022. Unfortunately, Telegram > cannot financially sustain apps that support Telegram Channels but do not > display official sponsored messages – such apps will have to be disconnected.
-rw-r--r--pkgs/servers/mautrix-telegram/0001-Re-add-entrypoint.patch16
-rw-r--r--pkgs/servers/mautrix-telegram/default.nix37
2 files changed, 19 insertions, 34 deletions
diff --git a/pkgs/servers/mautrix-telegram/0001-Re-add-entrypoint.patch b/pkgs/servers/mautrix-telegram/0001-Re-add-entrypoint.patch
index 448e7017a6c3..a1a732bbbeab 100644
--- a/pkgs/servers/mautrix-telegram/0001-Re-add-entrypoint.patch
+++ b/pkgs/servers/mautrix-telegram/0001-Re-add-entrypoint.patch
@@ -8,22 +8,20 @@ Subject: [PATCH 1/2] Re-add entrypoint
1 file changed, 6 insertions(+)
diff --git a/setup.py b/setup.py
-index 068c351..95dbf89 100644
+index ea001e5..e1ca536 100644
--- a/setup.py
+++ b/setup.py
-@@ -51,6 +51,12 @@ setuptools.setup(
+@@ -54,6 +54,12 @@ setuptools.setup(
extras_require=extras_require,
- python_requires="~=3.6",
-
+ python_requires="~=3.7",
+
+ entry_points={
+ 'console_scripts': [
+ 'mautrix-telegram=mautrix_telegram.__main__:main'
+ ]
+ },
+
- setup_requires=["pytest-runner"],
- tests_require=["pytest", "pytest-asyncio", "pytest-mock"],
-
---
-2.28.0
+ classifiers=[
+ "Development Status :: 4 - Beta",
+ "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
diff --git a/pkgs/servers/mautrix-telegram/default.nix b/pkgs/servers/mautrix-telegram/default.nix
index 33b9d1d400db..cfcba4c99842 100644
--- a/pkgs/servers/mautrix-telegram/default.nix
+++ b/pkgs/servers/mautrix-telegram/default.nix
@@ -5,20 +5,20 @@
let
python = python3.override {
packageOverrides = self: super: {
- sqlalchemy = super.sqlalchemy.overridePythonAttrs (oldAttrs: rec {
- version = "1.3.24";
+ tulir-telethon = self.telethon.overridePythonAttrs (oldAttrs: rec {
+ version = "1.25.0a3";
+ pname = "tulir-telethon";
src = oldAttrs.src.override {
- inherit version;
- sha256 = "ebbb777cbf9312359b897bf81ba00dae0f5cb69fba2a18265dcc18a6f5ef7519";
+ inherit pname version;
+ sha256 = "sha256-/kau9Q2+7giVx52tmjvYIbcDcY1/om31X9BlRvZipuk=";
};
});
-
- tulir-telethon = self.telethon.overridePythonAttrs (oldAttrs: rec {
- version = "1.24.0a2";
- pname = "tulir-telethon";
+ mautrix = super.mautrix.overridePythonAttrs (oldAttrs: rec {
+ version = "0.14.5";
+ pname = "mautrix";
src = oldAttrs.src.override {
inherit pname version;
- sha256 = "sha256-Qbx164FwC8nhesoY2fkaKvErN8g0Ph8vGcx+Cc1AqRg=";
+ sha256 = "sha256-dh3uQUBEMqtlrOpnO5Aa7GC5gajwQ12rWyVPwX6xIsQ=";
};
});
};
@@ -33,19 +33,18 @@ let
in python.pkgs.buildPythonPackage rec {
pname = "mautrix-telegram";
- version = "0.10.2";
+ version = "0.11.1";
disabled = python.pythonOlder "3.7";
src = fetchFromGitHub {
owner = "mautrix";
repo = "telegram";
rev = "v${version}";
- sha256 = "sha256-BYsGLyxhdjBVmnZXLC5ZjwDlWcHdUGp+DsNIOXA1/Tc=";
+ sha256 = "sha256-Df+v1Q+5Iaa9GKcwIabMKjJwmVd5Qub8M54jEEiAPFc=";
};
- patches = [ ./0001-Re-add-entrypoint.patch ./0002-Don-t-depend-on-pytest-runner.patch ];
+ patches = [ ./0001-Re-add-entrypoint.patch ];
postPatch = ''
- sed -i -e '/alembic>/d' requirements.txt
substituteInPlace requirements.txt \
--replace "telethon>=1.22,<1.23" "telethon"
'';
@@ -72,18 +71,6 @@ in python.pkgs.buildPythonPackage rec {
unpaddedbase64
]) ++ dbDrivers;
- # `alembic` (a database migration tool) is only needed for the initial setup,
- # and not needed during the actual runtime. However `alembic` requires `mautrix-telegram`
- # in its environment to create a database schema from all models.
- #
- # Hence we need to patch away `alembic` from `mautrix-telegram` and create an `alembic`
- # which has `mautrix-telegram` in its environment.
- passthru.alembic = python.pkgs.alembic.overrideAttrs (old: {
- propagatedBuildInputs = old.propagatedBuildInputs ++ dbDrivers ++ [
- mautrix-telegram
- ];
- });
-
# Tests are broken and throw the following for every test:
# TypeError: 'Mock' object is not subscriptable
#