at master 1.9 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchzip, 5 unzip, 6 testers, 7 chromedriver, 8}: 9 10let 11 upstream-info = 12 (lib.importJSON ../../../../applications/networking/browsers/chromium/info.json) 13 .chromium.chromedriver; 14 15 # See ./source.nix for Linux 16 allSpecs = { 17 x86_64-darwin = { 18 system = "mac-x64"; 19 hash = upstream-info.hash_darwin; 20 }; 21 22 aarch64-darwin = { 23 system = "mac-arm64"; 24 hash = upstream-info.hash_darwin_aarch64; 25 }; 26 }; 27 28 spec = 29 allSpecs.${stdenv.hostPlatform.system} 30 or (throw "missing chromedriver binary for ${stdenv.hostPlatform.system}"); 31 32 inherit (upstream-info) version; 33in 34stdenv.mkDerivation { 35 pname = "chromedriver"; 36 inherit version; 37 38 src = fetchzip { 39 url = "https://storage.googleapis.com/chrome-for-testing-public/${version}/${spec.system}/chromedriver-${spec.system}.zip"; 40 inherit (spec) hash; 41 }; 42 43 nativeBuildInputs = [ unzip ]; 44 45 installPhase = '' 46 install -m555 -D "chromedriver" $out/bin/chromedriver 47 ''; 48 49 passthru.tests.version = testers.testVersion { package = chromedriver; }; 50 51 meta = with lib; { 52 homepage = "https://chromedriver.chromium.org/"; 53 description = "WebDriver server for running Selenium tests on Chrome"; 54 longDescription = '' 55 WebDriver is an open source tool for automated testing of webapps across 56 many browsers. It provides capabilities for navigating to web pages, user 57 input, JavaScript execution, and more. ChromeDriver is a standalone 58 server that implements the W3C WebDriver standard. 59 ''; 60 sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 61 license = licenses.bsd3; 62 maintainers = with maintainers; [ ]; 63 # Note from primeos: By updating Chromium I also update Google Chrome and 64 # ChromeDriver. 65 platforms = platforms.darwin; 66 mainProgram = "chromedriver"; 67 }; 68}