From d2e41f147f6a4b4930393077822a6738a80ac283 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 11 Mar 2024 16:42:20 +0100 Subject: matrix-synapse: pin netaddr at 1.0.0 Netaddr 1.1.0 changes the behavior for partial address expansion, making two tests fail: - test_get_user_by_req_appservice_valid_token_bad_ip - test_get_user_by_req_appservice_valid_token_good_ip --- pkgs/servers/matrix-synapse/default.nix | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'pkgs/servers/matrix-synapse') diff --git a/pkgs/servers/matrix-synapse/default.nix b/pkgs/servers/matrix-synapse/default.nix index 2370dbc94349d..0905276162579 100644 --- a/pkgs/servers/matrix-synapse/default.nix +++ b/pkgs/servers/matrix-synapse/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, fetchPypi , python3 , openssl , libiconv @@ -12,10 +13,24 @@ }: let - plugins = python3.pkgs.callPackage ./plugins { }; + python = python3.override { + packageOverrides = self: super: { + netaddr = super.netaddr.overridePythonAttrs (oldAttrs: rec { + version = "1.0.0"; + + src = fetchPypi { + pname = "netaddr"; + inherit version; + hash = "sha256-6wRrVTVOelv4AcBJAq6SO9aZGQJC2JsJnolvmycktNM="; + }; + }); + }; + }; + + plugins = python.pkgs.callPackage ./plugins { }; tools = callPackage ./tools { }; in -python3.pkgs.buildPythonApplication rec { +python.pkgs.buildPythonApplication rec { pname = "matrix-synapse"; version = "1.102.0"; format = "pyproject"; @@ -48,7 +63,7 @@ python3.pkgs.buildPythonApplication rec { sed -i 's/Pillow = ".*"/Pillow = ">=5.4.0"/' pyproject.toml ''; - nativeBuildInputs = with python3.pkgs; [ + nativeBuildInputs = with python.pkgs; [ poetry-core rustPlatform.cargoSetupHook setuptools-rust @@ -62,7 +77,7 @@ python3.pkgs.buildPythonApplication rec { libiconv ]; - propagatedBuildInputs = with python3.pkgs; [ + propagatedBuildInputs = with python.pkgs; [ attrs bcrypt bleach @@ -95,7 +110,7 @@ python3.pkgs.buildPythonApplication rec { ] ++ twisted.optional-dependencies.tls; - passthru.optional-dependencies = with python3.pkgs; { + passthru.optional-dependencies = with python.pkgs; { postgres = if isPyPy then [ psycopg2cffi ] else [ @@ -133,7 +148,7 @@ python3.pkgs.buildPythonApplication rec { nativeCheckInputs = [ openssl - ] ++ (with python3.pkgs; [ + ] ++ (with python.pkgs; [ mock parameterized ]) @@ -154,15 +169,14 @@ python3.pkgs.buildPythonApplication rec { NIX_BUILD_CORES=4 fi - PYTHONPATH=".:$PYTHONPATH" ${python3.interpreter} -m twisted.trial -j $NIX_BUILD_CORES tests + PYTHONPATH=".:$PYTHONPATH" ${python.interpreter} -m twisted.trial -j $NIX_BUILD_CORES tests runHook postCheck ''; passthru = { tests = { inherit (nixosTests) matrix-synapse matrix-synapse-workers; }; - inherit plugins tools; - python = python3; + inherit plugins tools python; }; meta = with lib; { -- cgit 1.4.1