summary refs log tree commit diff
path: root/pkgs/development/python-modules/screeninfo/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/screeninfo/default.nix')
-rw-r--r--pkgs/development/python-modules/screeninfo/default.nix13
1 files changed, 8 insertions, 5 deletions
diff --git a/pkgs/development/python-modules/screeninfo/default.nix b/pkgs/development/python-modules/screeninfo/default.nix
index 886854d1f2a..dc794513fc4 100644
--- a/pkgs/development/python-modules/screeninfo/default.nix
+++ b/pkgs/development/python-modules/screeninfo/default.nix
@@ -25,11 +25,14 @@ buildPythonApplication rec {
     dataclasses
   ];
 
-  buildInputs = [
-    libX11
-    libXinerama
-    libXrandr
-  ];
+  postPatch = ''
+    substituteInPlace screeninfo/enumerators/xinerama.py \
+      --replace 'load_library("X11")' 'ctypes.cdll.LoadLibrary("${libX11}/lib/libX11.so")' \
+      --replace 'load_library("Xinerama")' 'ctypes.cdll.LoadLibrary("${libXinerama}/lib/libXinerama.so")'
+    substituteInPlace screeninfo/enumerators/xrandr.py \
+      --replace 'load_library("X11")' 'ctypes.cdll.LoadLibrary("${libX11}/lib/libX11.so")' \
+      --replace 'load_library("Xrandr")' 'ctypes.cdll.LoadLibrary("${libXrandr}/lib/libXrandr.so")'
+  '';
 
   checkInputs = [
     pytestCheckHook