nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 76 lines 2.4 kB view raw
1{ lib, stdenv, fetchurl, unzip, makeWrapper 2, cairo, fontconfig, freetype, gdk-pixbuf, glib 3, glibc, gtk2, libX11, nspr, nss, pango 4, libxcb, libXi, libXrender, libXext, dbus 5, testers, chromedriver 6}: 7 8let 9 upstream-info = (lib.importJSON ../../../../applications/networking/browsers/chromium/upstream-info.json).stable.chromedriver; 10 allSpecs = { 11 x86_64-linux = { 12 system = "linux64"; 13 sha256 = upstream-info.sha256_linux; 14 }; 15 16 x86_64-darwin = { 17 system = "mac64"; 18 sha256 = upstream-info.sha256_darwin; 19 }; 20 21 aarch64-darwin = { 22 system = "mac64_m1"; 23 sha256 = upstream-info.sha256_darwin_aarch64; 24 }; 25 }; 26 27 spec = allSpecs.${stdenv.hostPlatform.system} 28 or (throw "missing chromedriver binary for ${stdenv.hostPlatform.system}"); 29 30 libs = lib.makeLibraryPath [ 31 stdenv.cc.cc.lib 32 cairo fontconfig freetype 33 gdk-pixbuf glib gtk2 34 libX11 nspr nss pango libXrender 35 libxcb libXext libXi 36 dbus 37 ]; 38 39in stdenv.mkDerivation rec { 40 pname = "chromedriver"; 41 version = upstream-info.version; 42 43 src = fetchurl { 44 url = "https://chromedriver.storage.googleapis.com/${version}/chromedriver_${spec.system}.zip"; 45 sha256 = spec.sha256; 46 }; 47 48 nativeBuildInputs = [ unzip makeWrapper ]; 49 50 unpackPhase = "unzip $src"; 51 52 installPhase = '' 53 install -m755 -D chromedriver $out/bin/chromedriver 54 '' + lib.optionalString (!stdenv.isDarwin) '' 55 patchelf --set-interpreter ${glibc.out}/lib/ld-linux-x86-64.so.2 $out/bin/chromedriver 56 wrapProgram "$out/bin/chromedriver" --prefix LD_LIBRARY_PATH : "${libs}" 57 ''; 58 59 passthru.tests.version = testers.testVersion { package = chromedriver; }; 60 61 meta = with lib; { 62 homepage = "https://chromedriver.chromium.org/"; 63 description = "A WebDriver server for running Selenium tests on Chrome"; 64 longDescription = '' 65 WebDriver is an open source tool for automated testing of webapps across 66 many browsers. It provides capabilities for navigating to web pages, user 67 input, JavaScript execution, and more. ChromeDriver is a standalone 68 server that implements the W3C WebDriver standard. 69 ''; 70 license = licenses.bsd3; 71 maintainers = with maintainers; [ goibhniu marsam primeos ]; 72 # Note from primeos: By updating Chromium I also update Google Chrome and 73 # ChromeDriver. 74 platforms = attrNames allSpecs; 75 }; 76}