From dc969616d4bec9af888548330cacd29b6c68404e Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Wed, 24 Jul 2024 10:33:08 -0600 Subject: [PATCH] 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 --- .../tools/selenium/chromedriver/binary.nix | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/pkgs/development/tools/selenium/chromedriver/binary.nix b/pkgs/development/tools/selenium/chromedriver/binary.nix index 230bc558f0c97..ace1f1e8f2700 100644 --- a/pkgs/development/tools/selenium/chromedriver/binary.nix +++ b/pkgs/development/tools/selenium/chromedriver/binary.nix @@ -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"; }; }