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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
{
lib,
buildPythonPackage,
fetchPypi,
stdenv,
replaceVars,
# build-system
hatchling,
# native dependencies
xorg,
# tests
lsof,
pillow,
pytest-cov-stub,
pytest,
pyvirtualdisplay,
xvfb-run,
}:
buildPythonPackage rec {
pname = "mss";
version = "10.1.0";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-cYK69+4WylaeKAQCi2q5vL9r5cRvwogIQPM7UTuctPg=";
};
patches = lib.optionals stdenv.hostPlatform.isLinux [
(replaceVars ./linux-paths.patch {
x11 = "${xorg.libX11}/lib/libX11.so";
xfixes = "${xorg.libXfixes}/lib/libXfixes.so";
xrandr = "${xorg.libXrandr}/lib/libXrandr.so";
})
];
build-system = [ hatchling ];
doCheck = stdenv.hostPlatform.isLinux;
nativeCheckInputs = [
lsof
pillow
pytest-cov-stub
pytest
pyvirtualdisplay
xvfb-run
];
checkPhase = ''
runHook preCheck
xvfb-run pytest -k "not test_grab_with_tuple and not test_grab_with_tuple_percents and not test_resource_leaks"
runHook postCheck
'';
pythonImportsCheck = [ "mss" ];
meta = {
description = "Cross-platform multiple screenshots module";
mainProgram = "mss";
homepage = "https://github.com/BoboTiG/python-mss";
changelog = "https://github.com/BoboTiG/python-mss/blob/v${version}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ austinbutler ];
};
}
|