From 9ade2dfa3cefe89776d48cea684c8ea0d3bc8e13 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Thu, 28 Aug 2014 18:34:41 -0500 Subject: [PATCH] openblas: add local build preference to pinned versions --- .../libraries/science/math/openblas/0.2.10.nix | 8 ++++++-- .../development/libraries/science/math/openblas/0.2.2.nix | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/science/math/openblas/0.2.10.nix b/pkgs/development/libraries/science/math/openblas/0.2.10.nix index a8db06319111..c8df06ef3787 100644 --- a/pkgs/development/libraries/science/math/openblas/0.2.10.nix +++ b/pkgs/development/libraries/science/math/openblas/0.2.10.nix @@ -1,5 +1,8 @@ -{ stdenv, fetchurl, gfortran, perl, liblapack }: +{ stdenv, fetchurl, gfortran, perl, liblapack, config }: +let local = config.openblas.preferLocalBuild or false; + localTarget = config.openblas.target or ""; +in stdenv.mkDerivation rec { version = "0.2.10"; @@ -16,7 +19,8 @@ stdenv.mkDerivation rec { cpu = builtins.head (stdenv.lib.splitString "-" stdenv.system); - target = if cpu == "i686" then "P2" else + target = if local then localTarget else + if cpu == "i686" then "P2" else if cpu == "x86_64" then "CORE2" else # allow autodetect ""; diff --git a/pkgs/development/libraries/science/math/openblas/0.2.2.nix b/pkgs/development/libraries/science/math/openblas/0.2.2.nix index c535b1a39dbb..22dbc491f878 100644 --- a/pkgs/development/libraries/science/math/openblas/0.2.2.nix +++ b/pkgs/development/libraries/science/math/openblas/0.2.2.nix @@ -1,5 +1,8 @@ -{ stdenv, fetchurl, gfortran, perl, liblapack }: +{ stdenv, fetchurl, gfortran, perl, liblapack, config }: +let local = config.openblas.preferLocalBuild or false; + localTarget = config.openblas.target or ""; +in stdenv.mkDerivation rec { version = "0.2.2"; @@ -16,7 +19,8 @@ stdenv.mkDerivation rec { cpu = builtins.head (stdenv.lib.splitString "-" stdenv.system); - target = if cpu == "i686" then "P2" else + target = if local then localTarget else + if cpu == "i686" then "P2" else if cpu == "x86_64" then "CORE2" else # allow autodetect "";