From 488db3d392856d841b72986700fc572306972da0 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Nakamura Date: Mon, 17 Jul 2017 12:32:16 +0900 Subject: [PATCH 1/3] mathematica: fix library paths --- pkgs/applications/science/math/mathematica/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix index 1a9adcd4782f..6191af85bd10 100644 --- a/pkgs/applications/science/math/mathematica/default.nix +++ b/pkgs/applications/science/math/mathematica/default.nix @@ -56,6 +56,7 @@ stdenv.mkDerivation rec { unixODBC libxml2 libuuid + zlib ] ++ (with xorg; [ libX11 libXext @@ -93,6 +94,12 @@ stdenv.mkDerivation rec { echo "=== Running MathInstaller ===" ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/Mathematica -silent + + # Fix library paths + cd $out/libexec/Mathematica/Executables + for path in mathematica MathKernel Mathematica WolframKernel wolfram; do + sed -i -e 's/export LD_LIBRARY_PATH/export LD_LIBRARY_PATH=${builtins.replaceStrings ["/"] ["\\/"] "${zlib}/lib"}:\''${LD_LIBRARY_PATH}/' $path + done ''; preFixup = '' From 7aaea7297e4a6be6e0e5bd3788df599d0b1cdac8 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Nakamura Date: Wed, 19 Jul 2017 15:18:44 +0900 Subject: [PATCH 2/3] Simplify the sed script --- pkgs/applications/science/math/mathematica/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix index 6191af85bd10..d2c62cdf21d5 100644 --- a/pkgs/applications/science/math/mathematica/default.nix +++ b/pkgs/applications/science/math/mathematica/default.nix @@ -98,7 +98,7 @@ stdenv.mkDerivation rec { # Fix library paths cd $out/libexec/Mathematica/Executables for path in mathematica MathKernel Mathematica WolframKernel wolfram; do - sed -i -e 's/export LD_LIBRARY_PATH/export LD_LIBRARY_PATH=${builtins.replaceStrings ["/"] ["\\/"] "${zlib}/lib"}:\''${LD_LIBRARY_PATH}/' $path + sed -i -e 's#export LD_LIBRARY_PATH$#export LD_LIBRARY_PATH=${zlib}/lib:\''${LD_LIBRARY_PATH}#' $path done ''; From fb2302e115b518ccb5349ac3a4827a3cbdb38640 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Nakamura Date: Wed, 19 Jul 2017 17:39:36 +0900 Subject: [PATCH 3/3] Add missing 'math' --- pkgs/applications/science/math/mathematica/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix index d2c62cdf21d5..10737a92f8c2 100644 --- a/pkgs/applications/science/math/mathematica/default.nix +++ b/pkgs/applications/science/math/mathematica/default.nix @@ -97,7 +97,7 @@ stdenv.mkDerivation rec { # Fix library paths cd $out/libexec/Mathematica/Executables - for path in mathematica MathKernel Mathematica WolframKernel wolfram; do + for path in mathematica MathKernel Mathematica WolframKernel wolfram math; do sed -i -e 's#export LD_LIBRARY_PATH$#export LD_LIBRARY_PATH=${zlib}/lib:\''${LD_LIBRARY_PATH}#' $path done '';