Commit 79c6c27b authored by Allen Nelson's avatar Allen Nelson Committed by Vladimír Čunát
Browse files

pandas: add libcxx dependency on darwin (close #9862)

vcunat changed `optional` arguments from lists to packages.
parent 8e393dde
Loading
Loading
Loading
Loading
+84 −71
Original line number Diff line number Diff line
@@ -9731,7 +9731,10 @@ let
    };
  };
  pandas = buildPythonPackage rec {
  pandas = let
    inherit (pkgs.stdenv.lib) optional optionalString;
    inherit (pkgs.stdenv) isDarwin;
  in buildPythonPackage rec {
    name = "pandas-0.16.2";
    src = pkgs.fetchurl {
@@ -9739,7 +9742,7 @@ let
      sha256 = "10agmrkps8bi5948vwpipfxds5kj1d076m9i0nhaxwqiw7gm6670";
    };
    buildInputs = [ self.nose ];
    buildInputs = [ self.nose ] ++ optional isDarwin pkgs.libcxx;
    propagatedBuildInputs = with self; [
      dateutil
      numpy
@@ -9753,7 +9756,17 @@ let
      html5lib
      modules.sqlite3
      beautifulsoup4
    ];
    ] ++ optional isDarwin pkgs.darwin.adv_cmds; # provides the locale command
    # For OSX, we need to add a dependency on libcxx, which provides
    # `complex.h` and other libraries that pandas depends on to build.
    patchPhase = optionalString isDarwin ''
      cpp_sdk="${pkgs.libcxx}/include/c++/v1";
      echo "Adding $cpp_sdk to the setup.py common_include variable"
      substituteInPlace setup.py \
        --replace "['pandas/src/klib', 'pandas/src']" \
                  "['pandas/src/klib', 'pandas/src', '$cpp_sdk']"
    '';
    preCheck = ''
      # Broken test, probably https://github.com/pydata/pandas/issues/10312: