depot/third_party/nixpkgs/pkgs/development/python-modules/pyclip/default.nix
Default email 8a45d4525b Project import generated by Copybara.
GitOrigin-RevId: 710fed5a2483f945b14f4a58af2cd3676b42d8c8
2022-03-30 11:31:56 +02:00

49 lines
1,000 B
Nix

{ lib
, stdenv
, fetchFromGitHub
, buildPythonPackage
, pytest
, pythonOlder
, xclip
, xvfb-run
}:
buildPythonPackage rec {
pname = "pyclip";
version = "0.6.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "spyoungtech";
repo = pname;
rev = "v${version}";
hash = "sha256-NCWmCp4VGwwvubqN8FUUJ0kcZbXjOEyB6+BfGky1Kj4=";
};
postPatch = ''
substituteInPlace setup.py \
--replace docs/README.md README.md
'';
checkInputs = [
pytest
] ++ lib.optionals stdenv.isLinux [
xclip
xvfb-run
];
checkPhase = ''
runHook preCheck
${lib.optionalString stdenv.isLinux "xvfb-run -s '-screen 0 800x600x24'"} pytest tests
runHook postCheck
'';
meta = with lib; {
description = "Cross-platform clipboard utilities supporting both binary and text data";
homepage = "https://github.com/spyoungtech/pyclip";
license = licenses.asl20;
maintainers = with maintainers; [ mcaju ];
};
}