at 17.09-beta 61 lines 1.8 kB view raw
1{ stdenv, fetchurl, cairo, fontconfig, freetype, gdk_pixbuf, glib 2, glibc, gtk2, libX11, makeWrapper, nspr, nss, pango, unzip, gconf 3, libXi, libXrender, libXext 4}: 5let 6 allSpecs = { 7 "i686-linux" = { 8 system = "linux32"; 9 sha256 = "1qi49rcm7r4b8yqx4akmirilp4ifip89n7inji0pihdqzaw604d4"; 10 }; 11 12 "x86_64-linux" = { 13 system = "linux64"; 14 sha256 = "1845nh7kj8scgn85yqwp4nsx7fabcb09w23jp8xa1cxyfvv2wdry"; 15 }; 16 17 "x86_64-darwin" = { 18 system = "mac64"; 19 sha256 = "0zyv8i4dbzyk58g4hr5143akgsfaaq9659bwj1m41jwi965grcxa"; 20 }; 21 }; 22 23 spec = allSpecs."${stdenv.system}" 24 or (throw "missing chromedriver binary for ${stdenv.system}"); 25 26 libs = stdenv.lib.makeLibraryPath [ 27 stdenv.cc.cc.lib 28 cairo fontconfig freetype 29 gdk_pixbuf glib gtk2 gconf 30 libX11 nspr nss pango libXrender 31 gconf libXext libXi 32 ]; 33in 34stdenv.mkDerivation rec { 35 name = "chromedriver-${version}"; 36 version = "2.31"; 37 38 src = fetchurl { 39 url = "http://chromedriver.storage.googleapis.com/${version}/chromedriver_${spec.system}.zip"; 40 sha256 = spec.sha256; 41 }; 42 43 nativeBuildInputs = [ unzip makeWrapper ]; 44 45 unpackPhase = "unzip $src"; 46 47 installPhase = '' 48 install -m755 -D chromedriver $out/bin/chromedriver 49 '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 50 patchelf --set-interpreter ${glibc.out}/lib/ld-linux-x86-64.so.2 $out/bin/chromedriver 51 wrapProgram "$out/bin/chromedriver" --prefix LD_LIBRARY_PATH : "${libs}:\$LD_LIBRARY_PATH" 52 ''; 53 54 meta = with stdenv.lib; { 55 homepage = https://sites.google.com/a/chromium.org/chromedriver; 56 description = "A WebDriver server for running Selenium tests on Chrome"; 57 license = licenses.bsd3; 58 maintainers = [ maintainers.goibhniu ]; 59 platforms = attrNames allSpecs; 60 }; 61}