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