wolfram-engine: init at 13.0.1

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

+196
+143
pkgs/applications/science/math/wolfram-engine/default.nix
··· 1 + { lib 2 + , stdenv 3 + , autoPatchelfHook 4 + , requireFile 5 + , callPackage 6 + , makeWrapper 7 + , alsa-lib 8 + , dbus 9 + , fontconfig 10 + , freetype 11 + , gcc 12 + , glib 13 + , installShellFiles 14 + , libssh2 15 + , ncurses 16 + , opencv4 17 + , openssl 18 + , unixODBC 19 + , xkeyboard_config 20 + , xorg 21 + , zlib 22 + , libxml2 23 + , libuuid 24 + , lang ? "en" 25 + , libGL 26 + , libGLU 27 + }: 28 + 29 + let 30 + l10n = import ./l10ns.nix { 31 + lib = lib; 32 + inherit requireFile lang; 33 + }; 34 + dirName = "WolframEngine"; 35 + in 36 + stdenv.mkDerivation rec { 37 + inherit (l10n) version name src; 38 + 39 + nativeBuildInputs = [ 40 + autoPatchelfHook 41 + installShellFiles 42 + makeWrapper 43 + ]; 44 + 45 + buildInputs = [ 46 + alsa-lib 47 + dbus 48 + fontconfig 49 + freetype 50 + gcc.cc 51 + gcc.libc 52 + glib 53 + libssh2 54 + ncurses 55 + opencv4 56 + openssl 57 + stdenv.cc.cc.lib 58 + unixODBC 59 + xkeyboard_config 60 + libxml2 61 + libuuid 62 + zlib 63 + libGL 64 + libGLU 65 + ] ++ (with xorg; [ 66 + libX11 67 + libXext 68 + libXtst 69 + libXi 70 + libXmu 71 + libXrender 72 + libxcb 73 + libXcursor 74 + libXfixes 75 + libXrandr 76 + libICE 77 + libSM 78 + ]); 79 + 80 + # some bundled libs are found through LD_LIBRARY_PATH 81 + autoPatchelfIgnoreMissingDeps = true; 82 + 83 + ldpath = lib.makeLibraryPath buildInputs 84 + + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") 85 + (":" + lib.makeSearchPathOutput "lib" "lib64" buildInputs); 86 + 87 + unpackPhase = '' 88 + # find offset from file 89 + offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src) 90 + dd if="$src" ibs=$offset skip=1 | tar -xf - 91 + cd Unix 92 + ''; 93 + 94 + installPhase = '' 95 + cd Installer 96 + sed -i -e 's/^PATH=/# PATH=/' -e 's/=`id -[ug]`/=0/' MathInstaller 97 + 98 + # Installer wants to write default config in HOME 99 + export HOME=$(mktemp -d) 100 + 101 + # Fix the installation script 102 + patchShebangs MathInstaller 103 + substituteInPlace MathInstaller \ 104 + --replace "`hostname`" "" \ 105 + --replace "chgrp" "# chgrp" \ 106 + --replace "chown" ": # chown" 107 + 108 + # Install the desktop items 109 + export XDG_DATA_HOME="$out/share" 110 + 111 + ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/${dirName} -silent 112 + 113 + # Fix library paths 114 + cd $out/libexec/${dirName}/Executables 115 + for path in MathKernel WolframKernel math mcc wolfram; do 116 + makeWrapper $out/libexec/${dirName}/Executables/$path $out/bin/$path --set LD_LIBRARY_PATH "${zlib}/lib:${stdenv.cc.cc.lib}/lib:${libssh2}/lib:\''${LD_LIBRARY_PATH}" 117 + done 118 + 119 + # ... and xkeyboard config path for Qt 120 + for path in WolframPlayer wolframplayer; do 121 + makeWrapper $out/libexec/${dirName}/Executables/$path $out/bin/$path \ 122 + --set LD_LIBRARY_PATH "${zlib}/lib:${stdenv.cc.cc.lib}/lib:${libssh2}/lib:\''${LD_LIBRARY_PATH}" \ 123 + --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" 124 + done 125 + 126 + # Install man pages 127 + installManPage $out/libexec/${dirName}/SystemFiles/SystemDocumentation/Unix/* 128 + ''; 129 + 130 + # This is primarily an IO bound build; there's little benefit to building remotely. 131 + preferLocalBuild = true; 132 + 133 + # Stripping causes the program to core dump. 134 + dontStrip = true; 135 + 136 + meta = with lib; { 137 + description = "Wolfram Engine computational software system"; 138 + homepage = "https://www.wolfram.com/engine/"; 139 + license = licenses.unfree; 140 + maintainers = with maintainers; [ fbeffa ]; 141 + platforms = [ "x86_64-linux" ]; 142 + }; 143 + }
+51
pkgs/applications/science/math/wolfram-engine/l10ns.nix
··· 1 + { lib 2 + , requireFile 3 + , lang 4 + , majorVersion ? null 5 + }: 6 + 7 + let allVersions = with lib; flip map 8 + # N.B. Versions in this list should be ordered from newest to oldest. 9 + [ 10 + { 11 + version = "13.0.1"; 12 + lang = "en"; 13 + language = "English"; 14 + sha256 = "1rrxi7d51m02407k719fq829jzanh550wr810i22n3irhk8axqga"; 15 + installer = "WolframEngine_13.0.1_LINUX.sh"; 16 + } 17 + { 18 + version = "13.0.0"; 19 + lang = "en"; 20 + language = "English"; 21 + sha256 = "10cpwllz9plxz22iqdh6xgkxqphl9s9nq8ax16pafjll6j9kqy1q"; 22 + installer = "WolframEngine_13.0.0_LINUX.sh"; 23 + } 24 + ] 25 + ({ version, lang, language, sha256, installer }: { 26 + inherit version lang; 27 + name = "wolfram-engine-${version}" + optionalString (lang != "en") "-${lang}"; 28 + src = requireFile { 29 + name = installer; 30 + message = '' 31 + This nix expression requires that ${installer} is 32 + already part of the store. Download the file from 33 + https://www.wolfram.com/engine/ and add it to the nix store 34 + with nix-store --add-fixed sha256 <FILE>. 35 + ''; 36 + inherit sha256; 37 + }; 38 + }); 39 + minVersion = 40 + with lib; 41 + if majorVersion == null 42 + then elemAt (builtins.splitVersion (elemAt allVersions 0).version) 0 43 + else majorVersion; 44 + maxVersion = toString (1 + builtins.fromJSON minVersion); 45 + in 46 + with lib; 47 + findFirst (l: (l.lang == lang 48 + && l.version >= minVersion 49 + && l.version < maxVersion)) 50 + (throw "Version ${minVersion} in language ${lang} not supported") 51 + allVersions
+2
pkgs/top-level/all-packages.nix
··· 32635 32635 32636 32636 trilinos-mpi = callPackage ../development/libraries/science/math/trilinos { withMPI = true; }; 32637 32637 32638 + wolfram-engine = callPackage ../applications/science/math/wolfram-engine { }; 32639 + 32638 32640 ipopt = callPackage ../development/libraries/science/math/ipopt { }; 32639 32641 32640 32642 gmsh = callPackage ../applications/science/math/gmsh { };