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