2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2021-09-18 10:52:07 +00:00
|
|
|
, buildPythonApplication
|
|
|
|
, dataclasses
|
|
|
|
, fetchPypi
|
|
|
|
, libX11
|
|
|
|
, libXinerama
|
|
|
|
, libXrandr
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
2020-06-18 07:06:33 +00:00
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "screeninfo";
|
2021-12-19 01:06:50 +00:00
|
|
|
version = "0.8";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-06-18 07:06:33 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-12-19 01:06:50 +00:00
|
|
|
sha256 = "9501bf8b8458c7d1be4cb0ac9abddddfa80b932fb3f65bfcb54f5586434b1dc5";
|
2020-06-18 07:06:33 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
propagatedBuildInputs = lib.optionals (pythonOlder "3.7") [
|
|
|
|
dataclasses
|
|
|
|
];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
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")'
|
|
|
|
'';
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# We don't have a screen
|
|
|
|
"screeninfo/test_screeninfo.py"
|
|
|
|
];
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
pythonImportsCheck = [ "screeninfo" ];
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2020-06-18 07:06:33 +00:00
|
|
|
description = "Fetch location and size of physical screens";
|
|
|
|
homepage = "https://github.com/rr-/screeninfo";
|
|
|
|
license = licenses.mit;
|
2021-09-18 10:52:07 +00:00
|
|
|
maintainers = with maintainers; [ nickhu ];
|
2020-06-18 07:06:33 +00:00
|
|
|
};
|
|
|
|
}
|