Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
111 lines
2.5 KiB
Nix
111 lines
2.5 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchurl,
|
|
glib,
|
|
xorg,
|
|
nspr,
|
|
nss,
|
|
autoPatchelfHook,
|
|
unzip,
|
|
}:
|
|
|
|
version: hashes:
|
|
let
|
|
pname = "electron-chromedriver";
|
|
|
|
meta = with lib; {
|
|
homepage = "https://www.electronjs.org/";
|
|
description = "WebDriver server for running Selenium tests on Chrome";
|
|
longDescription = ''
|
|
WebDriver is an open source tool for automated testing of webapps across
|
|
many browsers. It provides capabilities for navigating to web pages, user
|
|
input, JavaScript execution, and more. ChromeDriver is a standalone
|
|
server that implements the W3C WebDriver standard. This is
|
|
an unofficial build of ChromeDriver compiled by the Electronjs
|
|
project.
|
|
'';
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [
|
|
liammurphy14
|
|
yayayayaka
|
|
];
|
|
platforms = [
|
|
"x86_64-darwin"
|
|
"x86_64-linux"
|
|
"armv7l-linux"
|
|
"aarch64-linux"
|
|
"aarch64-darwin"
|
|
];
|
|
mainProgram = "chromedriver";
|
|
};
|
|
|
|
fetcher =
|
|
vers: tag: hash:
|
|
fetchurl {
|
|
url = "https://github.com/electron/electron/releases/download/v${vers}/chromedriver-v${vers}-${tag}.zip";
|
|
sha256 = hash;
|
|
};
|
|
|
|
tags = {
|
|
x86_64-linux = "linux-x64";
|
|
aarch64-linux = "linux-arm64";
|
|
armv7l-linux = "linux-armv7l";
|
|
x86_64-darwin = "darwin-x64";
|
|
aarch64-darwin = "darwin-arm64";
|
|
};
|
|
|
|
get = as: platform: as.${platform.system} or (throw "Unsupported system: ${platform.system}");
|
|
|
|
common = platform: {
|
|
inherit pname version meta;
|
|
src = fetcher version (get tags platform) (get hashes platform);
|
|
|
|
buildInputs = [
|
|
(lib.getLib stdenv.cc.cc)
|
|
glib
|
|
xorg.libxcb
|
|
nspr
|
|
nss
|
|
];
|
|
};
|
|
|
|
linux = {
|
|
nativeBuildInputs = [
|
|
autoPatchelfHook
|
|
unzip
|
|
];
|
|
|
|
dontUnpack = true;
|
|
dontBuild = true;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
unzip $src
|
|
install -m777 -D chromedriver $out/bin/chromedriver
|
|
runHook postInstall
|
|
'';
|
|
};
|
|
|
|
darwin = {
|
|
nativeBuildInputs = [ unzip ];
|
|
|
|
dontUnpack = true;
|
|
dontBuild = true;
|
|
|
|
# darwin distributions come with libffmpeg dependency + icudtl.dat file
|
|
installPhase = ''
|
|
runHook preInstall
|
|
unzip $src
|
|
install -m777 -D chromedriver $out/bin/chromedriver
|
|
cp libffmpeg.dylib $out/bin/libffmpeg.dylib
|
|
cp icudtl.dat $out/bin/icudtl.dat
|
|
runHook postInstall
|
|
'';
|
|
};
|
|
in
|
|
stdenv.mkDerivation (
|
|
(common stdenv.hostPlatform) // (if stdenv.hostPlatform.isDarwin then darwin else linux)
|
|
)
|