about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorMartin Weinelt <hexa@darmstadt.ccc.de>2023-10-27 01:15:24 +0200
committerMartin Weinelt <hexa@darmstadt.ccc.de>2023-10-27 01:17:10 +0200
commit0ec908a1b0842ef8de85e5fef8da5847c2c9f49e (patch)
tree56f879293eae7415b1f161a7ed607824e7f6ee61 /pkgs
parent891a9ea22ba6261165dfbce1716ceecd965ec914 (diff)
python311Packages.pydbus: patch python311 compat
The package has not been updated since 2018 and has been running into
removals on python311.

Fortunately getfullargspec is a drop-in replacement for getargspec, so a
simple substitution restore life support for now.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/pydbus/default.nix35
1 files changed, 25 insertions, 10 deletions
diff --git a/pkgs/development/python-modules/pydbus/default.nix b/pkgs/development/python-modules/pydbus/default.nix
index e804b2c859988..64dafa97db7ce 100644
--- a/pkgs/development/python-modules/pydbus/default.nix
+++ b/pkgs/development/python-modules/pydbus/default.nix
@@ -1,21 +1,36 @@
-{ lib, buildPythonPackage, fetchPypi, pygobject3, pythonAtLeast }:
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, pygobject3
+}:
 
 buildPythonPackage rec {
   pname = "pydbus";
   version = "0.6.0";
+  pyproejct = true;
 
-  # Python 3.11 changed the API of the `inspect` module and pydbus was never
-  # updated to adapt; last commit was in 2018.
-  disabled = pythonAtLeast "3.11";
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "0b0gipvz7vcfa9ddmwq2jrx16d4apb0hdnl5q4i3h8jlzwp1c1s2";
+  src = fetchFromGitHub {
+    owner = "LEW21";
+    repo = "pydbus";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-F1KKXG+7dWlEbToqtF3G7wU0Sco7zH5NqzlL58jyDGw=";
   };
 
-  propagatedBuildInputs = [ pygobject3 ];
+  postPatch = ''
+    substituteInPlace pydbus/_inspect3.py \
+      --replace "getargspec" "getfullargspec"
+  '';
+
+  propagatedBuildInputs = [
+    pygobject3
+  ];
+
+  pythonImportsCheck = [
+    "pydbus"
+    "pydbus.generic"
+  ];
 
-  pythonImportsCheck = [ "pydbus" ];
+  doCheck = false; # requires a working dbus setup
 
   meta = {
     homepage = "https://github.com/LEW21/pydbus";