Files
nixpkgs/pkgs/development/python-modules/mss/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

74 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
pythonOlder,
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;
disabled = pythonOlder "3.6";
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 ];
};
}