2021-06-30 17:54:23 +00:00
|
|
|
{
|
|
|
|
alsa-lib,
|
|
|
|
autoPatchelfHook,
|
|
|
|
callPackage,
|
|
|
|
fetchzip,
|
|
|
|
gnome2,
|
|
|
|
gtk2,
|
|
|
|
gtk3,
|
|
|
|
lib,
|
|
|
|
mesa,
|
|
|
|
nss,
|
|
|
|
stdenv,
|
|
|
|
udev,
|
|
|
|
unzip,
|
|
|
|
wrapGAppsHook,
|
|
|
|
xorg,
|
|
|
|
}:
|
2019-07-16 13:39:08 +00:00
|
|
|
|
2020-06-07 21:11:08 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-07-16 13:39:08 +00:00
|
|
|
pname = "cypress";
|
2021-07-07 15:13:57 +00:00
|
|
|
version = "7.7.0";
|
2019-07-16 13:39:08 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip";
|
2021-07-07 15:13:57 +00:00
|
|
|
sha256 = "1mr46raha5aqi8ba0cqvyil5z4vcr46hnxqqmpk3fkrr8awd2897";
|
2019-07-16 13:39:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# don't remove runtime deps
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2021-04-12 23:13:20 +00:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook wrapGAppsHook unzip ];
|
2019-07-16 13:39:08 +00:00
|
|
|
|
|
|
|
buildInputs = with xorg; [
|
2021-04-12 23:13:20 +00:00
|
|
|
libXScrnSaver libXdamage libXtst libxshmfence
|
2019-07-16 13:39:08 +00:00
|
|
|
] ++ [
|
2021-06-10 02:57:09 +00:00
|
|
|
nss gtk2 alsa-lib gnome2.GConf gtk3
|
2021-04-09 08:56:12 +00:00
|
|
|
mesa # for libgbm
|
2019-07-16 13:39:08 +00:00
|
|
|
];
|
|
|
|
|
2020-08-12 18:29:37 +00:00
|
|
|
runtimeDependencies = [ (lib.getLib udev) ];
|
2019-07-16 13:39:08 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-04-12 23:13:20 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2019-07-16 13:39:08 +00: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.
|
2019-09-29 03:52:17 +00:00
|
|
|
# Cypress now verifies version by reading bin/resources/app/package.json
|
|
|
|
mkdir -p $out/bin/resources/app
|
2019-10-26 18:36:51 +00:00
|
|
|
printf '{"version":"%b"}' $version > $out/bin/resources/app/package.json
|
2019-09-29 03:52:17 +00:00
|
|
|
# Cypress now looks for binary_state.json in bin
|
2020-02-11 23:32:43 +00:00
|
|
|
echo '{"verified": true}' > $out/binary_state.json
|
2019-07-16 13:39:08 +00:00
|
|
|
ln -s $out/opt/cypress/Cypress $out/bin/Cypress
|
2021-04-12 23:13:20 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2019-07-16 13:39:08 +00:00
|
|
|
'';
|
|
|
|
|
2021-06-30 17:54:23 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = ./update.sh;
|
|
|
|
|
|
|
|
tests = {
|
|
|
|
example = callPackage ./cypress-example-kitchensink {};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-07-16 13:39:08 +00: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 ];
|
|
|
|
};
|
|
|
|
}
|