Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / pyclip / default.nix
blobcfeb3a19916be1eb7c334b5364ecf71f9b7cb2fc
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , buildPythonPackage
5 , pytest
6 , pythonOlder
7 , xclip
8 , xvfb-run
9 }:
11 buildPythonPackage rec {
12   pname = "pyclip";
13   version = "0.7.0";
14   format = "setuptools";
16   disabled = pythonOlder "3.7";
18   src = fetchFromGitHub {
19     owner = "spyoungtech";
20     repo = pname;
21     rev = "refs/tags/v${version}";
22     hash = "sha256-0nOkNgT8XCwtXI9JZntkhoMspKQU602rTKBFajVKBoM=";
23   };
25   postPatch = ''
26     substituteInPlace setup.py \
27       --replace docs/README.md README.md
28   '';
30   nativeCheckInputs = [
31     pytest
32   ] ++ lib.optionals stdenv.isLinux [
33     xclip
34     xvfb-run
35   ];
37   checkPhase = ''
38     runHook preCheck
39     ${lib.optionalString stdenv.isLinux "xvfb-run -s '-screen 0 800x600x24'"} pytest tests
40     runHook postCheck
41   '';
43   meta = with lib; {
44     broken = stdenv.isDarwin;
45     description = "Cross-platform clipboard utilities supporting both binary and text data";
46     homepage = "https://github.com/spyoungtech/pyclip";
47     license = licenses.asl20;
48     maintainers = with maintainers; [ mcaju ];
49   };