openblas: fix on darwin

The openblas script relies on CC=clang for succesfully compiling on
Darwin systems. This seems like bad behavior, but we get things like
https://hydra.nixos.org/build/87657058 otherwise.

Fixes #55536.
This commit is contained in:
Matthew Bauer 2019-02-10 18:49:04 -05:00
parent 2926b6e11f
commit cfc43138cb

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, fetchpatch, gfortran, perl, which, config, coreutils
{ stdenv, fetchFromGitHub, fetchpatch, gfortran, perl, which, config
# Most packages depending on openblas expect integer width to match
# pointer width, but some expect to use 32-bit integers always
# (for compatibility with reference BLAS).
@ -102,24 +102,18 @@ stdenv.mkDerivation rec {
"relro" "bindnow"
];
nativeBuildInputs = [
perl
which
buildPackages.gfortran
buildPackages.stdenv.cc
] ++ optionals stdenv.isDarwin [
coreutils
];
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ perl which gfortran ];
makeFlags = mapAttrsToList (var: val: "${var}=${toString val}") (config // {
FC = "${stdenv.cc.targetPrefix}gfortran";
CC = "${stdenv.cc.targetPrefix}cc";
CC = "${stdenv.cc.targetPrefix}${if stdenv.cc.isClang then "clang" else "cc"}";
PREFIX = placeholder "out";
NUM_THREADS = 64;
INTERFACE64 = blas64;
NO_STATIC = true;
CROSS = stdenv.hostPlatform != stdenv.buildPlatform;
HOSTCC = "${buildPackages.stdenv.cc.targetPrefix}cc";
HOSTCC = "cc";
NO_BINARY_MODE = stdenv.hostPlatform != stdenv.buildPlatform;
});