2021-07-15 10:42:21 +02:00
|
|
|
{ alsa-lib
|
|
|
|
, autoPatchelfHook
|
|
|
|
, callPackage
|
|
|
|
, fetchzip
|
|
|
|
, gtk2
|
|
|
|
, gtk3
|
|
|
|
, lib
|
|
|
|
, mesa
|
|
|
|
, nss
|
|
|
|
, stdenv
|
|
|
|
, udev
|
|
|
|
, unzip
|
|
|
|
, wrapGAppsHook
|
|
|
|
, xorg
|
2021-06-30 19:54:23 +02:00
|
|
|
}:
|
2019-07-16 15:39:08 +02:00
|
|
|
|
2020-06-07 23:11:08 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-07-16 15:39:08 +02:00
|
|
|
pname = "cypress";
|
2022-07-25 23:23:22 +02:00
|
|
|
version = "10.3.1";
|
2019-07-16 15:39:08 +02:00
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://cdn.cypress.io/desktop/${version}/linux-x64/cypress.zip";
|
2022-07-25 23:23:22 +02:00
|
|
|
sha256 = "sha256-LfvTnvOGFFZn7tUQ150fCO0gw7TK6JJj+Ys75VjJJ2M=";
|
2019-07-16 15:39:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# don't remove runtime deps
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2021-04-13 01:13:20 +02:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook wrapGAppsHook unzip ];
|
2019-07-16 15:39:08 +02:00
|
|
|
|
|
|
|
buildInputs = with xorg; [
|
2021-07-15 10:42:21 +02:00
|
|
|
libXScrnSaver
|
|
|
|
libXdamage
|
|
|
|
libXtst
|
|
|
|
libxshmfence
|
2019-07-16 15:39:08 +02:00
|
|
|
] ++ [
|
2021-07-15 10:42:21 +02:00
|
|
|
nss
|
|
|
|
gtk2
|
|
|
|
alsa-lib
|
|
|
|
gtk3
|
2021-04-09 10:56:12 +02:00
|
|
|
mesa # for libgbm
|
2019-07-16 15:39:08 +02:00
|
|
|
];
|
|
|
|
|
2020-08-12 20:29:37 +02:00
|
|
|
runtimeDependencies = [ (lib.getLib udev) ];
|
2019-07-16 15:39:08 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-04-13 01:13:20 +02:00
|
|
|
runHook preInstall
|
|
|
|
|
2019-07-16 15:39:08 +02: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 05:52:17 +02:00
|
|
|
# Cypress now verifies version by reading bin/resources/app/package.json
|
|
|
|
mkdir -p $out/bin/resources/app
|
2019-10-26 20:36:51 +02:00
|
|
|
printf '{"version":"%b"}' $version > $out/bin/resources/app/package.json
|
2019-09-29 05:52:17 +02:00
|
|
|
# Cypress now looks for binary_state.json in bin
|
2020-02-12 00:32:43 +01:00
|
|
|
echo '{"verified": true}' > $out/binary_state.json
|
2019-07-16 15:39:08 +02:00
|
|
|
ln -s $out/opt/cypress/Cypress $out/bin/Cypress
|
2021-04-13 01:13:20 +02:00
|
|
|
|
|
|
|
runHook postInstall
|
2019-07-16 15:39:08 +02:00
|
|
|
'';
|
|
|
|
|
2021-06-30 19:54:23 +02:00
|
|
|
passthru = {
|
|
|
|
updateScript = ./update.sh;
|
|
|
|
|
|
|
|
tests = {
|
2021-07-15 10:42:21 +02:00
|
|
|
example = callPackage ./cypress-example-kitchensink { };
|
2021-06-30 19:54:23 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-07-16 15:39:08 +02:00
|
|
|
description = "Fast, easy and reliable testing for anything that runs in a browser";
|
|
|
|
homepage = "https://www.cypress.io";
|
2022-06-10 01:42:40 +02:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2019-07-16 15:39:08 +02:00
|
|
|
license = licenses.mit;
|
2021-07-15 10:42:21 +02:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2022-07-25 21:00:56 +02:00
|
|
|
maintainers = with maintainers; [ tweber mmahut Crafter ];
|
2019-07-16 15:39:08 +02:00
|
|
|
};
|
|
|
|
}
|