From 6032bb34b2ae320e7f1b7c5f4197dc36d9d61b66 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Wed, 15 Jan 2020 15:44:52 +0000 Subject: [PATCH] Add overrides to make scipy/scikit-learn build --- overrides.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/overrides.nix b/overrides.nix index 48b8ff9..9d2817a 100644 --- a/overrides.nix +++ b/overrides.nix @@ -400,9 +400,21 @@ self: super: } ); + # Pybind11 is an undeclared dependency of scipy that we need to pick from nixpkgs + # Make it not fail with infinite recursion + pybind11 = super.pybind11.overridePythonAttrs ( + old: { + cmakeFlags = (old.cmakeFlags or []) ++ [ + "-DPYBIND11_TEST=off" + ]; + doCheck = false; # Circular test dependency + } + ); + scipy = super.scipy.overrideAttrs ( old: { nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.gfortran ]; + propagatedBuildInputs = old.propagatedBuildInputs ++ [ self.pybind11 ]; setupPyBuildFlags = [ "--fcompiler='gnu95'" ]; enableParallelBuilding = true; buildInputs = old.buildInputs ++ [ self.numpy.blas ]; @@ -416,6 +428,23 @@ self: super: } ); + scikit-learn = super.scikit-learn.overridePythonAttrs ( + old: { + buildInputs = old.buildInputs ++ [ + pkgs.gfortran + pkgs.glibcLocales + ] ++ lib.optionals stdenv.cc.isClang [ + pkgs.llvmPackages.openmp + ]; + + nativeBuildInputs = old.nativeBuildInputs ++ [ + self.cython + ]; + + enableParallelBuilding = true; + } + ); + shapely = super.shapely.overrideAttrs ( old: { buildInputs = old.buildInputs ++ [ pkgs.geos self.cython ];