nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 50 lines 1.0 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 buildPythonPackage, 6 pytest, 7 xclip, 8 xvfb-run, 9}: 10 11buildPythonPackage rec { 12 pname = "pyclip"; 13 version = "0.7.0"; 14 format = "setuptools"; 15 16 src = fetchFromGitHub { 17 owner = "spyoungtech"; 18 repo = "pyclip"; 19 tag = "v${version}"; 20 hash = "sha256-0nOkNgT8XCwtXI9JZntkhoMspKQU602rTKBFajVKBoM="; 21 }; 22 23 postPatch = '' 24 substituteInPlace setup.py \ 25 --replace docs/README.md README.md 26 ''; 27 28 nativeCheckInputs = [ 29 pytest 30 ] 31 ++ lib.optionals stdenv.hostPlatform.isLinux [ 32 xclip 33 xvfb-run 34 ]; 35 36 checkPhase = '' 37 runHook preCheck 38 ${lib.optionalString stdenv.hostPlatform.isLinux "xvfb-run -s '-screen 0 800x600x24'"} pytest tests 39 runHook postCheck 40 ''; 41 42 meta = { 43 broken = stdenv.hostPlatform.isDarwin; 44 description = "Cross-platform clipboard utilities supporting both binary and text data"; 45 mainProgram = "pyclip"; 46 homepage = "https://github.com/spyoungtech/pyclip"; 47 license = lib.licenses.asl20; 48 maintainers = [ ]; 49 }; 50}