Unverified Commit 3ad9d21c authored by K900's avatar K900 Committed by GitHub
Browse files

Merge pull request #329204 from n8henrie/issue_329202

chromedriver: fix build failure on aarch64-darwin
parents 3f2ba17d dc969616
Loading
Loading
Loading
Loading
+23 −19
Original line number Diff line number Diff line
{ 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;
@@ -22,21 +25,22 @@ let
    };
  };

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

  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
@@ -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";
  };
}