Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / web / cypress / default.nix
blob6dd616fe4f043efc4a76991b3106e9ad8a590276
1 { stdenv, lib, fetchzip, autoPatchelfHook, xorg, gtk2, gnome2, gtk3, nss, alsaLib, udev, unzip, wrapGAppsHook }:
3 stdenv.mkDerivation rec {
4   pname = "cypress";
5   version = "7.1.0";
7   src = fetchzip {
8     url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip";
9     sha256 = "1m52v6hhblrjji9c5885bn5qq0xlaw36krbmqfac7fhgsxmkxd2h";
10   };
12   # don't remove runtime deps
13   dontPatchELF = true;
15   nativeBuildInputs = [ autoPatchelfHook wrapGAppsHook unzip ];
17   buildInputs = with xorg; [
18     libXScrnSaver libXdamage libXtst libxshmfence
19   ] ++ [
20     nss gtk2 alsaLib gnome2.GConf gtk3
21   ];
23   runtimeDependencies = [ (lib.getLib udev) ];
25   installPhase = ''
26     runHook preInstall
28     mkdir -p $out/bin $out/opt/cypress
29     cp -vr * $out/opt/cypress/
30     # Let's create the file binary_state ourselves to make the npm package happy on initial verification.
31     # Cypress now verifies version by reading bin/resources/app/package.json
32     mkdir -p $out/bin/resources/app
33     printf '{"version":"%b"}' $version > $out/bin/resources/app/package.json
34     # Cypress now looks for binary_state.json in bin
35     echo '{"verified": true}' > $out/binary_state.json
36     ln -s $out/opt/cypress/Cypress $out/bin/Cypress
38     runHook postInstall
39   '';
41   meta = with lib; {
42     description = "Fast, easy and reliable testing for anything that runs in a browser";
43     homepage = "https://www.cypress.io";
44     license = licenses.mit;
45     platforms = ["x86_64-linux"];
46     maintainers = with maintainers; [ tweber mmahut ];
47   };