about summary refs log tree commit diff
path: root/pkgs/development/python-modules/selenium
diff options
context:
space:
mode:
authorRaymond Gauthier <jraygauthier@gmail.com>2017-11-02 23:26:49 -0400
committerRaymond Gauthier <jraygauthier@gmail.com>2017-11-02 23:26:49 -0400
commitf07ae8902d09b8ebaf7d3c4d15081dc9edf2550d (patch)
tree1f28491b706d97861f5d940b9becf6fd37d86fe8 /pkgs/development/python-modules/selenium
parentb2d6c638105d2178c41e5f5c94e3739e844d0e91 (diff)
downloadnixlib-f07ae8902d09b8ebaf7d3c4d15081dc9edf2550d.tar
nixlib-f07ae8902d09b8ebaf7d3c4d15081dc9edf2550d.tar.gz
nixlib-f07ae8902d09b8ebaf7d3c4d15081dc9edf2550d.tar.bz2
nixlib-f07ae8902d09b8ebaf7d3c4d15081dc9edf2550d.tar.lz
nixlib-f07ae8902d09b8ebaf7d3c4d15081dc9edf2550d.tar.xz
nixlib-f07ae8902d09b8ebaf7d3c4d15081dc9edf2550d.tar.zst
nixlib-f07ae8902d09b8ebaf7d3c4d15081dc9edf2550d.zip
pythonV.V-selenium: from 2.52.0 to 3.6.0
Diffstat (limited to 'pkgs/development/python-modules/selenium')
-rw-r--r--pkgs/development/python-modules/selenium/default.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/selenium/default.nix b/pkgs/development/python-modules/selenium/default.nix
new file mode 100644
index 000000000000..d33e86a3f079
--- /dev/null
+++ b/pkgs/development/python-modules/selenium/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchFromGitHub
+, buildPythonPackage
+, geckodriver
+, xorg
+}:
+
+buildPythonPackage rec {
+  name = "selenium-3.6.0";
+  src = fetchurl {
+    url = "mirror://pypi/s/selenium/${name}.tar.gz";
+    sha256 = "15qpvz0bdwjvpcj11fm0rw6r5inr66sqw89ww50l025sbhf04qwm";
+  };
+
+  buildInputs = [xorg.libX11];
+
+  propagatedBuildInputs = [
+    geckodriver
+  ];
+
+  # Recompiling x_ignore_nofocus.so as the original one dlopen's libX11.so.6 by some
+  # absolute paths. Replaced by relative path so it is found when used in nix.
+  x_ignore_nofocus =
+    fetchFromGitHub {
+      owner = "SeleniumHQ";
+      repo = "selenium";
+      rev = "selenium-3.6.0";
+      sha256 = "13wf4hx4i7nhl4s8xkziwxl0km1j873syrj4amragj6mpip2wn8v";
+    };
+
+  patchPhase = ''
+    cp "${x_ignore_nofocus}/cpp/linux-specific/"* .
+    substituteInPlace x_ignore_nofocus.c --replace "/usr/lib/libX11.so.6" "${xorg.libX11.out}/lib/libX11.so.6"
+    gcc -c -fPIC x_ignore_nofocus.c -o x_ignore_nofocus.o
+    gcc -shared \
+      -Wl,${if stdenv.isDarwin then "-install_name" else "-soname"},x_ignore_nofocus.so \
+      -o x_ignore_nofocus.so \
+      x_ignore_nofocus.o
+    cp -v x_ignore_nofocus.so selenium/webdriver/firefox/${if stdenv.is64bit then "amd64" else "x86"}/
+  '';
+
+  meta = with lib; {
+    description = "The selenium package is used to automate web browser interaction from Python";
+    homepage = http://www.seleniumhq.org;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ jraygauthier ];
+  };
+}
\ No newline at end of file