From e33dc05e71fa547aff374296049618514b7cf82b Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 31 Jan 2023 12:46:08 +0800 Subject: [PATCH 1/5] python3Packages.mautrix: 0.18.9 -> 0.19.3 Changelog: https://github.com/mautrix/python/releases/tag/v0.19.3 --- .../python-modules/mautrix/default.nix | 67 +++++++++++++------ 1 file changed, 47 insertions(+), 20 deletions(-) diff --git a/pkgs/development/python-modules/mautrix/default.nix b/pkgs/development/python-modules/mautrix/default.nix index ff92d814a099..dd3553419792 100644 --- a/pkgs/development/python-modules/mautrix/default.nix +++ b/pkgs/development/python-modules/mautrix/default.nix @@ -1,40 +1,67 @@ { lib , buildPythonPackage -, fetchPypi -, aiohttp +, fetchFromGitHub , pythonOlder -, sqlalchemy -, ruamel-yaml -, CommonMark -, lxml + # deps +, aiohttp +, attrs +, yarl + # optional deps +, python-magic +, python-olm +, unpaddedbase64 +, pycryptodome + # check deps +, pytestCheckHook +, pytest-asyncio , aiosqlite +, sqlalchemy +, asyncpg }: buildPythonPackage rec { pname = "mautrix"; - version = "0.18.9"; + version = "0.19.3"; format = "setuptools"; disabled = pythonOlder "3.8"; - src = fetchPypi { - inherit pname version; - hash = "sha256-Ihaz/izB9L6osu3CPwBWOwLZ2JOLKhsDuqOUf/B02qI="; + src = fetchFromGitHub { + owner = "mautrix"; + repo = "python"; + rev = "v${version}"; + hash = "sha256-7nvy2/DUS2BkcyQUUG8+aT/JHcPu141e5YWOiccS6cU="; }; propagatedBuildInputs = [ aiohttp - - # defined in optional-requirements.txt - sqlalchemy - aiosqlite - ruamel-yaml - CommonMark - lxml + attrs + yarl ]; - # no tests available - doCheck = false; + passthru.optional-dependencies = { + detect_mimetype = [ + python-magic + ]; + encryption = [ + python-olm + unpaddedbase64 + pycryptodome + ]; + }; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + checkInputs = [ + pytest-asyncio + aiosqlite + sqlalchemy + asyncpg + ] ++ passthru.optional-dependencies.encryption; + + SQLALCHEMY_SILENCE_UBER_WARNING = 1; pythonImportsCheck = [ "mautrix" @@ -45,6 +72,6 @@ buildPythonPackage rec { homepage = "https://github.com/tulir/mautrix-python"; changelog = "https://github.com/mautrix/python/releases/tag/v${version}"; license = licenses.mpl20; - maintainers = with maintainers; [ nyanloutre ma27 sumnerevans ]; + maintainers = with maintainers; [ nyanloutre ma27 sumnerevans nickcao ]; }; } From 7a382a6b5822401a82555556a3ebfd77628c6583 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 31 Jan 2023 13:24:57 +0800 Subject: [PATCH 2/5] heisenbridge: rework packaging --- pkgs/servers/heisenbridge/default.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/servers/heisenbridge/default.nix b/pkgs/servers/heisenbridge/default.nix index db7d40ad35d5..1371bac15d66 100644 --- a/pkgs/servers/heisenbridge/default.nix +++ b/pkgs/servers/heisenbridge/default.nix @@ -4,17 +4,18 @@ let python = python3.override { packageOverrides = self: super: { mautrix = super.mautrix.overridePythonAttrs (oldAttrs: rec { - version = "0.16.3"; - src = oldAttrs.src.override { - inherit (oldAttrs) pname; - inherit version; - hash = "sha256-OpHLh5pCzGooQ5yxAa0+85m/szAafV+l+OfipQcfLtU="; + version = "0.16.10"; + src = fetchFromGitHub { + owner = "mautrix"; + repo = "python"; + rev = "v${version}"; + hash = "sha256-YQsQ7M+mHcRdGUZp+mo46AlBmKSdmlgRdGieEG0Hu9k="; }; }); }; }; - -in python.pkgs.buildPythonApplication rec { +in +python.pkgs.buildPythonApplication rec { pname = "heisenbridge"; version = "1.13.1"; @@ -30,11 +31,10 @@ in python.pkgs.buildPythonApplication rec { ''; propagatedBuildInputs = with python.pkgs; [ - aiohttp irc + ruamel-yaml mautrix python-socks - pyyaml ]; nativeCheckInputs = with python.pkgs; [ From 54468447bbab6ff86df09ed2aa5c857b6dc2fb00 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 14 Jan 2023 20:11:14 +0800 Subject: [PATCH 3/5] mautrix-telegram: 0.12.2 -> unstable-2023-01-28 --- pkgs/servers/mautrix-telegram/default.nix | 24 +++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/pkgs/servers/mautrix-telegram/default.nix b/pkgs/servers/mautrix-telegram/default.nix index 468df32bbddd..2284a677b656 100644 --- a/pkgs/servers/mautrix-telegram/default.nix +++ b/pkgs/servers/mautrix-telegram/default.nix @@ -9,28 +9,31 @@ let python = python3.override { packageOverrides = self: super: { tulir-telethon = self.telethon.overridePythonAttrs (oldAttrs: rec { - version = "1.27.0a1"; + version = "1.27.0a7"; pname = "tulir-telethon"; src = super.fetchPypi { inherit pname version; - sha256 = "sha256-tABAY4UlTyMK1ZafIFawegjBAtcnq3HMNbE1L6WaT3E="; + sha256 = "sha256-w4WILvLvJBKf3Nlj0omTCDDD4z+b0XFlCplQ/IHwIPs="; }; doCheck = false; }); }; }; -in python.pkgs.buildPythonPackage rec { +in +python.pkgs.buildPythonPackage rec { pname = "mautrix-telegram"; - version = "0.12.2"; + version = "unstable-2023-01-28"; disabled = python.pythonOlder "3.8"; src = fetchFromGitHub { owner = "mautrix"; repo = "telegram"; - rev = "v${version}"; - sha256 = "sha256-htCk0VLr6GfXbpYWF/2bmpko7gSVlkH6HwDjOMhW8is="; + rev = "f12abbe03846fd5897d58572ab24b70a58b337d2"; + sha256 = "sha256-5ZZ85FOmTO26q2zhAIsF7mTlN4BLNLW2dQF+0culkUM="; }; + format = "setuptools"; + patches = [ ./0001-Re-add-entrypoint.patch ]; propagatedBuildInputs = with python.pkgs; ([ @@ -43,19 +46,24 @@ in python.pkgs.buildPythonPackage rec { tulir-telethon asyncpg Mako - # optional + # speedups cryptg - cchardet aiodns brotli + # qr_login pillow qrcode + # formattednumbers phonenumbers + # metrics prometheus-client + # sqlite aiosqlite ] ++ lib.optionals withHQthumbnails [ + # hq_thumbnails moviepy ] ++ lib.optionals withE2BE [ + # e2be python-olm pycryptodome unpaddedbase64 From e139718d5f109e24e4ba4fea5120fc7708f8e2ea Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 31 Jan 2023 13:52:58 +0800 Subject: [PATCH 4/5] mautrix-signal: use pythonRelaxDepsHook --- pkgs/servers/mautrix-signal/default.nix | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/pkgs/servers/mautrix-signal/default.nix b/pkgs/servers/mautrix-signal/default.nix index 7aada1e2eed5..8ff6f1d36694 100644 --- a/pkgs/servers/mautrix-signal/default.nix +++ b/pkgs/servers/mautrix-signal/default.nix @@ -11,6 +11,20 @@ python3.pkgs.buildPythonPackage rec { sha256 = "sha256-UbetU1n9zD/mVFaJc9FECDq/Zell1TI/aYPsGXGB8Js="; }; + postPatch = '' + # the version mangling in mautrix_signal/get_version.py interacts badly with pythonRelaxDepsHook + substituteInPlace setup.py \ + --replace 'version=version' 'version="${version}"' + ''; + + nativeBuildInputs = with python3.pkgs; [ + pythonRelaxDepsHook + ]; + + pythonRelaxDeps = [ + "mautrix" + ]; + propagatedBuildInputs = with python3.pkgs; [ CommonMark aiohttp @@ -31,12 +45,6 @@ python3.pkgs.buildPythonPackage rec { doCheck = false; - postPatch = '' - substituteInPlace requirements.txt \ - --replace "asyncpg>=0.20,<0.26" "asyncpg>=0.20" \ - --replace "mautrix>=0.16.0,<0.17" "mautrix>=0.16.0" - ''; - postInstall = '' mkdir -p $out/bin From f2cd0189ec04db6227d8e5f927b6500f0e538444 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 31 Jan 2023 14:02:37 +0800 Subject: [PATCH 5/5] mautrix-googlechat: 0.4.0 -> unstable-2023-01-25 --- pkgs/servers/mautrix-googlechat/default.nix | 35 ++++++++++----------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/pkgs/servers/mautrix-googlechat/default.nix b/pkgs/servers/mautrix-googlechat/default.nix index db1f7c6d1f25..74389663455f 100644 --- a/pkgs/servers/mautrix-googlechat/default.nix +++ b/pkgs/servers/mautrix-googlechat/default.nix @@ -1,17 +1,19 @@ -{ fetchFromGitHub, fetchpatch +{ fetchFromGitHub +, fetchpatch , lib , python3 -, protobuf3_20 -, enableE2be ? true, enableMetrics ? true, enableSqlite ? true +, enableE2be ? true +, enableMetrics ? true +, enableSqlite ? true }: python3.pkgs.buildPythonApplication rec { pname = "mautrix-googlechat"; - version = "0.4.0"; + version = "unstable-2023-01-25"; src = fetchFromGitHub { owner = "mautrix"; repo = "googlechat"; - rev = "v${version}"; - sha256 = "sha256-UVWYT0HTOUEkBG0n6KNhCSSO/2PAF1rIvCaw478z+q0="; + rev = "e2eb528745466468f059c506c22e500e0cd832aa"; + sha256 = "sha256-FNlEHzuy89RuFUwZPmVA+4AmpQHGD+18BguGC6qBdBM="; }; patches = [ @@ -24,13 +26,6 @@ }) ]; - doCheck = false; - - postPatch = '' - sed -i requirements.txt \ - -e 's/asyncpg>=.*/asyncpg/' - ''; - baseConfigPath = "share/mautrix-googlechat/example-config.yaml"; postInstall = '' rm $out/example-config.yaml @@ -43,8 +38,12 @@ pycryptodome unpaddedbase64 ]; - metrics = [ prometheus-client ]; - sqlite = [ aiosqlite ]; + metrics = [ + prometheus-client + ]; + sqlite = [ + aiosqlite + ]; }; propagatedBuildInputs = with python3.pkgs; [ @@ -54,14 +53,14 @@ ruamel-yaml CommonMark python-magic - (protobuf.override { - protobuf = protobuf3_20; - }) + protobuf3 mautrix ] ++ lib.optionals enableE2be passthru.optional-dependencies.e2be ++ lib.optionals enableMetrics passthru.optional-dependencies.metrics ++ lib.optionals enableSqlite passthru.optional-dependencies.sqlite; + doCheck = false; + meta = with lib; { homepage = "https://github.com/mautrix/googlechat"; description = "A Matrix-Google Chat puppeting bridge";