diff options
author | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2016-10-15 17:51:09 -0400 |
---|---|---|
committer | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2016-10-17 11:23:13 -0400 |
commit | 095095c479c9732677bdd20a447b3f0183bab7f9 (patch) | |
tree | 7eb449248853504738f6f14c198c1b90d07a77bd /pkgs/development/python-modules | |
parent | 80433e70302be5498f07996d04bacb4cecfc6a7b (diff) | |
download | nixpkgs-095095c479c9732677bdd20a447b3f0183bab7f9.tar nixpkgs-095095c479c9732677bdd20a447b3f0183bab7f9.tar.gz nixpkgs-095095c479c9732677bdd20a447b3f0183bab7f9.tar.bz2 nixpkgs-095095c479c9732677bdd20a447b3f0183bab7f9.tar.lz nixpkgs-095095c479c9732677bdd20a447b3f0183bab7f9.tar.xz nixpkgs-095095c479c9732677bdd20a447b3f0183bab7f9.tar.zst nixpkgs-095095c479c9732677bdd20a447b3f0183bab7f9.zip |
python: add C++ compiler support for distutils
This should help with builds against clang
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r-- | pkgs/development/python-modules/numpy-distutils-C++.patch | 23 | ||||
-rw-r--r-- | pkgs/development/python-modules/numpy.nix | 8 |
2 files changed, 30 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/numpy-distutils-C++.patch b/pkgs/development/python-modules/numpy-distutils-C++.patch new file mode 100644 index 00000000000..4b2d5c640e6 --- /dev/null +++ b/pkgs/development/python-modules/numpy-distutils-C++.patch @@ -0,0 +1,23 @@ +diff --git a/numpy/distutils/unixccompiler.py b/numpy/distutils/unixccompiler.py +index a92ccd3..9630e91 100644 +--- a/numpy/distutils/unixccompiler.py ++++ b/numpy/distutils/unixccompiler.py +@@ -43,10 +43,15 @@ def UnixCCompiler__compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts + if opt not in llink_s: + self.linker_so = llink_s.split() + opt.split() + +- display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src) + try: +- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + +- extra_postargs, display = display) ++ if self.detect_language(src) == 'c++': ++ display = '%s: %s' % (os.path.basename(self.compiler_so_cxx[0]), src) ++ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + ++ extra_postargs, display = display) ++ else: ++ display = '%s: %s' % (os.path.basename(self.compiler_so[0]), src) ++ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + ++ extra_postargs, display = display) + except DistutilsExecError: + msg = str(get_exception()) + raise CompileError(msg) diff --git a/pkgs/development/python-modules/numpy.nix b/pkgs/development/python-modules/numpy.nix index 141c8b14fa6..d4534248159 100644 --- a/pkgs/development/python-modules/numpy.nix +++ b/pkgs/development/python-modules/numpy.nix @@ -1,4 +1,4 @@ -{lib, python, buildPythonPackage, isPyPy, gfortran, nose, blas}: +{lib, python, buildPythonPackage, isPy27, isPyPy, gfortran, nose, blas}: args: @@ -12,6 +12,12 @@ in buildPythonPackage (args // rec { buildInputs = args.buildInputs or [ gfortran nose ]; propagatedBuildInputs = args.propagatedBuildInputs or [ passthru.blas ]; + patches = lib.optionals isPy27 [ + # See cpython 2.7 patches. + # numpy.distutils is used by cython during it's check phase + ./numpy-distutils-C++.patch + ]; + preConfigure = '' sed -i 's/-faltivec//' numpy/distutils/system_info.py ''; |