@@ -172,10 +172,14 @@ stdenv.mkDerivation rec {
172172 '';
173173
174174 postInstall = ''
175− for prog in "$out/bin/julia" "$out/bin/julia-debug"; do
176− wrapProgram "$prog" \
177− --prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH:$out/lib/julia" \
178− --prefix PATH : "${stdenv.lib.makeBinPath [ curl ]}"
175+ # Symlink shared libraries from LD_LIBRARY_PATH into lib/julia,
176+ # as using a wrapper with LD_LIBRARY_PATH causes segmentation
177+ # faults when program returns an error:
178+ # $ julia -e 'throw(Error())'
179+ find $(echo $LD_LIBRARY_PATH | sed 's|:| |g') -maxdepth 1 -name '*.${if stdenv.isDarwin then "dylib" else "so"}*' | while read lib; do
180+ if [[ ! -e $out/lib/julia/$(basename $lib) ]]; then
181+ ln -sv $lib $out/lib/julia/$(basename $lib)
182+ fi
179183 done
180184 '';
181185