mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
82 lines
1.6 KiB
Nix
82 lines
1.6 KiB
Nix
{
|
|
fetchzip,
|
|
revision,
|
|
suffix,
|
|
system,
|
|
throwSystem,
|
|
stdenv,
|
|
autoPatchelfHook,
|
|
patchelfUnstable,
|
|
|
|
alsa-lib,
|
|
at-spi2-atk,
|
|
glib,
|
|
libXcomposite,
|
|
libXdamage,
|
|
libXfixes,
|
|
libXrandr,
|
|
libgbm,
|
|
libgcc,
|
|
libxkbcommon,
|
|
nspr,
|
|
nss,
|
|
...
|
|
}:
|
|
let
|
|
linux = stdenv.mkDerivation {
|
|
name = "playwright-chromium-headless-shell";
|
|
src = fetchzip {
|
|
url = "https://playwright.azureedge.net/builds/chromium/${revision}/chromium-headless-shell-${suffix}.zip";
|
|
stripRoot = false;
|
|
hash =
|
|
{
|
|
x86_64-linux = "sha256-WCn3j9JnKqGJoQ4X2FWdghha/AxusqCYTCL0sEpA2pM=";
|
|
aarch64-linux = "sha256-IIz4E4ylXU5e4XAyqOI6yXc680Lb5bFze0VRuB8Wwck=";
|
|
}
|
|
.${system} or throwSystem;
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
autoPatchelfHook
|
|
patchelfUnstable
|
|
];
|
|
|
|
buildInputs = [
|
|
alsa-lib
|
|
at-spi2-atk
|
|
glib
|
|
libXcomposite
|
|
libXdamage
|
|
libXfixes
|
|
libXrandr
|
|
libgbm
|
|
libgcc.lib
|
|
libxkbcommon
|
|
nspr
|
|
nss
|
|
];
|
|
|
|
buildPhase = ''
|
|
cp -R . $out
|
|
'';
|
|
};
|
|
|
|
darwin = fetchzip {
|
|
url = "https://playwright.azureedge.net/builds/chromium/${revision}/chromium-headless-shell-${suffix}.zip";
|
|
stripRoot = false;
|
|
hash =
|
|
{
|
|
x86_64-darwin = "sha256-346DDhORd+wGchEpU3Tf3DSwlo8fejomgSUqmF/HmA4=";
|
|
aarch64-darwin = "sha256-3WMfwOVlap5HxLzalg8+TTlsyda/HPabJMM0T31UKlE=";
|
|
}
|
|
.${system} or throwSystem;
|
|
};
|
|
in
|
|
{
|
|
x86_64-linux = linux;
|
|
aarch64-linux = linux;
|
|
x86_64-darwin = darwin;
|
|
aarch64-darwin = darwin;
|
|
}
|
|
.${system} or throwSystem
|