From 5b8c4b0646db59c0ce798aaccf1fd11bb4be1141 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Tue, 13 Nov 2018 00:23:58 +0100 Subject: [PATCH] suitesparse: fixup darwin libraries The build created libraries with an install_name that points to the build directory instead of the installation prefix. Causing errors like this when other packages try to link against it's libraries. Library not loaded: /private/tmp/nix-build-suitesparse-5.3.0.drv-0/SuiteSparse/lib/libcholmod.3.0.12.dylib --- .../libraries/science/math/suitesparse/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/science/math/suitesparse/default.nix b/pkgs/development/libraries/science/math/suitesparse/default.nix index 644b3545916c..528fe5ed0739 100644 --- a/pkgs/development/libraries/science/math/suitesparse/default.nix +++ b/pkgs/development/libraries/science/math/suitesparse/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, gfortran, openblas, cmake +{ stdenv, fetchurl, gfortran, openblas, cmake, fixDarwinDylibNames , enableCuda ? false, cudatoolkit }: @@ -96,8 +96,11 @@ stdenv.mkDerivation rec { runHook postInstall ''; - nativeBuildInputs = [ cmake ]; - buildInputs = [ openblas gfortran.cc.lib ] ++ stdenv.lib.optionals enableCuda [cudatoolkit]; + nativeBuildInputs = [ cmake ] + ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; + + buildInputs = [ openblas gfortran.cc.lib ] + ++ stdenv.lib.optional enableCuda cudatoolkit; meta = with stdenv.lib; { homepage = http://faculty.cse.tamu.edu/davis/suitesparse.html;