2014-11-05 12:27:33 +01:00
|
|
|
{ stdenv, fetchurl, makeWrapper, jre, jdk, gcc, xlibs
|
|
|
|
, chromedriver, chromeSupport ? true }:
|
2014-02-27 13:06:23 +01:00
|
|
|
|
2014-11-05 12:27:33 +01:00
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
arch = if stdenv.system == "x86_64-linux" then "amd64"
|
|
|
|
else if stdenv.system == "i686-linux" then "i386"
|
|
|
|
else "";
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2014-02-27 13:06:23 +01:00
|
|
|
name = "selenium-server-standalone-${version}";
|
2015-05-22 16:40:18 +02:00
|
|
|
version = "2.45.0";
|
2014-02-27 13:06:23 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-05-22 16:40:18 +02:00
|
|
|
url = "http://selenium-release.storage.googleapis.com/2.45/selenium-server-standalone-2.45.0.jar";
|
|
|
|
sha256 = "0yvmmngqff3k5si1js8v87nx3whlsx7q4p78v6ybqhsbv6idywhi";
|
2014-02-27 13:06:23 +01:00
|
|
|
};
|
|
|
|
|
2014-11-05 12:27:33 +01:00
|
|
|
unpackPhase = "true";
|
|
|
|
|
|
|
|
buildInputs = [ jre makeWrapper ];
|
|
|
|
|
|
|
|
# Patch launcher binaries for opera
|
|
|
|
patchPhase = optionalString (arch!="") ''
|
|
|
|
cp $src $TMPDIR/${name}.jar
|
|
|
|
export src=$TMPDIR/${name}.jar
|
|
|
|
|
|
|
|
${jdk}/bin/jar xf $src launchers/launcher-linux-amd64
|
|
|
|
patchelf \
|
2014-12-17 19:11:30 +01:00
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2015-01-15 05:44:00 +01:00
|
|
|
--set-rpath "${gcc.cc}/lib/:${gcc.cc}/lib64:${xlibs.libX11}/lib" \
|
2014-11-05 12:27:33 +01:00
|
|
|
launchers/launcher-linux-${arch}
|
|
|
|
${jdk}/bin/jar uf $src launchers/launcher-linux-${arch}
|
|
|
|
'';
|
2014-02-27 13:06:23 +01:00
|
|
|
|
2014-11-05 12:27:33 +01:00
|
|
|
installPhase = ''
|
2014-02-27 13:06:23 +01:00
|
|
|
mkdir -p $out/share/lib/${name}
|
|
|
|
cp $src $out/share/lib/${name}/${name}.jar
|
2014-11-05 12:27:33 +01:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/selenium-server \
|
|
|
|
--add-flags "-jar $out/share/lib/${name}/${name}.jar" \
|
|
|
|
--add-flags ${optionalString chromeSupport "-Dwebdriver.chrome.driver=${chromedriver}/bin/chromedriver"}
|
2014-02-27 13:06:23 +01:00
|
|
|
'';
|
|
|
|
|
2014-11-05 12:27:33 +01:00
|
|
|
meta = {
|
2014-02-27 13:06:23 +01:00
|
|
|
homepage = https://code.google.com/p/selenium;
|
2014-11-11 14:20:43 +01:00
|
|
|
description = "Selenium Server for remote WebDriver";
|
2014-11-05 12:27:33 +01:00
|
|
|
maintainers = with maintainers; [ coconnor offline ];
|
2014-02-27 13:06:23 +01:00
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|