2023-09-26 11:44:11 -04:00
|
|
|
{ config, lib, pkgs, nix-matlab, ... }: let
|
|
|
|
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; [
|
2023-07-28 10:02:26 -04:00
|
|
|
matlab
|
|
|
|
matlab-shell
|
2023-09-26 11:44:11 -04:00
|
|
|
matlab-server
|
|
|
|
matlab-server-shell
|
2023-07-28 10:02:26 -04:00
|
|
|
matlab-mlint
|
|
|
|
matlab-mex
|
2023-09-26 11:44:11 -04:00
|
|
|
]) ++ (with pkgs; [
|
|
|
|
octaveFull
|
|
|
|
]);
|
2023-07-28 10:02:26 -04:00
|
|
|
}
|