Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions pkgs/development/tools/selenium/chromedriver/binary.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{ lib, stdenv, fetchurl, autoPatchelfHook
, glib, nspr, nss, libxcb
, testers, chromedriver
{
lib,
stdenv,
fetchurl,
unzip,
testers,
chromedriver,
}:

let
upstream-info = (import ../../../../applications/networking/browsers/chromium/upstream-info.nix).stable.chromedriver;
allSpecs = {
x86_64-linux = {
system = "linux64";
hash = upstream-info.hash_linux;
};
upstream-info =
(import ../../../../applications/networking/browsers/chromium/upstream-info.nix)
.stable.chromedriver;

# See ./source.nix for Linux
allSpecs = {
x86_64-darwin = {
system = "mac-x64";
hash = upstream-info.hash_darwin;
Expand All @@ -22,21 +25,22 @@ let
};
};

spec = allSpecs.${stdenv.hostPlatform.system}
or (throw "missing chromedriver binary for ${stdenv.hostPlatform.system}");
in stdenv.mkDerivation rec {
spec =
allSpecs.${stdenv.hostPlatform.system}
or (throw "missing chromedriver binary for ${stdenv.hostPlatform.system}");

inherit (upstream-info) version;
in
stdenv.mkDerivation {
pname = "chromedriver";
version = upstream-info.version;
inherit version;

src = fetchurl {
url = "https://storage.googleapis.com/chrome-for-testing-public/${version}/${spec.system}/chromedriver-${spec.system}.zip";
hash = spec.hash;
inherit (spec) hash;
};

nativeBuildInputs = [ autoPatchelfHook ];
buildInputs = lib.optionals (!stdenv.isDarwin) [
glib nspr nss libxcb
];
nativeBuildInputs = [ unzip ];

installPhase = ''
install -m555 -D "chromedriver" $out/bin/chromedriver
Expand All @@ -58,7 +62,7 @@ in stdenv.mkDerivation rec {
maintainers = with maintainers; [ primeos ];
# Note from primeos: By updating Chromium I also update Google Chrome and
# ChromeDriver.
platforms = attrNames allSpecs;
platforms = platforms.darwin;
mainProgram = "chromedriver";
};
}