diff options
author | Matthew Justin Bauer <mjbauer95@gmail.com> | 2018-04-23 11:58:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-23 11:58:34 -0500 |
commit | a02d6c99af93d915e82ca377d3d6739af77b2440 (patch) | |
tree | 1eed2fe5a152e45e625858c2594ee2c8a600a7b2 | |
parent | 1439d0b9a2c3268cafd6fa84e2a2e3ceb9a237c6 (diff) | |
parent | 1ed47cf21424ff450ed2ce9059b5ce1a2c7e052a (diff) | |
download | nixpkgs-a02d6c99af93d915e82ca377d3d6739af77b2440.tar nixpkgs-a02d6c99af93d915e82ca377d3d6739af77b2440.tar.gz nixpkgs-a02d6c99af93d915e82ca377d3d6739af77b2440.tar.bz2 nixpkgs-a02d6c99af93d915e82ca377d3d6739af77b2440.tar.lz nixpkgs-a02d6c99af93d915e82ca377d3d6739af77b2440.tar.xz nixpkgs-a02d6c99af93d915e82ca377d3d6739af77b2440.tar.zst nixpkgs-a02d6c99af93d915e82ca377d3d6739af77b2440.zip |
Merge pull request #34014 from mnacamura/mathematica-l10n
mathematica: enable installation of localized editions
-rw-r--r-- | pkgs/applications/science/math/mathematica/default.nix | 23 | ||||
-rw-r--r-- | pkgs/applications/science/math/mathematica/l10ns.nix | 33 |
2 files changed, 42 insertions, 14 deletions
diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix index 1c86097f2ee..9b9d5b250ef 100644 --- a/pkgs/applications/science/math/mathematica/default.nix +++ b/pkgs/applications/science/math/mathematica/default.nix @@ -1,7 +1,7 @@ { stdenv , coreutils , patchelf -, requireFile +, callPackage , alsaLib , dbus , fontconfig @@ -18,6 +18,7 @@ , zlib , libxml2 , libuuid +, lang ? "en" }: let @@ -26,21 +27,15 @@ let "Linux" else throw "Mathematica requires i686-linux or x86_64 linux"; + + l10n = + with stdenv.lib; + with callPackage ./l10ns.nix {}; + flip (findFirst (l: l.lang == lang)) l10ns + (throw "Language '${lang}' not supported"); in stdenv.mkDerivation rec { - version = "11.2.0"; - - name = "mathematica-${version}"; - - src = requireFile rec { - name = "Mathematica_${version}_LINUX.sh"; - message = '' - 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 = "4a1293cc1c404303aa1cab1bd273c7be151d37ac5ed928fbbb18e9c5ab2d8df9"; - }; + inherit (l10n) version name src; buildInputs = [ coreutils diff --git a/pkgs/applications/science/math/mathematica/l10ns.nix b/pkgs/applications/science/math/mathematica/l10ns.nix new file mode 100644 index 00000000000..2158021c754 --- /dev/null +++ b/pkgs/applications/science/math/mathematica/l10ns.nix @@ -0,0 +1,33 @@ +{ lib, requireFile }: + +with lib; +{ + l10ns = flip map + [ + { + version = "11.2.0"; + lang = "en"; + language = "English"; + sha256 = "4a1293cc1c404303aa1cab1bd273c7be151d37ac5ed928fbbb18e9c5ab2d8df9"; + } + { + version = "11.2.0"; + lang = "ja"; + language = "Japanese"; + sha256 = "916392edd32bed8622238df435dd8e86426bb043038a3336f30df10d819b49b1"; + } + ] + ({ version, lang, language, sha256 }: { + inherit version lang; + name = "mathematica-${version}" + optionalString (lang != "en") "-${lang}"; + src = requireFile rec { + name = "Mathematica_${version}" + optionalString (lang != "en") "_${language}" + "_LINUX.sh"; + message = '' + 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>. + ''; + inherit sha256; + }; + }); +} |