1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 06:01:15 +00:00

Merge pull request #31114 from jraygauthier/jrg/python_selenium_update

selenium: 2.52.0 -> 3.6.0
This commit is contained in:
Samuel Leathers 2017-11-07 13:17:02 -05:00 committed by GitHub
commit 3641da1ef1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 78 additions and 30 deletions

View file

@ -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 ];
};
}

View file

@ -0,0 +1,25 @@
{ lib
, fetchurl
, rustPlatform
}:
with rustPlatform;
buildRustPackage rec {
version = "0.19.1";
name = "geckodriver-${version}";
src = fetchurl {
url = "https://github.com/mozilla/geckodriver/archive/v${version}.tar.gz";
sha256 = "04zpv4aiwbig466yj24hhazl5hrapkyvwlhvg0za5599ykzdv47m";
};
cargoSha256 = "1cny8caqcd9p98hra1k7y4d3lb8sxsyaplr0svbwam0d2qc1c257";
meta = with lib; {
description = "Proxy for using W3C WebDriver-compatible clients to interact with Gecko-based browsers";
homepage = https://github.com/mozilla/geckodriver;
license = licenses.mpl20;
maintainers = with maintainers; [ jraygauthier ];
};
}

View file

@ -1080,6 +1080,8 @@ with pkgs;
go-dependency-manager = callPackage ../development/tools/gdm { };
geckodriver = callPackage ../development/tools/geckodriver { };
geekbench = callPackage ../tools/misc/geekbench { };
gencfsm = callPackage ../tools/security/gencfsm { };

View file

@ -18037,36 +18037,7 @@ in {
seaborn = callPackage ../development/python-modules/seaborn { };
selenium = buildPythonPackage rec {
name = "selenium-2.52.0";
src = pkgs.fetchurl {
url = "mirror://pypi/s/selenium/${name}.tar.gz";
sha256 = "0971rd9b8kb97xp9fvrwzvxr8vqfdjc020cs75n787ya82km01c2";
};
buildInputs = with self; [pkgs.xorg.libX11];
# 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 =
pkgs.fetchFromGitHub {
owner = "SeleniumHQ";
repo = "selenium";
rev = "selenium-2.52.0";
sha256 = "1n58akim9np2jy22jfgichq1ckvm8gglqi2hn3syphh0jjqq6cfx";
};
patchPhase = ''
cp "${x_ignore_nofocus}/cpp/linux-specific/"* .
substituteInPlace x_ignore_nofocus.c --replace "/usr/lib/libX11.so.6" "${pkgs.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 py/selenium/webdriver/firefox/${if pkgs.stdenv.is64bit then "amd64" else "x86"}/
'';
};
selenium = callPackage ../development/python-modules/selenium { };
serpy = callPackage ../development/python-modules/serpy { };