2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
libX11,
|
|
|
|
libXinerama,
|
|
|
|
libXrandr,
|
|
|
|
poetry-core,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
2021-09-18 10:52:07 +00:00
|
|
|
}:
|
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
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
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
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ poetry-core ];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
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
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ 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
|
|
|
};
|
|
|
|
}
|