nixpkgs/pkgs/development/web/cypress/default.nix

52 lines
1.6 KiB
Nix
Raw Normal View History

2021-04-09 01:56:12 -07:00
{ stdenv, lib, fetchzip, autoPatchelfHook, xorg, gtk2, gnome2, gtk3, nss, alsaLib, udev, unzip, wrapGAppsHook, mesa }:
2019-07-16 06:39:08 -07:00
stdenv.mkDerivation rec {
2019-07-16 06:39:08 -07:00
pname = "cypress";
2021-05-11 04:50:49 -07:00
version = "7.3.0";
2019-07-16 06:39:08 -07:00
src = fetchzip {
url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip";
2021-05-11 04:50:49 -07:00
sha256 = "158bpk4czfv2kkh1al1bb42jb0h3mbx9r72dk6crr2gg0bhabn8m";
2019-07-16 06:39:08 -07:00
};
2021-05-01 17:27:06 -07:00
passthru.updateScript = ./update.sh;
2019-07-16 06:39:08 -07:00
# don't remove runtime deps
dontPatchELF = true;
2021-04-12 16:13:20 -07:00
nativeBuildInputs = [ autoPatchelfHook wrapGAppsHook unzip ];
2019-07-16 06:39:08 -07:00
buildInputs = with xorg; [
2021-04-12 16:13:20 -07:00
libXScrnSaver libXdamage libXtst libxshmfence
2019-07-16 06:39:08 -07:00
] ++ [
2021-04-12 16:13:20 -07:00
nss gtk2 alsaLib gnome2.GConf gtk3
2021-04-09 01:56:12 -07:00
mesa # for libgbm
2019-07-16 06:39:08 -07:00
];
runtimeDependencies = [ (lib.getLib udev) ];
2019-07-16 06:39:08 -07:00
installPhase = ''
2021-04-12 16:13:20 -07:00
runHook preInstall
2019-07-16 06:39:08 -07:00
mkdir -p $out/bin $out/opt/cypress
cp -vr * $out/opt/cypress/
# Let's create the file binary_state ourselves to make the npm package happy on initial verification.
# Cypress now verifies version by reading bin/resources/app/package.json
mkdir -p $out/bin/resources/app
2019-10-26 11:36:51 -07:00
printf '{"version":"%b"}' $version > $out/bin/resources/app/package.json
# Cypress now looks for binary_state.json in bin
echo '{"verified": true}' > $out/binary_state.json
2019-07-16 06:39:08 -07:00
ln -s $out/opt/cypress/Cypress $out/bin/Cypress
2021-04-12 16:13:20 -07:00
runHook postInstall
2019-07-16 06:39:08 -07:00
'';
meta = with lib; {
2019-07-16 06:39:08 -07:00
description = "Fast, easy and reliable testing for anything that runs in a browser";
homepage = "https://www.cypress.io";
license = licenses.mit;
platforms = ["x86_64-linux"];
maintainers = with maintainers; [ tweber mmahut ];
};
}