summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/pyscreeze/default.nix
blob: ce819f7b2956342b9c02b29fe66830d65113621a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchFromGitHub,
  pillow,
  xlib,
  xvfb-run,
  scrot,
}:
buildPythonPackage {
  pname = "pyscreeze";
  version = "0.1.26";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "asweigart";
    repo = "pyscreeze";
    rev = "28ab707dceecbdd135a9491c3f8effd3a69680af";
    hash = "sha256-gn3ydjf/msdhIhngGlhK+jhEyFy0qGeDr58E7kM2YZs=";
  };

  pythonImportsCheck = [ "pyscreeze" ];
  doCheck = stdenv.hostPlatform.isLinux;
  nativeCheckInputs = lib.optionals stdenv.hostPlatform.isLinux [
    scrot
    xlib
    xvfb-run
  ];
  checkPhase = lib.optionalString stdenv.hostPlatform.isLinux ''
    python -m unittest tests.test_pillow_unavailable
    xvfb-run python -m unittest tests.test_pyscreeze
  '';

  propagatedBuildInputs = [ pillow ];

  meta = {
    description = "PyScreeze is a simple, cross-platform screenshot module for Python 2 and 3";
    homepage = "https://github.com/asweigart/pyscreeze";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ lucasew ];
  };
}