diff options
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pyclip/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/pyclip/default.nix | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pyclip/default.nix b/nixpkgs/pkgs/development/python-modules/pyclip/default.nix new file mode 100644 index 000000000000..ac79eb8293f4 --- /dev/null +++ b/nixpkgs/pkgs/development/python-modules/pyclip/default.nix @@ -0,0 +1,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 ]; + }; +} |