summary refs log tree commit diff
path: root/pkgs/development/compilers/julia
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@gmail.com>2015-06-04 13:31:15 -0500
committerThomas Tuegel <ttuegel@gmail.com>2015-06-04 17:42:04 -0500
commit6e3eac5c92036554974b34443e8157b7af9b67df (patch)
treeb518490e7fdc6a3bc16d21f313ffb893e2bea62f /pkgs/development/compilers/julia
parent1a11b52ffab4c1832f0367fa15142f8b3ebda9c4 (diff)
downloadnixlib-6e3eac5c92036554974b34443e8157b7af9b67df.tar
nixlib-6e3eac5c92036554974b34443e8157b7af9b67df.tar.gz
nixlib-6e3eac5c92036554974b34443e8157b7af9b67df.tar.bz2
nixlib-6e3eac5c92036554974b34443e8157b7af9b67df.tar.lz
nixlib-6e3eac5c92036554974b34443e8157b7af9b67df.tar.xz
nixlib-6e3eac5c92036554974b34443e8157b7af9b67df.tar.zst
nixlib-6e3eac5c92036554974b34443e8157b7af9b67df.zip
julia03: avoid opaque shell scripts
The old expression used a shell script to set some repetitive
makeFlags. The makeFlags settings were spread out over different parts
of the expression. This deters new contributors. The new expression is
clearer, at the cost of being slightly repetitive.
Diffstat (limited to 'pkgs/development/compilers/julia')
-rw-r--r--pkgs/development/compilers/julia/0.3.nix61
1 files changed, 34 insertions, 27 deletions
diff --git a/pkgs/development/compilers/julia/0.3.nix b/pkgs/development/compilers/julia/0.3.nix
index fdf6ee1dec22..42b296c7b859 100644
--- a/pkgs/development/compilers/julia/0.3.nix
+++ b/pkgs/development/compilers/julia/0.3.nix
@@ -35,6 +35,29 @@ stdenv.mkDerivation rec {
       };
     in [ dsfmt_src ];
 
+  prePatch = ''
+    copy_kill_hash(){
+      cp "$1" "$2/$(basename "$1" | sed -e 's/^[a-z0-9]*-//')"
+    }
+
+    for i in $extraSrcs; do
+      copy_kill_hash "$i" deps
+    done
+  '';
+
+  postPatch = ''
+    sed -i deps/Makefile \
+        -e "s@/usr/local/lib@$out/lib@g" \
+        -e "s@/usr/lib@$out/lib@g" \
+        -e "s@/usr/include/double-conversion@${double_conversion}/include/double-conversion@g"
+
+    patchShebangs . contrib
+
+    # ldconfig doesn't seem to ever work on NixOS; system-wide ldconfig cache
+    # is probably not what we want anyway on non-NixOS
+    sed -e "s@/sbin/ldconfig@true@" -i src/ccall.*
+  '';
+
   buildInputs =
     [ libunwind llvm readline utf8proc zlib
       double_conversion fftw fftwSinglePrec glpk gmp mpfr pcre
@@ -68,28 +91,25 @@ stdenv.mkDerivation rec {
       "LIBLAPACKNAME=libopenblas"
 
       "USE_SYSTEM_ARPACK=1"
+      "USE_SYSTEM_FFTW=1"
+      "USE_SYSTEM_GLPK=1"
+      "USE_SYSTEM_GMP=1"
       "USE_SYSTEM_GRISU=1"
+      "USE_SYSTEM_LIBUNWIND=1"
+      "USE_SYSTEM_LLVM=1"
+      "USE_SYSTEM_MPFR=1"
       "USE_SYSTEM_PATCHELF=1"
+      "USE_SYSTEM_PCRE=1"
+      "USE_SYSTEM_READLINE=1"
+      "USE_SYSTEM_SUITESPARSE=1"
       "USE_SYSTEM_UTF8PROC=1"
+      "USE_SYSTEM_ZLIB=1"
     ];
 
   GLPK_PREFIX = "${glpk}/include";
 
   NIX_CFLAGS_COMPILE = [ "-fPIC" ];
 
-  postPatch = ''
-    sed -i deps/Makefile \
-        -e "s@/usr/local/lib@$out/lib@g" \
-        -e "s@/usr/lib@$out/lib@g" \
-        -e "s@/usr/include/double-conversion@${double_conversion}/include/double-conversion@g"
-
-    patchShebangs . contrib
-
-    # ldconfig doesn't seem to ever work on NixOS; system-wide ldconfig cache
-    # is probably not what we want anyway on non-NixOS
-    sed -e "s@/sbin/ldconfig@true@" -i src/ccall.*
-  '';
-
   # Julia tries to load these libraries dynamically at runtime, but they can't be found.
   # Easier by far to link against them as usual.
   # These go in LDFLAGS, where they affect only Julia itself, and not NIX_LDFLAGS,
@@ -107,20 +127,7 @@ stdenv.mkDerivation rec {
     "-lz"
   ];
 
-  configurePhase = ''
-    for i in GMP LLVM PCRE READLINE FFTW LIBUNWIND SUITESPARSE GLPK ZLIB MPFR;
-    do
-      makeFlags="$makeFlags USE_SYSTEM_$i=1 "
-    done
-
-    copy_kill_hash(){
-      cp "$1" "$2/$(basename "$1" | sed -e 's/^[a-z0-9]*-//')"
-    }
-
-    for i in $extraSrcs; do
-      copy_kill_hash "$i" deps
-    done
-
+  preConfigure = ''
     export PATH="$PATH:${stdenv.cc.libc}/sbin"
   '';