git.iko.soy/typeable/nixpkgs
on master help sign in
mathematica: 11.3.0 -> 12.0.0 (#65031)

* mathematica: archive version 11 * mathematica: 11.3.0 -> 12.0.0

commit6988b0b929d78b4f237b917baad1fb979adaa5c2 authorGuanpeng Xu <herberteuler@gmail.com> dateWed 24 Jul 2019, 04:23 (7 years ago) parent36a6109
5 files changed+194−15
maintainers/maintainer-list.nix+5 pkgs/applications/science/math/mathematica/11.nix+150 pkgs/applications/science/math/mathematica/default.nix+12−10 pkgs/applications/science/math/mathematica/l10ns.nix+26−5 pkgs/top-level/all-packages.nix+1
maintainers/maintainer-list.nix+5
@@ -2132,6 +2132,11 @@
21322132 github = "henrytill";
21332133 name = "Henry Till";
21342134 };
2135+ herberteuler = {
2136+ email = "herberteuler@gmail.com";
2137+ github = "herberteuler";
2138+ name = "Guanpeng Xu";
2139+ };
21352140 hhm = {
21362141 email = "heehooman+nixpkgs@gmail.com";
21372142 github = "hhm0";
pkgs/applications/science/math/mathematica/11.nixnew file+150
@@ -0,0 +1,150 @@
1+{ stdenv
2+, coreutils
3+, patchelf
4+, requireFile
5+, callPackage
6+, alsaLib
7+, dbus
8+, fontconfig
9+, freetype
10+, gcc
11+, glib
12+, ncurses
13+, opencv
14+, openssl
15+, unixODBC
16+, xkeyboard_config
17+, xorg
18+, zlib
19+, libxml2
20+, libuuid
21+, lang ? "en"
22+, libGL
23+, libGLU
24+}:
25+
26+let
27+ l10n =
28+ import ./l10ns.nix {
29+ lib = stdenv.lib;
30+ inherit requireFile lang;
31+ majorVersion = "11";
32+ };
33+in
34+stdenv.mkDerivation rec {
35+ inherit (l10n) version name src;
36+
37+ buildInputs = [
38+ coreutils
39+ patchelf
40+ alsaLib
41+ coreutils
42+ dbus
43+ fontconfig
44+ freetype
45+ gcc.cc
46+ gcc.libc
47+ glib
48+ ncurses
49+ opencv
50+ openssl
51+ unixODBC
52+ xkeyboard_config
53+ libxml2
54+ libuuid
55+ zlib
56+ libGL
57+ libGLU
58+ ] ++ (with xorg; [
59+ libX11
60+ libXext
61+ libXtst
62+ libXi
63+ libXmu
64+ libXrender
65+ libxcb
66+ libXcursor
67+ libXfixes
68+ libXrandr
69+ libICE
70+ libSM
71+ ]);
72+
73+ ldpath = stdenv.lib.makeLibraryPath buildInputs
74+ + stdenv.lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux")
75+ (":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);
76+
77+ phases = "unpackPhase installPhase fixupPhase";
78+
79+ unpackPhase = ''
80+ echo "=== Extracting makeself archive ==="
81+ # find offset from file
82+ offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src)
83+ dd if="$src" ibs=$offset skip=1 | tar -xf -
84+ cd Unix
85+ '';
86+
87+ installPhase = ''
88+ cd Installer
89+ # don't restrict PATH, that has already been done
90+ sed -i -e 's/^PATH=/# PATH=/' MathInstaller
91+ sed -i -e 's/\/bin\/bash/\/bin\/sh/' MathInstaller
92+
93+ echo "=== Running MathInstaller ==="
94+ ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/Mathematica -silent
95+
96+ # Fix library paths
97+ cd $out/libexec/Mathematica/Executables
98+ for path in mathematica MathKernel Mathematica WolframKernel wolfram math; do
99+ sed -i -e 's#export LD_LIBRARY_PATH$#export LD_LIBRARY_PATH=${zlib}/lib:\''${LD_LIBRARY_PATH}#' $path
100+ done
101+
102+ # Fix xkeyboard config path for Qt
103+ for path in mathematica Mathematica; do
104+ line=$(grep -n QT_PLUGIN_PATH $path | sed 's/:.*//')
105+ sed -i -e "$line iexport QT_XKB_CONFIG_ROOT=\"${xkeyboard_config}/share/X11/xkb\"" $path
106+ done
107+ '';
108+
109+ preFixup = ''
110+ echo "=== PatchElfing away ==="
111+ # This code should be a bit forgiving of errors, unfortunately
112+ set +e
113+ find $out/libexec/Mathematica/SystemFiles -type f -perm -0100 | while read f; do
114+ type=$(readelf -h "$f" 2>/dev/null | grep 'Type:' | sed -e 's/ *Type: *\([A-Z]*\) (.*/\1/')
115+ if [ -z "$type" ]; then
116+ :
117+ elif [ "$type" == "EXEC" ]; then
118+ echo "patching $f executable <<"
119+ patchelf --shrink-rpath "$f"
120+ patchelf \
121+ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
122+ --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
123+ "$f" \
124+ && patchelf --shrink-rpath "$f" \
125+ || echo unable to patch ... ignoring 1>&2
126+ elif [ "$type" == "DYN" ]; then
127+ echo "patching $f library <<"
128+ patchelf \
129+ --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
130+ "$f" \
131+ && patchelf --shrink-rpath "$f" \
132+ || echo unable to patch ... ignoring 1>&2
133+ else
134+ echo "not patching $f <<: unknown elf type"
135+ fi
136+ done
137+ '';
138+
139+ # all binaries are already stripped
140+ dontStrip = true;
141+
142+ # we did this in prefixup already
143+ dontPatchELF = true;
144+
145+ meta = {
146+ description = "Wolfram Mathematica computational software system";
147+ homepage = http://www.wolfram.com/mathematica/;
148+ license = stdenv.lib.licenses.unfree;
149+ };
150+}
pkgs/applications/science/math/mathematica/default.nix+12−10
@@ -1,6 +1,7 @@
11{ stdenv
22, coreutils
33, patchelf
4+, requireFile
45, callPackage
56, alsaLib
67, dbus
@@ -24,10 +25,10 @@
2425
2526let
2627 l10n =
27− with stdenv.lib;
28− with callPackage ./l10ns.nix {};
29− flip (findFirst (l: l.lang == lang)) l10ns
30− (throw "Language '${lang}' not supported");
28+ import ./l10ns.nix {
29+ lib = stdenv.lib;
30+ inherit requireFile lang;
31+ };
3132in
3233stdenv.mkDerivation rec {
3334 inherit (l10n) version name src;
@@ -72,8 +73,6 @@ stdenv.mkDerivation rec {
7273 + stdenv.lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux")
7374 (":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" buildInputs);
7475
75− phases = "unpackPhase installPhase fixupPhase";
76−
7776 unpackPhase = ''
7877 echo "=== Extracting makeself archive ==="
7978 # find offset from file
@@ -99,8 +98,7 @@ stdenv.mkDerivation rec {
9998
10099 # Fix xkeyboard config path for Qt
101100 for path in mathematica Mathematica; do
102− line=$(grep -n QT_PLUGIN_PATH $path | sed 's/:.*//')
103− sed -i -e "$line iexport QT_XKB_CONFIG_ROOT=\"${xkeyboard_config}/share/X11/xkb\"" $path
101+ sed -i -e "2iexport QT_XKB_CONFIG_ROOT=\"${xkeyboard_config}/share/X11/xkb\"\n" $path
104102 done
105103 '';
106104
@@ -134,15 +132,19 @@ stdenv.mkDerivation rec {
134132 done
135133 '';
136134
135+ dontBuild = true;
136+
137137 # all binaries are already stripped
138138 dontStrip = true;
139139
140140 # we did this in prefixup already
141141 dontPatchELF = true;
142142
143− meta = {
143+ meta = with stdenv.lib; {
144144 description = "Wolfram Mathematica computational software system";
145145 homepage = http://www.wolfram.com/mathematica/;
146− license = stdenv.lib.licenses.unfree;
146+ license = licenses.unfree;
147+ maintainers = with maintainers; [ herberteuler ];
148+ platforms = [ "x86_64-linux" ];
147149 };
148150}
pkgs/applications/science/math/mathematica/l10ns.nix+26−5
@@ -1,9 +1,18 @@
1−{ lib, requireFile }:
1+{ lib
2+, requireFile
3+, lang
4+, majorVersion ? null
5+}:
26
3−with lib;
4−{
5− l10ns = flip map
7+let allVersions = with lib; flip map
8+ # N.B. Versions in this list should be ordered from newest to oldest.
69 [
10+ {
11+ version = "12.0.0";
12+ lang = "en";
13+ language = "English";
14+ sha256 = "b9fb71e1afcc1d72c200196ffa434512d208fa2920e207878433f504e58ae9d7";
15+ }
716 {
817 version = "11.3.0";
918 lang = "en";
@@ -30,4 +39,16 @@ with lib;
3039 inherit sha256;
3140 };
3241 });
33−}
42+minVersion =
43+ with lib;
44+ if majorVersion == null
45+ then elemAt (builtins.splitVersion (elemAt allVersions 0).version) 0
46+ else majorVersion;
47+maxVersion = toString (1 + builtins.fromJSON minVersion);
48+in
49+with lib;
50+findFirst (l: (l.lang == lang
51+ && l.version >= minVersion
52+ && l.version < maxVersion))
53+ (throw "Version ${minVersion} in language ${lang} not supported")
54+ allVersions
pkgs/top-level/all-packages.nix+1
@@ -22710,6 +22710,7 @@ in
2271022710 mathematica = callPackage ../applications/science/math/mathematica { };
2271122711 mathematica9 = callPackage ../applications/science/math/mathematica/9.nix { };
2271222712 mathematica10 = callPackage ../applications/science/math/mathematica/10.nix { };
22713+ mathematica11 = callPackage ../applications/science/math/mathematica/11.nix { };
2271322714
2271422715 metis = callPackage ../development/libraries/science/math/metis {};
2271522716