nixpkgs/pkgs/development/tools/selenium/server/default.nix
Felix Scheinost a7483c5a9a selenium-server-standalone: fix useChrome = false
Previously when useChrome was set to false the command would be something like

```
makeWrapper [...] \
  --add-flags "-cp [...]" \
  --add-flags  \
  --add-flags "org.openqa.grid.selenium.GridLauncherV3"
```

The problem was that only the arguments to `--add-flags` was optional while for this to be parsed correctly the flag and argument has to be optional.
2021-12-07 14:13:50 +01:00

41 lines
1.3 KiB
Nix

{ lib, stdenv, fetchurl, makeWrapper, jre
, htmlunit-driver, chromedriver, chromeSupport ? true }:
with lib;
let
minorVersion = "3.141";
patchVersion = "59";
in stdenv.mkDerivation rec {
pname = "selenium-server-standalone";
version = "${minorVersion}.${patchVersion}";
src = fetchurl {
url = "http://selenium-release.storage.googleapis.com/${minorVersion}/selenium-server-standalone-${version}.jar";
sha256 = "1jzkx0ahsb27zzzfvjqv660x9fz2pbcddgmhdzdmasxns5vipxxc";
};
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre ];
installPhase = ''
mkdir -p $out/share/lib/${pname}-${version}
cp $src $out/share/lib/${pname}-${version}/${pname}-${version}.jar
makeWrapper ${jre}/bin/java $out/bin/selenium-server \
--add-flags "-cp $out/share/lib/${pname}-${version}/${pname}-${version}.jar:${htmlunit-driver}/share/lib/${htmlunit-driver.name}/${htmlunit-driver.name}.jar" \
${optionalString chromeSupport "--add-flags -Dwebdriver.chrome.driver=${chromedriver}/bin/chromedriver"} \
--add-flags "org.openqa.grid.selenium.GridLauncherV3"
'';
meta = {
homepage = "http://www.seleniumhq.org/";
description = "Selenium Server for remote WebDriver";
maintainers = with maintainers; [ coconnor offline ];
platforms = platforms.all;
license = licenses.asl20;
};
}