summary refs log tree commit diff
path: root/pkgs/applications/science/math/mathematica/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science/math/mathematica/default.nix')
-rw-r--r--pkgs/applications/science/math/mathematica/default.nix28
1 files changed, 20 insertions, 8 deletions
diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix
index d4d352c95bbb..2f11144bad40 100644
--- a/pkgs/applications/science/math/mathematica/default.nix
+++ b/pkgs/applications/science/math/mathematica/default.nix
@@ -14,6 +14,8 @@
 , unixODBC
 , xlibs
 , zlib
+, libxml2
+, libuuid
 }:
 
 let
@@ -24,17 +26,18 @@ let
       throw "Mathematica requires i686-linux or x86_64 linux";
 in
 stdenv.mkDerivation rec {
+  version = "10.0.1";
 
-  name = "mathematica-9.0.0";
+  name = "mathematica-${version}";
 
   src = requireFile rec {
-    name = "Mathematica_9.0.0_LINUX.sh";
+    name = "Mathematica_${version}_LINUX.sh";
     message = '' 
-      This nix expression requires that Mathematica_9.0.0_LINUX.sh is
+      This nix expression requires that ${name} is
       already part of the store. Find the file on your Mathematica CD
       and add it to the nix store with nix-store --add-fixed sha256 <FILE>.
     '';
-    sha256 = "106zfaplhwcfdl9rdgs25x83xra9zcny94gb22wncbfxvrsk3a4q";
+    sha256 = "1514qy5kbyislv8j7ryw8021k26y0z6dndliwy8hfi7w7kgb3ynq";
   };
 
   buildInputs = [
@@ -51,6 +54,8 @@ stdenv.mkDerivation rec {
     opencv
     openssl
     unixODBC
+    libxml2
+    libuuid
   ] ++ (with xlibs; [
     libX11
     libXext
@@ -59,6 +64,11 @@ stdenv.mkDerivation rec {
     libXmu
     libXrender
     libxcb
+    libXcursor
+    libXfixes
+    libXrandr
+    libICE
+    libSM
   ]);
 
   ldpath = stdenv.lib.makeLibraryPath buildInputs
@@ -92,11 +102,13 @@ stdenv.mkDerivation rec {
         :
       elif [ "$type" == "EXEC" ]; then
         echo "patching $f executable <<"
-        patchelf \
-            --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
-            --set-rpath "${ldpath}" \
-            "$f"
         patchelf --shrink-rpath "$f"
+        patchelf \
+	  --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+          --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
+          "$f" \
+          && patchelf --shrink-rpath "$f" \
+          || echo unable to patch ... ignoring 1>&2
       elif [ "$type" == "DYN" ]; then
         echo "patching $f library <<"
         patchelf \