diff --git a/pkgs/development/compilers/julia/0.3.nix b/pkgs/development/compilers/julia/0.3.nix index c7cda2749248..62a1f4f98cc5 100644 --- a/pkgs/development/compilers/julia/0.3.nix +++ b/pkgs/development/compilers/julia/0.3.nix @@ -63,7 +63,6 @@ stdenv.mkDerivation rec { makeFlags = [ "USE_SYSTEM_PATCHELF=1" - "USE_SYSTEM_OPENBLAS=1" "USE_SYSTEM_BLAS=1" "USE_SYSTEM_LAPACK=1" "ARCH=${arch}" @@ -122,25 +121,13 @@ stdenv.mkDerivation rec { ''; preBuild = '' + # Link dynamically loaded shared libraries into output so they are found at runtime. mkdir -p "$out/lib" ln -s "${openblas}/lib/libopenblas.so" "$out/lib/libblas.so" ln -s "${openblas}/lib/libopenblas.so" "$out/lib/liblapack.so" - - mkdir -p usr/lib - - echo "$out" - mkdir -p "$out/lib" - ( - cd "$(mktemp -d)" - for i in "${suitesparse}"/lib/lib*.a; do - ar -x $i - done - gcc *.o --shared -o "$out/lib/libsuitesparse.so" - ) - cp "$out/lib/libsuitesparse.so" usr/lib + ln -s "${suitesparse}/lib/libsuitesparse.so" "$out/lib/libsuitesparse.so" for i in umfpack cholmod amd camd colamd spqr; do - ln -s libsuitesparse.so "$out"/lib/lib$i.so; - ln -s libsuitesparse.so "usr"/lib/lib$i.so; + ln -s libsuitesparse.so "$out/lib/lib$i.so"; done ''; diff --git a/pkgs/development/libraries/science/math/suitesparse/default.nix b/pkgs/development/libraries/science/math/suitesparse/default.nix index af9396ad9004..f30db472b0de 100644 --- a/pkgs/development/libraries/science/math/suitesparse/default.nix +++ b/pkgs/development/libraries/science/math/suitesparse/default.nix @@ -36,6 +36,18 @@ stdenv.mkDerivation { NIX_CFLAGS = "-fPIC"; postInstall = '' + # Build and install shared library + ( + cd "$(mktemp -d)" + for i in "$out"/lib/lib*.a; do + ar -x $i + done + gcc *.o --shared -o "$out/lib/libsuitesparse.so" + ) + for i in umfpack cholmod amd camd colamd spqr; do + ln -s libsuitesparse.so "$out"/lib/lib$i.so; + done + # Install documentation outdoc=$out/share/doc/${name} mkdir -p $outdoc