ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / screeninfo / default.nix
blob574d3159494ac078d3d1b9b126880faf50e72d41
1 { stdenv
2 , lib
3 , buildPythonPackage
4 , dataclasses
5 , fetchFromGitHub
6 , libX11
7 , libXinerama
8 , libXrandr
9 , poetry-core
10 , pytestCheckHook
11 , pythonOlder
14 buildPythonPackage rec {
15   pname = "screeninfo";
16   version = "0.8.1";
17   format = "pyproject";
19   disabled = pythonOlder "3.6";
21   src = fetchFromGitHub {
22     owner = "rr-";
23     repo = pname;
24     rev = "refs/tags/${version}";
25     hash = "sha256-TEy4wff0eRRkX98yK9054d33Tm6G6qWrd9Iv+ITcFmA=";
26   };
28   nativeBuildInputs = [
29     poetry-core
30   ];
32   propagatedBuildInputs = lib.optionals (pythonOlder "3.7") [
33     dataclasses
34   ];
36   postPatch = ''
37     substituteInPlace screeninfo/enumerators/xinerama.py \
38       --replace 'load_library("X11")' 'ctypes.cdll.LoadLibrary("${libX11}/lib/libX11.so")' \
39       --replace 'load_library("Xinerama")' 'ctypes.cdll.LoadLibrary("${libXinerama}/lib/libXinerama.so")'
40     substituteInPlace screeninfo/enumerators/xrandr.py \
41       --replace 'load_library("X11")' 'ctypes.cdll.LoadLibrary("${libX11}/lib/libX11.so")' \
42       --replace 'load_library("Xrandr")' 'ctypes.cdll.LoadLibrary("${libXrandr}/lib/libXrandr.so")'
43   '';
45   checkInputs = [
46     pytestCheckHook
47   ];
49   disabledTestPaths = [
50     # We don't have a screen
51     "tests/test_screeninfo.py"
52   ];
54   pythonImportsCheck = [ "screeninfo" ];
56   meta = with lib; {
57     broken = stdenv.isDarwin;
58     description = "Fetch location and size of physical screens";
59     homepage = "https://github.com/rr-/screeninfo";
60     license = licenses.mit;
61     maintainers = with maintainers; [ nickhu ];
62   };