diff --git a/pkgs/development/python-modules/screeninfo/default.nix b/pkgs/development/python-modules/screeninfo/default.nix index 508d4d3e0f1a..a049c289cd74 100644 --- a/pkgs/development/python-modules/screeninfo/default.nix +++ b/pkgs/development/python-modules/screeninfo/default.nix @@ -7,6 +7,8 @@ libXinerama, libXrandr, poetry-core, + pyobjc-framework-Cocoa, + cython, pytestCheckHook, pythonOlder, }: @@ -25,9 +27,14 @@ buildPythonPackage rec { hash = "sha256-TEy4wff0eRRkX98yK9054d33Tm6G6qWrd9Iv+ITcFmA="; }; - nativeBuildInputs = [ poetry-core ]; + build-system = [ poetry-core ]; - postPatch = '' + dependencies = lib.optionals (stdenv.isDarwin) [ + pyobjc-framework-Cocoa + cython + ]; + + postPatch = lib.optionalString (stdenv.isLinux) '' 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")' @@ -46,7 +53,6 @@ buildPythonPackage rec { pythonImportsCheck = [ "screeninfo" ]; meta = { - broken = stdenv.hostPlatform.isDarwin; description = "Fetch location and size of physical screens"; homepage = "https://github.com/rr-/screeninfo"; license = lib.licenses.mit;