2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2022-10-30 15:09:59 +00:00
|
|
|
, buildPythonPackage
|
2021-09-18 10:52:07 +00:00
|
|
|
, dataclasses
|
2022-09-30 11:47:45 +00:00
|
|
|
, fetchFromGitHub
|
2021-09-18 10:52:07 +00:00
|
|
|
, libX11
|
|
|
|
, libXinerama
|
|
|
|
, libXrandr
|
2022-09-30 11:47:45 +00:00
|
|
|
, poetry-core
|
2021-09-18 10:52:07 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
}:
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
buildPythonPackage rec {
|
2020-06-18 07:06:33 +00:00
|
|
|
pname = "screeninfo";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "0.8.1";
|
|
|
|
format = "pyproject";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rr-";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-TEy4wff0eRRkX98yK9054d33Tm6G6qWrd9Iv+ITcFmA=";
|
2020-06-18 07:06:33 +00:00
|
|
|
};
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
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
|
2022-09-30 11:47:45 +00:00
|
|
|
"tests/test_screeninfo.py"
|
2021-09-18 10:52:07 +00:00
|
|
|
];
|
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
|
|
|
};
|
|
|
|
}
|