chromedriver: fix build failure on aarch64-darwin
Darwin seems to need `unzip` and chokes on `autoPatchelfHook`. Because linux now builds from source, the package has been updated to remove references to Linux-specific settings and build options, remove the conditionals checking for darwin, and adjust the platforms to reflect that the binary chromedriver is darwin-only. Fixes https://github.com/NixOS/nixpkgs/issues/329202
This commit is contained in:
@@ -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;
|
||||
@@ -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
|
||||
@@ -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";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user