diff options
author | Robin Gloster <mail@glob.in> | 2016-03-15 01:44:24 +0000 |
---|---|---|
committer | Robin Gloster <mail@glob.in> | 2016-03-15 01:44:24 +0000 |
commit | 3f45f0948d6fe158bed063adb66850ded0ba4861 (patch) | |
tree | ac717689d391d3f5333132fc34e4b2aed829414c /pkgs/development/libraries/science/math/suitesparse | |
parent | a9b942c0617b1cd5f0732d05eadad0114a178f37 (diff) | |
parent | d227d9a70e41d65e4e6f4ac75a9d243c5a19fa85 (diff) |
Merge remote-tracking branch 'upstream/master' into hardened-stdenv
Diffstat (limited to 'pkgs/development/libraries/science/math/suitesparse')
-rw-r--r-- | pkgs/development/libraries/science/math/suitesparse/default.nix | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgs/development/libraries/science/math/suitesparse/default.nix b/pkgs/development/libraries/science/math/suitesparse/default.nix index b4b9a6970ff88..b1cf9c83c7b22 100644 --- a/pkgs/development/libraries/science/math/suitesparse/default.nix +++ b/pkgs/development/libraries/science/math/suitesparse/default.nix @@ -5,6 +5,7 @@ let name = "suitesparse-${version}"; int_t = if openblas.blas64 then "int64_t" else "int32_t"; + SHLIB_EXT = if stdenv.isDarwin then "dylib" else "so"; in stdenv.mkDerivation { inherit name; @@ -23,6 +24,10 @@ stdenv.mkDerivation { -e 's/METIS_PATH .*$/METIS_PATH =/' \ -e '/CHOLMOD_CONFIG/ s/$/-DNPARTITION -DLONGBLAS=${int_t}/' \ -e '/UMFPACK_CONFIG/ s/$/-DLONGBLAS=${int_t}/' + '' + + stdenv.lib.optionalString stdenv.isDarwin '' + sed -i "SuiteSparse_config/SuiteSparse_config.mk" \ + -e 's/^[[:space:]]*\(LIB = -lm\) -lrt/\1/' ''; makeFlags = [ @@ -33,6 +38,8 @@ stdenv.mkDerivation { "LAPACK=" ]; + NIX_CFLAGS = stdenv.lib.optionalString stdenv.isDarwin " -DNTIMER"; + postInstall = '' # Build and install shared library ( @@ -40,10 +47,10 @@ stdenv.mkDerivation { for i in "$out"/lib/lib*.a; do ar -x $i done - gcc *.o --shared -o "$out/lib/libsuitesparse.so" -lopenblas + ''${CC} *.o ${if stdenv.isDarwin then "-dynamiclib" else "--shared"} -o "$out/lib/libsuitesparse.${SHLIB_EXT}" -lopenblas ) for i in umfpack cholmod amd camd colamd spqr; do - ln -s libsuitesparse.so "$out"/lib/lib$i.so; + ln -s libsuitesparse.${SHLIB_EXT} "$out"/lib/lib$i.${SHLIB_EXT} done # Install documentation |