-
-
Save kiloreux/ff1683618a22807b95b189275ac53c81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# generated using pypi2nix tool (version: 1.8.1) | |
# See more at: https://github.com/garbas/pypi2nix | |
{ pkgs ? import <nixpkgs> {} | |
}: | |
let | |
inherit (pkgs) makeWrapper stdenv glibcLocales; | |
inherit (pkgs.stdenv.lib) fix' extends inNixShell; | |
pythonPackages = | |
import "${toString pkgs.path}/pkgs/top-level/python-packages.nix" { | |
inherit pkgs; | |
inherit (pkgs) stdenv; | |
python = pkgs.python27Full; | |
# patching pip so it does not try to remove files when running nix-shell | |
overrides = | |
self: super: { | |
bootstrapped-pip = super.bootstrapped-pip.overrideDerivation (old: { | |
patchPhase = old.patchPhase + '' | |
if [ -e $out/${pkgs.python27Full.sitePackages}/pip/req/req_install.py ]; then | |
sed -i \ | |
-e "s|paths_to_remove.remove(auto_confirm)|#paths_to_remove.remove(auto_confirm)|" \ | |
-e "s|self.uninstalled = paths_to_remove|#self.uninstalled = paths_to_remove|" \ | |
$out/${pkgs.python27Full.sitePackages}/pip/req/req_install.py | |
fi | |
''; | |
}); | |
}; | |
}; | |
commonBuildInputs = with pkgs; [ mysql55 gfortran blas pkgconfig freetype.dev libpng agg libressl ]; | |
commonDoCheck = false; | |
withPackages = pkgs': | |
let | |
pkgs = builtins.removeAttrs pkgs' ["__unfix__"]; | |
interpreterWithPackages = selectPkgsFn: pythonPackages.buildPythonPackage { | |
name = "python27Full-interpreter"; | |
buildInputs = [ makeWrapper ] ++ (selectPkgsFn pkgs); | |
buildCommand = '' | |
mkdir -p $out/bin | |
ln -s ${pythonPackages.python.interpreter} \ | |
$out/bin/${pythonPackages.python.executable} | |
for dep in ${builtins.concatStringsSep " " | |
(selectPkgsFn pkgs)}; do | |
if [ -d "$dep/bin" ]; then | |
for prog in "$dep/bin/"*; do | |
if [ -x "$prog" ] && [ -f "$prog" ]; then | |
ln -s $prog $out/bin/`basename $prog` | |
fi | |
done | |
fi | |
done | |
for prog in "$out/bin/"*; do | |
wrapProgram "$prog" --prefix PYTHONPATH : "$PYTHONPATH" --set LC_CTYPE en_US.UTF-8 --set LC_ALL en_US.UTF-8 --set LANG en_US.UTF-8 --unset LD_LIBRARY_PATH | |
done | |
pushd $out/bin | |
ln -s ${pythonPackages.python.executable} python | |
ln -s ${pythonPackages.python.executable} \ | |
python2 | |
popd | |
''; | |
passthru.interpreter = pythonPackages.python; | |
}; | |
interpreter = interpreterWithPackages builtins.attrValues; | |
in { | |
__old = pythonPackages; | |
inherit interpreter; | |
inherit interpreterWithPackages; | |
mkDerivation = pythonPackages.buildPythonPackage; | |
packages = pkgs; | |
overrideDerivation = drv: f: | |
pythonPackages.buildPythonPackage ( | |
drv.drvAttrs // f drv.drvAttrs // { meta = drv.meta; } | |
); | |
withPackages = pkgs'': | |
withPackages (pkgs // pkgs''); | |
}; | |
python = withPackages {}; | |
generated = self: { | |
"LinkChecker" = python.mkDerivation { | |
name = "LinkChecker-9.2"; | |
src = pkgs.fetchurl { url = "https://files.pythonhosted.org/packages/a9/b3/33de0997bd24c6551a5f13182dbc2b59774cf98c78dcffad37a6f8d57a65/LinkChecker-9.2.tar.gz"; sha256 = "ba556cd1c172c2cbcb92fc3405d48f44fa56c3074ed3b7ead87f635ad54fb907"; }; | |
doCheck = commonDoCheck; | |
checkPhase = ""; | |
installCheckPhase = ""; | |
buildInputs = commonBuildInputs; | |
propagatedBuildInputs = [ | |
self."requests" | |
]; | |
meta = with pkgs.stdenv.lib; { | |
homepage = "http://wummel.github.io/linkchecker/"; | |
license = licenses.gpl1; | |
description = "check links in web documents or full websites"; | |
}; | |
}; | |
"opencv3" = pythonPackages.opencv3.overrideAttrs(oldAttrs: { | |
version = "3.4.3"; | |
}); | |
}; | |
localOverridesFile = ./requirements_override.nix; | |
overrides = import localOverridesFile { inherit pkgs python; }; | |
commonOverrides = [ | |
]; | |
allOverrides = | |
(if (builtins.pathExists localOverridesFile) | |
then [overrides] else [] ) ++ commonOverrides; | |
in python.withPackages | |
(fix' (pkgs.lib.fold | |
extends | |
generated | |
allOverrides | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment