about summary refs log tree commit diff
path: root/pkgs/servers/matrix-synapse
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2024-03-11 16:42:20 +0100
committerMartin Weinelt <hexa@darmstadt.ccc.de>2024-03-12 18:25:12 +0100
commitd2e41f147f6a4b4930393077822a6738a80ac283 (patch)
tree14bc492fed027101e1cfe33b493aaa4098ab27ff /pkgs/servers/matrix-synapse
parentbf0578aa9045fdad5806318204259d90e06f06cd (diff)
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
Diffstat (limited to 'pkgs/servers/matrix-synapse')
-rw-r--r--pkgs/servers/matrix-synapse/default.nix32
1 files changed, 23 insertions, 9 deletions
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; {