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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

99 lines
2.6 KiB
Nix
Raw Normal View History

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
2023-03-28 20:23:41 +02:00
let
availableBinaries = {
x86_64-linux = {
platform = "linux-x64";
2023-09-15 01:25:08 +02:00
checksum = "sha256-9o0nprGcJhudS1LNm+T7Vf0Dwd1RBauYKI+w1FBQ3ZM=";
2023-03-28 20:23:41 +02:00
};
aarch64-linux = {
platform = "linux-arm64";
2023-07-13 09:44:52 +02:00
checksum = "sha256-aW3cUZqAdiOLzOC9BQM/bTkDVyw24Dx9nBSXgbiKe4c=";
2023-03-28 20:23:41 +02: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 {
2019-07-16 15:39:08 +02:00
pname = "cypress";
2023-09-15 01:25:08 +02:00
version = "13.2.0";
2019-07-16 15:39:08 +02:00
src = fetchzip {
2023-03-28 20:23:41 +02:00
url = "https://cdn.cypress.io/desktop/${version}/${platform}/cypress.zip";
sha256 = checksum;
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
];
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.
# 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
# Cypress now looks for binary_state.json in bin
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 = {
2023-03-30 13:47:08 +02: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-06-30 19:54:23 +02: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-09-14 22:22:28 +02:00
mainProgram = "Cypress";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
2019-07-16 15:39:08 +02:00
license = licenses.mit;
2023-03-28 20:23:41 +02:00
platforms = lib.attrNames availableBinaries;
2022-07-25 21:00:56 +02:00
maintainers = with maintainers; [ tweber mmahut Crafter ];
2019-07-16 15:39:08 +02:00
};
}