1{ stdenv, fetchurl, cairo, fontconfig, freetype, gdk_pixbuf, glib
2, glibc, gtk, libX11, makeWrapper, nspr, nss, pango, unzip, gconf
3, libXi, libXrender, libXext
4}:
5
6# note: there is a i686 version available as well
7assert stdenv.system == "x86_64-linux";
8
9stdenv.mkDerivation rec {
10 product = "chromedriver_linux64";
11 name = "${product}-2.21";
12 version = "2.21";
13
14 src = fetchurl {
15 url = "http://chromedriver.storage.googleapis.com/${version}/${product}.zip";
16 sha256 = "1fhwvqjwqkfm18icacvk0312ii8hf1p03icd3isfcxp7j69qf2wg";
17 };
18
19 buildInputs = [ unzip makeWrapper ];
20
21 unpackPhase = "unzip $src";
22
23 installPhase = ''
24 mkdir -p $out/bin
25 mv chromedriver $out/bin
26 patchelf --set-interpreter ${glibc.out}/lib/ld-linux-x86-64.so.2 $out/bin/chromedriver
27 wrapProgram "$out/bin/chromedriver" \
28 --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ stdenv.cc.cc.lib cairo fontconfig freetype gdk_pixbuf glib gtk libX11 nspr nss pango libXrender gconf libXext libXi ]}:\$LD_LIBRARY_PATH"
29 '';
30
31 meta = with stdenv.lib; {
32 homepage = http://code.google.com/p/chromedriver/;
33 description = "A WebDriver server for running Selenium tests on Chrome";
34 license = licenses.bsd3;
35 maintainers = [ maintainers.goibhniu ];
36 platforms = platforms.linux;
37 };
38}