Matlab server + Octave
parent
6b3b4cf7c2
commit
0f33cdb0db
|
@ -1,8 +1,57 @@
|
||||||
{ config, lib, pkgs, nix-matlab, ... }: {
|
{ config, lib, pkgs, nix-matlab, ... }: let
|
||||||
environment.systemPackages = with nix-matlab.packages.x86_64-linux; [
|
license-manager = pkgs.stdenv.mkDerivation rec {
|
||||||
|
pname = "matlab-license-server";
|
||||||
|
version = "R2023b";
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://ssd.mathworks.com/supportfiles/downloads/${version}/license_manager/${version}/daemons/glnxa64/mathworks_network_license_manager_glnxa64.zip";
|
||||||
|
hash = "sha256-Btl3ETzTtAV+cjqwXf4AE4QJCtssN1s6dmmcpR1EQxY=";
|
||||||
|
};
|
||||||
|
nativeBuildInputs = [
|
||||||
|
pkgs.autoPatchelfHook
|
||||||
|
];
|
||||||
|
unpackPhase = ''
|
||||||
|
${pkgs.unzip}/bin/unzip $src
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp -r * $out/
|
||||||
|
addAutoPatchelfSearchPath $out/*
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
matlab-server = pkgs.buildFHSUserEnv {
|
||||||
|
name = "matlab-server";
|
||||||
|
|
||||||
|
targetPkgs = (ps: nix-matlab.targetPkgs ps ++ [
|
||||||
|
license-manager
|
||||||
|
]);
|
||||||
|
|
||||||
|
runScript = pkgs.writeScript "matlab-server" (nix-matlab.shellHooksCommon + ''
|
||||||
|
exec $MATLAB_INSTALL_DIR/bin/matlab "$@"
|
||||||
|
'');
|
||||||
|
};
|
||||||
|
matlab-server-shell = pkgs.buildFHSUserEnv {
|
||||||
|
name = "matlab-server-shell";
|
||||||
|
|
||||||
|
targetPkgs = (ps: nix-matlab.targetPkgs ps ++ [
|
||||||
|
license-manager
|
||||||
|
]);
|
||||||
|
|
||||||
|
runScript = pkgs.writeScript "matlab-server-shell" (nix-matlab.shellHooksCommon + ''
|
||||||
|
echo license-server is in:
|
||||||
|
echo ${license-manager}
|
||||||
|
echo Make sure it is installed (matlab-server user)
|
||||||
|
exec bash
|
||||||
|
'');
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
environment.systemPackages = (with nix-matlab.packages.x86_64-linux; [
|
||||||
matlab
|
matlab
|
||||||
matlab-shell
|
matlab-shell
|
||||||
|
matlab-server
|
||||||
|
matlab-server-shell
|
||||||
matlab-mlint
|
matlab-mlint
|
||||||
matlab-mex
|
matlab-mex
|
||||||
];
|
]) ++ (with pkgs; [
|
||||||
|
octaveFull
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue