<commit_before>{ stdenv, fetchurl }:

stdenv.mkDerivation rec {
  name = "selenium-server-standalone-${version}";
  version = "2.39.0";

  src = fetchurl {
    url = "https://selenium.googlecode.com/files/${name}.jar";
    sha256 = "11ixh5x5f9kia2va8wssd3n7y57dkv3snw6xvk85y4qhzg64b65f";
  };

  unpack = "";

  buildCommand = ''
    mkdir -p $out/share/lib/${name}
    cp $src $out/share/lib/${name}/${name}.jar
  '';

  meta = with stdenv.lib; {
    homepage = https://code.google.com/p/selenium;
    description = "Selenium Server for remote WebDriver.";
    maintainers = [ maintainers.coconnor ];
    platforms = platforms.all;
    hydraPlatforms = [];
    license = licenses.asl20;
  };
}<commit_msg>selenium-server-standalone: update -> 2.44, fix opera, create binary, chrome support<commit_after>{ stdenv, fetchurl, makeWrapper, jre, jdk, gcc, xlibs
, chromedriver, chromeSupport ? true }:

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 {
  name = "selenium-server-standalone-${version}";
  version = "2.44.0";

  src = fetchurl {
    url = "http://selenium-release.storage.googleapis.com/2.44/selenium-server-standalone-2.44.0.jar";
    sha256 = "1n53pyrxpmfh9lvr68d1l9rsiw7qr36farirpl3ivkyvnpm5iwm5";
  };

  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 \
      --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
      --set-rpath "${gcc.gcc}/lib/:${gcc.gcc}/lib64:${xlibs.libX11}/lib" \
      launchers/launcher-linux-${arch}
    ${jdk}/bin/jar uf $src launchers/launcher-linux-${arch}
  '';

  installPhase = ''
    mkdir -p $out/share/lib/${name}
    cp $src $out/share/lib/${name}/${name}.jar
    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"}
  '';

  meta = {
    homepage = https://code.google.com/p/selenium;
    description = "Selenium Server for remote WebDriver.";
    maintainers = with maintainers; [ coconnor offline ];
    platforms = platforms.all;
    license = licenses.asl20;
  };
}
{'fraction_non_alphanumeric': 0.1656590084643289, 'fraction_numerical': 0.032245062474808545, 'mean_word_length': 3.3015597920277298, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4734056', 'n_tokens_mistral': 981, 'n_tokens_neox': 917, 'n_words': 157}