2021-07-16 19:40:57 +00:00
|
|
|
{ alsa-lib
|
|
|
|
, autoPatchelfHook
|
|
|
|
, callPackage
|
|
|
|
, fetchzip
|
|
|
|
, gtk2
|
|
|
|
, gtk3
|
|
|
|
, lib
|
|
|
|
, mesa
|
|
|
|
, nss
|
|
|
|
, stdenv
|
|
|
|
, udev
|
|
|
|
, unzip
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsHook3
|
2021-07-16 19:40:57 +00:00
|
|
|
, xorg
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-30 22:05:00 +00:00
|
|
|
let
|
|
|
|
availableBinaries = {
|
|
|
|
x86_64-linux = {
|
|
|
|
platform = "linux-x64";
|
2023-10-09 19:29:22 +00:00
|
|
|
checksum = "sha256-9o0nprGcJhudS1LNm+T7Vf0Dwd1RBauYKI+w1FBQ3ZM=";
|
2023-03-30 22:05:00 +00:00
|
|
|
};
|
|
|
|
aarch64-linux = {
|
|
|
|
platform = "linux-arm64";
|
2023-07-15 17:15:38 +00:00
|
|
|
checksum = "sha256-aW3cUZqAdiOLzOC9BQM/bTkDVyw24Dx9nBSXgbiKe4c=";
|
2023-03-30 22:05:00 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
inherit (stdenv.hostPlatform) system;
|
|
|
|
binary = availableBinaries.${system} or (throw "cypress: No binaries available for system ${system}");
|
|
|
|
inherit (binary) platform checksum;
|
|
|
|
in stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "cypress";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "13.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
2023-03-30 22:05:00 +00:00
|
|
|
url = "https://cdn.cypress.io/desktop/${version}/${platform}/cypress.zip";
|
|
|
|
sha256 = checksum;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# don't remove runtime deps
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook wrapGAppsHook3 unzip ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = with xorg; [
|
2021-07-16 19:40:57 +00:00
|
|
|
libXScrnSaver
|
|
|
|
libXdamage
|
|
|
|
libXtst
|
|
|
|
libxshmfence
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ [
|
2021-07-16 19:40:57 +00:00
|
|
|
nss
|
|
|
|
gtk2
|
|
|
|
alsa-lib
|
|
|
|
gtk3
|
2021-04-26 19:14:03 +00:00
|
|
|
mesa # for libgbm
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
runtimeDependencies = [ (lib.getLib udev) ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-04-13 19:44:15 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +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.
|
|
|
|
# Cypress now verifies version by reading bin/resources/app/package.json
|
|
|
|
mkdir -p $out/bin/resources/app
|
|
|
|
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
|
|
|
|
ln -s $out/opt/cypress/Cypress $out/bin/Cypress
|
2021-04-13 19:44:15 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-07-16 19:40:57 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = ./update.sh;
|
|
|
|
|
|
|
|
tests = {
|
2023-03-30 22:05:00 +00:00
|
|
|
# We used to have a test here, but was removed because
|
|
|
|
# - it broke, and ofborg didn't fail https://github.com/NixOS/ofborg/issues/629
|
|
|
|
# - it had a large footprint in the repo; prefer RFC 92 or an ugly FOD fetcher?
|
|
|
|
# - the author switched away from cypress.
|
|
|
|
# To provide a test once more, you may find useful information in
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/223903
|
2021-07-16 19:40:57 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Fast, easy and reliable testing for anything that runs in a browser";
|
|
|
|
homepage = "https://www.cypress.io";
|
2022-09-22 12:36:57 +00:00
|
|
|
mainProgram = "Cypress";
|
2022-06-26 10:26:21 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2023-03-30 22:05:00 +00:00
|
|
|
platforms = lib.attrNames availableBinaries;
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ tweber mmahut Crafter ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|