2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildPythonPackage,
|
|
|
|
pytest,
|
|
|
|
pythonOlder,
|
|
|
|
xclip,
|
|
|
|
xvfb-run,
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyclip";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.7.0";
|
2022-03-30 09:31:56 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "spyoungtech";
|
|
|
|
repo = pname;
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-0nOkNgT8XCwtXI9JZntkhoMspKQU602rTKBFajVKBoM=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace docs/README.md README.md
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs =
|
|
|
|
[ pytest ]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
2024-06-05 15:53:02 +00:00
|
|
|
xclip
|
|
|
|
xvfb-run
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
2024-09-26 11:04:55 +00:00
|
|
|
${lib.optionalString stdenv.hostPlatform.isLinux "xvfb-run -s '-screen 0 800x600x24'"} pytest tests
|
2021-12-06 16:07:01 +00:00
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
meta = {
|
2024-09-26 11:04:55 +00:00
|
|
|
broken = stdenv.hostPlatform.isDarwin;
|
2021-12-06 16:07:01 +00:00
|
|
|
description = "Cross-platform clipboard utilities supporting both binary and text data";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "pyclip";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://github.com/spyoungtech/pyclip";
|
2024-01-02 11:29:13 +00:00
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ mcaju ];
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
}
|