1{
2 fetchzip,
3 revision,
4 suffix,
5 system,
6 throwSystem,
7 stdenv,
8 autoPatchelfHook,
9 patchelfUnstable,
10
11 alsa-lib,
12 at-spi2-atk,
13 glib,
14 libXcomposite,
15 libXdamage,
16 libXfixes,
17 libXrandr,
18 libgbm,
19 libgcc,
20 libxkbcommon,
21 nspr,
22 nss,
23 ...
24}:
25let
26 linux = stdenv.mkDerivation {
27 name = "playwright-chromium-headless-shell";
28 src = fetchzip {
29 url = "https://playwright.azureedge.net/builds/chromium/${revision}/chromium-headless-shell-${suffix}.zip";
30 stripRoot = false;
31 hash =
32 {
33 x86_64-linux = "sha256-AYh2urKZdjXCELimYaFihWp0FbDLf4uRrKLJZVxug5M=";
34 aarch64-linux = "sha256-diBiy0z51BxGK0PcfQOf1aryUcZesKu/UHBSZUjqwMk=";
35 }
36 .${system} or throwSystem;
37 };
38
39 nativeBuildInputs = [
40 autoPatchelfHook
41 patchelfUnstable
42 ];
43
44 buildInputs = [
45 alsa-lib
46 at-spi2-atk
47 glib
48 libXcomposite
49 libXdamage
50 libXfixes
51 libXrandr
52 libgbm
53 libgcc.lib
54 libxkbcommon
55 nspr
56 nss
57 ];
58
59 buildPhase = ''
60 cp -R . $out
61 '';
62 };
63
64 darwin = fetchzip {
65 url = "https://playwright.azureedge.net/builds/chromium/${revision}/chromium-headless-shell-${suffix}.zip";
66 stripRoot = false;
67 hash =
68 {
69 x86_64-darwin = "sha256-vIJuDjkasUYlMW0aCOyztyrlh5kvcwNR9GBaoa/yh/M=";
70 aarch64-darwin = "sha256-6Q6nz0H2749srdMF/puk/gnG1gQBEnWe9cQO3owL2OU=";
71 }
72 .${system} or throwSystem;
73 };
74in
75{
76 x86_64-linux = linux;
77 aarch64-linux = linux;
78 x86_64-darwin = darwin;
79 aarch64-darwin = darwin;
80}
81.${system} or throwSystem