summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyclip/default.nix
blob: ac79eb8293f4d6d3374758e4e2b4f0703f59baaf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ lib
, stdenv
, fetchFromGitHub
, buildPythonPackage
, pytest
, xclip
, xvfb-run
}:

buildPythonPackage rec {
  pname = "pyclip";
  version = "0.5.4";

  src = fetchFromGitHub {
    owner = "spyoungtech";
    repo = pname;
    rev = "v${version}";
    sha256 = "19ff9cgnfx03mbmy5zpbdi986ppx38a5jf97vkqnic4g5sd1qyrn";
  };

  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 ];
  };
}