numpy: enable numpy.distutils patch only if it's also in distutils

Fixes: 095095c ('python: add C++ compiler support for distutils')
This commit is contained in:
Dmitry Kalinkin 2016-10-26 21:29:55 +00:00
parent 6404a30afb
commit 46dd9dfc52
2 changed files with 4 additions and 3 deletions

View File

@ -39,6 +39,7 @@ let
sha256 = "0y7rl603vmwlxm6ilkhc51rx2mfj14ckcz40xxgs0ljnvlhp30yp"; sha256 = "0y7rl603vmwlxm6ilkhc51rx2mfj14ckcz40xxgs0ljnvlhp30yp";
}; };
hasDistutilsCxxPatch = !(stdenv.cc.isGNU or false);
patches = patches =
[ # Look in C_INCLUDE_PATH and LIBRARY_PATH for stuff. [ # Look in C_INCLUDE_PATH and LIBRARY_PATH for stuff.
./search-path.patch ./search-path.patch
@ -82,7 +83,7 @@ let
./2.7.3-dylib.patch ./2.7.3-dylib.patch
./2.7.3-getpath-exe-extension.patch ./2.7.3-getpath-exe-extension.patch
./2.7.3-no-libm.patch ./2.7.3-no-libm.patch
] ++ optionals (!(stdenv.cc.isGNU or false)) [ ] ++ optionals hasDistutilsCxxPatch [
# Patch from http://bugs.python.org/issue1222585 adapted to work with # Patch from http://bugs.python.org/issue1222585 adapted to work with
# `patch -p1' and with a last hunk removed # `patch -p1' and with a last hunk removed
@ -180,7 +181,7 @@ in stdenv.mkDerivation {
''; '';
passthru = rec { passthru = rec {
inherit libPrefix sitePackages x11Support; inherit libPrefix sitePackages x11Support hasDistutilsCxxPatch;
executable = libPrefix; executable = libPrefix;
buildEnv = callPackage ../../wrapper.nix { python = self; }; buildEnv = callPackage ../../wrapper.nix { python = self; };
withPackages = import ../../with-packages.nix { inherit buildEnv; pythonPackages = python27Packages; }; withPackages = import ../../with-packages.nix { inherit buildEnv; pythonPackages = python27Packages; };

View File

@ -12,7 +12,7 @@ in buildPythonPackage (args // rec {
buildInputs = args.buildInputs or [ gfortran nose ]; buildInputs = args.buildInputs or [ gfortran nose ];
propagatedBuildInputs = args.propagatedBuildInputs or [ passthru.blas ]; propagatedBuildInputs = args.propagatedBuildInputs or [ passthru.blas ];
patches = lib.optionals isPy27 [ patches = lib.optionals (python.hasDistutilsCxxPatch or false) [
# See cpython 2.7 patches. # See cpython 2.7 patches.
# numpy.distutils is used by cython during it's check phase # numpy.distutils is used by cython during it's check phase
./numpy-distutils-C++.patch ./numpy-distutils-C++.patch