limo: 1.0.11 > 1.1 (#376325)
[NixPkgs.git] / pkgs / development / python-modules / screeninfo / default.nix
blobb90be59b6d662120318ee5debca28c9b06645131
2   stdenv,
3   lib,
4   buildPythonPackage,
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.7";
21   src = fetchFromGitHub {
22     owner = "rr-";
23     repo = pname;
24     tag = version;
25     hash = "sha256-TEy4wff0eRRkX98yK9054d33Tm6G6qWrd9Iv+ITcFmA=";
26   };
28   nativeBuildInputs = [ poetry-core ];
30   postPatch = ''
31     substituteInPlace screeninfo/enumerators/xinerama.py \
32       --replace 'load_library("X11")' 'ctypes.cdll.LoadLibrary("${libX11}/lib/libX11.so")' \
33       --replace 'load_library("Xinerama")' 'ctypes.cdll.LoadLibrary("${libXinerama}/lib/libXinerama.so")'
34     substituteInPlace screeninfo/enumerators/xrandr.py \
35       --replace 'load_library("X11")' 'ctypes.cdll.LoadLibrary("${libX11}/lib/libX11.so")' \
36       --replace 'load_library("Xrandr")' 'ctypes.cdll.LoadLibrary("${libXrandr}/lib/libXrandr.so")'
37   '';
39   nativeCheckInputs = [ pytestCheckHook ];
41   disabledTestPaths = [
42     # We don't have a screen
43     "tests/test_screeninfo.py"
44   ];
46   pythonImportsCheck = [ "screeninfo" ];
48   meta = with lib; {
49     broken = stdenv.hostPlatform.isDarwin;
50     description = "Fetch location and size of physical screens";
51     homepage = "https://github.com/rr-/screeninfo";
52     license = licenses.mit;
53     maintainers = with maintainers; [ nickhu ];
54   };