1a04744f74
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:
pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
for f in $(find -name '*.nix'); do
grep -q "$pattern" "$f" || continue
sed -i "/$pattern/d" "$f"
if [ $(grep -c pythonOlder "$f") == 1 ]; then
sed -i '/^\s*pythonOlder,\s*$/d' "$f"
fi
nixfmt "$f"
done
71 lines
1.4 KiB
Nix
71 lines
1.4 KiB
Nix
{
|
|
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 ];
|
|
};
|
|
}
|