From 9553b2f0b6c11d2071a0ad40401234b4b2a397fa Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 15 Dec 2025 15:40:16 +0100 Subject: [PATCH] python3Packages.python-dbusmock: backport networkmanager 1.54.2 fix This is included in the latest release of dbusmock, but we can't update to that without a compatibility fix for polkit, which would need to go through staging. We already have the networkmanager update (which has security fixes): in master, so for now, backport the patch without causing a mass rebuild. We can then revert this on staging. Fixes: 403d46a327f1 ("networkmanager: 1.54.1 -> 1.54.3") --- pkgs/by-name/po/polkit/package.nix | 4 ++-- .../python-modules/python-dbusmock/default.nix | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/po/polkit/package.nix b/pkgs/by-name/po/polkit/package.nix index f269b0ee61bb..f804931304d8 100644 --- a/pkgs/by-name/po/polkit/package.nix +++ b/pkgs/by-name/po/polkit/package.nix @@ -116,10 +116,10 @@ stdenv.mkDerivation rec { (python3.pythonOnBuildForHost.withPackages ( pp: with pp; [ dbus-python - (python-dbusmock.overridePythonAttrs (attrs: { + (python-dbusmock.override { # Avoid dependency cycle. doCheck = false; - })) + }) ] )) ]; diff --git a/pkgs/development/python-modules/python-dbusmock/default.nix b/pkgs/development/python-modules/python-dbusmock/default.nix index 804d40f32bfd..6465fb7014ac 100644 --- a/pkgs/development/python-modules/python-dbusmock/default.nix +++ b/pkgs/development/python-modules/python-dbusmock/default.nix @@ -2,6 +2,7 @@ lib, buildPythonPackage, fetchFromGitHub, + fetchpatch, runCommand, # build-system @@ -12,6 +13,7 @@ dbus-python, # checks + doCheck ? true, dbus, gobject-introspection, pygobject3, @@ -40,6 +42,14 @@ buildPythonPackage rec { hash = "sha256-9YnMOQUuwAcrL0ZaQr7iGly9esZaSRIFThQRNUtSndo="; }; + patches = lib.optionals doCheck [ + (fetchpatch { + name = "networkmanager-1.54.2.patch"; + url = "https://github.com/martinpitt/python-dbusmock/commit/1ce6196a687d324a55fbf1f74e0f66a4e83f7a15.patch"; + hash = "sha256-Wo7AhmZu74cTHT9I36+NGGSU9dcFwmcDvtzgseTj/yA="; + }) + ]; + build-system = [ setuptools setuptools-scm @@ -47,6 +57,8 @@ buildPythonPackage rec { dependencies = [ dbus-python ]; + inherit doCheck; + nativeCheckInputs = [ dbus gobject-introspection