2022-01-30 17:37:55 +00:00
|
|
|
{ lib
|
|
|
|
, requireFile
|
|
|
|
, lang
|
|
|
|
, majorVersion ? null
|
|
|
|
}:
|
|
|
|
|
2024-08-16 17:28:59 +00:00
|
|
|
let allVersions = lib.flip map
|
2022-01-30 17:37:55 +00:00
|
|
|
# N.B. Versions in this list should be ordered from newest to oldest.
|
|
|
|
[
|
2024-08-15 15:23:13 +00:00
|
|
|
{
|
|
|
|
version = "14.1.0";
|
|
|
|
lang = "en";
|
|
|
|
language = "English";
|
|
|
|
sha256 = "1kxdvm3i7nn3ws784y972h2br1n0y82kkkjvz7c5llssv6d3pgj8";
|
|
|
|
installer = "WolframEngine_14.1.0_LIN.sh";
|
|
|
|
}
|
2023-08-30 14:10:47 +00:00
|
|
|
{
|
|
|
|
version = "13.3.0";
|
|
|
|
lang = "en";
|
|
|
|
language = "English";
|
|
|
|
sha256 = "96106ac8ed6d0e221a68d846117615c14025320f927e5e0ed95b1965eda68e31";
|
|
|
|
installer = "WolframEngine_13.3.0_LINUX.sh";
|
|
|
|
}
|
2023-05-13 12:39:42 +00:00
|
|
|
{
|
|
|
|
version = "13.2.0";
|
|
|
|
lang = "en";
|
|
|
|
language = "English";
|
|
|
|
sha256 = "1xvg1n64iq52jxnk9y551m5iwkkz6cxzwyw28h8d0kq36aaiky24";
|
|
|
|
installer = "WolframEngine_13.2.0_LINUX.sh";
|
|
|
|
}
|
2022-08-18 19:05:09 +00:00
|
|
|
{
|
|
|
|
version = "13.1.0";
|
|
|
|
lang = "en";
|
|
|
|
language = "English";
|
|
|
|
sha256 = "1659kyp38a8xknic95pynx9fsgn96i8jn9lnk89pc8n6vydw1460";
|
|
|
|
installer = "WolframEngine_13.1.0_LINUX.sh";
|
|
|
|
}
|
2022-01-30 17:37:55 +00:00
|
|
|
{
|
|
|
|
version = "13.0.1";
|
|
|
|
lang = "en";
|
|
|
|
language = "English";
|
|
|
|
sha256 = "1rrxi7d51m02407k719fq829jzanh550wr810i22n3irhk8axqga";
|
|
|
|
installer = "WolframEngine_13.0.1_LINUX.sh";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
version = "13.0.0";
|
|
|
|
lang = "en";
|
|
|
|
language = "English";
|
|
|
|
sha256 = "10cpwllz9plxz22iqdh6xgkxqphl9s9nq8ax16pafjll6j9kqy1q";
|
|
|
|
installer = "WolframEngine_13.0.0_LINUX.sh";
|
|
|
|
}
|
|
|
|
]
|
|
|
|
({ version, lang, language, sha256, installer }: {
|
|
|
|
inherit version lang;
|
2024-08-13 20:05:07 +00:00
|
|
|
name = "wolfram-engine-${version}" + lib.optionalString (lang != "en") "-${lang}";
|
2022-01-30 17:37:55 +00:00
|
|
|
src = requireFile {
|
|
|
|
name = installer;
|
|
|
|
message = ''
|
|
|
|
This nix expression requires that ${installer} is
|
|
|
|
already part of the store. Download the file from
|
|
|
|
https://www.wolfram.com/engine/ and add it to the nix store
|
|
|
|
with nix-store --add-fixed sha256 <FILE>.
|
|
|
|
'';
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
minVersion =
|
|
|
|
if majorVersion == null
|
2024-08-13 20:05:07 +00:00
|
|
|
then lib.elemAt (builtins.splitVersion (lib.elemAt allVersions 0).version) 0
|
2022-01-30 17:37:55 +00:00
|
|
|
else majorVersion;
|
|
|
|
maxVersion = toString (1 + builtins.fromJSON minVersion);
|
|
|
|
in
|
2024-08-15 17:49:20 +00:00
|
|
|
lib.findFirst (l: (l.lang == lang
|
2022-01-30 17:37:55 +00:00
|
|
|
&& l.version >= minVersion
|
|
|
|
&& l.version < maxVersion))
|
|
|
|
(throw "Version ${minVersion} in language ${lang} not supported")
|
|
|
|
allVersions
|