|
8 | 8 | suffix, |
9 | 9 | system, |
10 | 10 | throwSystem, |
| 11 | + lib, |
| 12 | + alsa-lib, |
| 13 | + at-spi2-atk, |
| 14 | + atk, |
| 15 | + autoPatchelfHook, |
| 16 | + cairo, |
| 17 | + cups, |
| 18 | + dbus, |
| 19 | + expat, |
| 20 | + glib, |
| 21 | + gobject-introspection, |
| 22 | + libGL, |
| 23 | + libgbm, |
| 24 | + libgcc, |
| 25 | + libxkbcommon, |
| 26 | + nspr, |
| 27 | + nss, |
| 28 | + pango, |
| 29 | + patchelf, |
| 30 | + pciutils, |
| 31 | + stdenv, |
| 32 | + systemd, |
| 33 | + vulkan-loader, |
| 34 | + xorg, |
11 | 35 | ... |
12 | 36 | }: |
13 | 37 | let |
14 | | - chromium-linux = |
15 | | - runCommand "playwright-chromium" |
16 | | - { |
17 | | - nativeBuildInputs = [ |
18 | | - makeWrapper |
19 | | - ]; |
20 | | - } |
21 | | - '' |
22 | | - mkdir -p $out/chrome-linux |
| 38 | + chromium-linux = stdenv.mkDerivation { |
| 39 | + name = "playwright-chromium"; |
| 40 | + src = fetchzip { |
| 41 | + url = "https://playwright.azureedge.net/builds/chromium/${revision}/chromium-${suffix}.zip"; |
| 42 | + hash = |
| 43 | + { |
| 44 | + x86_64-linux = "sha256-9bK8HOGoQY5kYYfJypYHeuAoVlXIh/1tv1IsXPpUTpA="; |
| 45 | + aarch64-linux = "sha256-KL6tYnPDszXjCHiSNOPHLtz839JPljSOoP7biQfTTAI="; |
| 46 | + } |
| 47 | + .${system} or throwSystem; |
| 48 | + }; |
| 49 | + |
| 50 | + nativeBuildInputs = [ |
| 51 | + autoPatchelfHook |
| 52 | + patchelf |
| 53 | + makeWrapper |
| 54 | + ]; |
| 55 | + buildInputs = [ |
| 56 | + alsa-lib |
| 57 | + at-spi2-atk |
| 58 | + atk |
| 59 | + cairo |
| 60 | + cups |
| 61 | + dbus |
| 62 | + expat |
| 63 | + glib |
| 64 | + gobject-introspection |
| 65 | + libgbm |
| 66 | + libgcc |
| 67 | + libxkbcommon |
| 68 | + nspr |
| 69 | + nss |
| 70 | + pango |
| 71 | + stdenv.cc.cc.lib |
| 72 | + systemd |
| 73 | + xorg.libX11 |
| 74 | + xorg.libXcomposite |
| 75 | + xorg.libXdamage |
| 76 | + xorg.libXext |
| 77 | + xorg.libXfixes |
| 78 | + xorg.libXrandr |
| 79 | + xorg.libxcb |
| 80 | + ]; |
| 81 | + |
| 82 | + installPhase = '' |
| 83 | + runHook preInstall |
| 84 | +
|
| 85 | + mkdir -p $out/chrome-linux |
| 86 | + cp -R . $out/chrome-linux |
23 | 87 |
|
24 | | - # See here for the Chrome options: |
25 | | - # https://github.com/NixOS/nixpkgs/issues/136207#issuecomment-908637738 |
26 | | - # We add --disable-gpu to be able to run in gpu-less environments such |
27 | | - # as headless nixos test vms. |
28 | | - makeWrapper ${chromium}/bin/chromium $out/chrome-linux/chrome \ |
29 | | - --set-default SSL_CERT_FILE /etc/ssl/certs/ca-bundle.crt \ |
30 | | - --set-default FONTCONFIG_FILE ${fontconfig_file} |
31 | | - ''; |
| 88 | + wrapProgram $out/chrome-linux/chrome \ |
| 89 | + --set-default SSL_CERT_FILE /etc/ssl/certs/ca-bundle.crt \ |
| 90 | + --set-default FONTCONFIG_FILE ${fontconfig_file} |
| 91 | +
|
| 92 | + runHook postInstall |
| 93 | + ''; |
| 94 | + |
| 95 | + appendRunpaths = lib.makeLibraryPath [ |
| 96 | + libGL |
| 97 | + vulkan-loader |
| 98 | + pciutils |
| 99 | + ]; |
| 100 | + |
| 101 | + postFixup = '' |
| 102 | + # replace bundled vulkan-loader since we are also already adding our own to RPATH |
| 103 | + rm "$out/chrome-linux/libvulkan.so.1" |
| 104 | + ln -s -t "$out/chrome-linux" "${lib.getLib vulkan-loader}/lib/libvulkan.so.1" |
| 105 | + ''; |
| 106 | + }; |
32 | 107 | chromium-darwin = fetchzip { |
33 | 108 | url = "https://playwright.azureedge.net/builds/chromium/${revision}/chromium-${suffix}.zip"; |
34 | 109 | stripRoot = false; |
|
0 commit comments