summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
authorDoron Behar <doron.behar@gmail.com>2022-12-31 22:24:10 +0200
committerGitHub <noreply@github.com>2022-12-31 22:24:10 +0200
commita40405b9710589953eef164d6add44702e77fb95 (patch)
tree4be86de97aad9de438fec05f29e1def3120c60f5 /pkgs/applications/science
parent6f94877eb3223fe0bf49ff5b508856f1e631256f (diff)
parentd6a592c02e4b0b6cf0deeff144fe95a866dd6a21 (diff)
downloadnixpkgs-a40405b9710589953eef164d6add44702e77fb95.tar
nixpkgs-a40405b9710589953eef164d6add44702e77fb95.tar.gz
nixpkgs-a40405b9710589953eef164d6add44702e77fb95.tar.bz2
nixpkgs-a40405b9710589953eef164d6add44702e77fb95.tar.lz
nixpkgs-a40405b9710589953eef164d6add44702e77fb95.tar.xz
nixpkgs-a40405b9710589953eef164d6add44702e77fb95.tar.zst
nixpkgs-a40405b9710589953eef164d6add44702e77fb95.zip
Merge pull request #207697 from herberteuler/fix/mathematica-13.2.0
mathematica: 13.1.0 -> 13.2.0
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/math/mathematica/default.nix16
-rw-r--r--pkgs/applications/science/math/mathematica/versions.nix27
2 files changed, 40 insertions, 3 deletions
diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix
index e2526bdffa3..c0f370d8845 100644
--- a/pkgs/applications/science/math/mathematica/default.nix
+++ b/pkgs/applications/science/math/mathematica/default.nix
@@ -4,6 +4,7 @@
 , cudaPackages
 , cudaSupport ? config.cudaSupport or false
 , lang ? "en"
+, webdoc ? false
 , version ? null
 /*
 If you wish to completely override the src, use:
@@ -30,16 +31,20 @@ let versions = callPackage ./versions.nix { };
     matching-versions =
       lib.sort (v1: v2: lib.versionAtLeast v1.version v2.version) (lib.filter
         (v: v.lang == lang
-            && (if version == null then true else isMatching v.version version))
+            && (version == null || isMatching v.version version)
+            && matchesDoc v)
         versions);
 
     found-version =
       if matching-versions == []
       then throw ("No registered Mathematica version found to match"
-                  + " version=${version} and language=${lang}")
+                  + " version=${toString version} and language=${lang},"
+                  + " ${if webdoc
+                        then "using web documentation"
+                        else "and with local documentation"}")
       else lib.head matching-versions;
 
-    specific-drv = ./. + "/(lib.versions.major found-version.version).nix";
+    specific-drv = ./. + "/${lib.versions.major found-version.version}.nix";
 
     real-drv = if lib.pathExists specific-drv
                then specific-drv
@@ -52,6 +57,11 @@ let versions = callPackage ./versions.nix { };
           sublist = l: lib.sublist 0 n l;
       in lib.compareLists lib.compare (sublist as) (sublist bs) == 0;
 
+    matchesDoc = v:
+      builtins.match (if webdoc
+                      then ".*[0-9]_LINUX.sh"
+                      else ".*[0-9]_BNDL_LINUX.sh") v.src.name != null;
+
 in
 
 callPackage real-drv {
diff --git a/pkgs/applications/science/math/mathematica/versions.nix b/pkgs/applications/science/math/mathematica/versions.nix
index 225ceb6e3b2..09df9e13977 100644
--- a/pkgs/applications/science/math/mathematica/versions.nix
+++ b/pkgs/applications/science/math/mathematica/versions.nix
@@ -1,7 +1,34 @@
 { lib, requireFile }:
 
+/*
+ * To calculate the hash of an installer, use a command like this:
+ *
+ *   nix --extra-experimental-features nix-command hash file <installer-file>
+ */
+
 let versions = [
   {
+    version = "13.2.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-T9XOXA6jpgN6bcO/do9sw1L73ABtyxuZCLzftv4Cl6o=";
+    installer = "Mathematica_13.2.0_LINUX.sh";
+  }
+  {
+    version = "13.2.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-YRUvl2H9SwpwDZx04ugd7ZnK5G+t88bzAObXsGGVhk0=";
+    installer = "Mathematica_13.2.0_BNDL_LINUX.sh";
+  }
+  {
+    version = "13.1.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-GZyUYslx/M4aFI3Pj9Osw3/w79/Jp/4T3mRE277pNuM=";
+    installer = "Mathematica_13.1.0_LINUX.sh";
+  }
+  {
     version = "13.1.0";
     lang = "en";
     language = "English";