Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 23.11 40 lines 1.5 kB view raw
1{ lib, stdenv, fetchurl, makeWrapper, jre 2, htmlunit-driver, chromedriver, chromeSupport ? true }: 3 4let 5 minorVersion = "3.141"; 6 patchVersion = "59"; 7 8in stdenv.mkDerivation rec { 9 pname = "selenium-server-standalone"; 10 version = "${minorVersion}.${patchVersion}"; 11 12 src = fetchurl { 13 url = "http://selenium-release.storage.googleapis.com/${minorVersion}/selenium-server-standalone-${version}.jar"; 14 sha256 = "1jzkx0ahsb27zzzfvjqv660x9fz2pbcddgmhdzdmasxns5vipxxc"; 15 }; 16 17 dontUnpack = true; 18 19 nativeBuildInputs = [ makeWrapper ]; 20 buildInputs = [ jre ]; 21 22 installPhase = '' 23 mkdir -p $out/share/lib/${pname}-${version} 24 cp $src $out/share/lib/${pname}-${version}/${pname}-${version}.jar 25 makeWrapper ${jre}/bin/java $out/bin/selenium-server \ 26 --add-flags "-cp $out/share/lib/${pname}-${version}/${pname}-${version}.jar:${htmlunit-driver}/share/lib/${htmlunit-driver.name}/${htmlunit-driver.name}.jar" \ 27 ${lib.optionalString chromeSupport "--add-flags -Dwebdriver.chrome.driver=${chromedriver}/bin/chromedriver"} \ 28 --add-flags "org.openqa.grid.selenium.GridLauncherV3" 29 ''; 30 31 meta = with lib; { 32 homepage = "http://www.seleniumhq.org/"; 33 description = "Selenium Server for remote WebDriver"; 34 sourceProvenance = with sourceTypes; [ binaryBytecode ]; 35 license = licenses.asl20; 36 maintainers = with maintainers; [ coconnor offline ]; 37 mainProgram = "selenium-server"; 38 platforms = platforms.all; 39 }; 40}