wolfram-for-jupyter-kernel: init at 0.9.2

Also, add a script 'wolfram-notebook' to easily start a jupyter
notebook for working with the Wolfram Engine.

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Federico Beffa 2022-02-01 13:59:56 +01:00
parent 2055f85304
commit 55a070a616
4 changed files with 67 additions and 0 deletions

View File

@ -0,0 +1,22 @@
{ callPackage
, wolfram-engine
}:
# To test:
# $(nix-build -E 'with import ./. {}; jupyter.override { definitions = { wolfram = wolfram-for-jupyter-kernel.definition; }; }')/bin/jupyter-notebook
let kernel = callPackage ./kernel.nix {};
in {
definition = {
displayName = "Wolfram Language ${wolfram-engine.version}";
argv = [
"${wolfram-engine}/bin/wolfram"
"-script"
"${kernel}/share/Wolfram/WolframLanguageForJupyter/Resources/KernelForWolframLanguageForJupyter.wl"
"{connection_file}"
"ScriptInstall" # suppresses prompt
];
language = "Wolfram Language";
logo32 = "${wolfram-engine}/share/icons/hicolor/32x32/apps/wolfram-wolframlanguage.png";
logo64 = "${wolfram-engine}/share/icons/hicolor/64x64/apps/wolfram-wolframlanguage.png";
};
}

View File

@ -0,0 +1,32 @@
{ stdenv, lib, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "wolfram-for-jupyter-kernel";
version = "0.9.2";
src = fetchFromGitHub {
owner = "WolframResearch";
repo = "WolframLanguageForJupyter";
rev = "v${version}";
sha256 = "19d9dvr0bv7iy0x8mk4f576ha7z7h7id39nyrggwf9cp7gymxf47";
};
dontConfigure = true;
installPhase = ''
patchShebangs ./configure-jupyter.wls
mkdir -p $out/share/Wolfram
cp -r {WolframLanguageForJupyter,images,extras,LICENSE} $out/share/Wolfram
'';
# no tests
doCheck = false;
meta = with lib; {
description = "A Jupyter kernel for Wolfram Language.";
homepage = "https://github.com/WolframResearch/WolframLanguageForJupyter";
license = licenses.mit;
maintainers = with maintainers; [ fbeffa ];
platforms = platforms.all;
};
}

View File

@ -0,0 +1,9 @@
{ lib, stdenv, writeScriptBin, jupyter, wolfram-for-jupyter-kernel }:
let
wolfram-jupyter = jupyter.override { definitions = { wolfram = wolfram-for-jupyter-kernel.definition; }; };
in
writeScriptBin "wolfram-notebook" ''
#! ${stdenv.shell}
${wolfram-jupyter}/bin/jupyter-notebook
''

View File

@ -32637,6 +32637,10 @@ with pkgs;
wolfram-engine = callPackage ../applications/science/math/wolfram-engine { };
wolfram-for-jupyter-kernel = callPackage ../applications/editors/jupyter-kernels/wolfram { };
wolfram-notebook = callPackage ../applications/science/math/wolfram-engine/notebook.nix { };
ipopt = callPackage ../development/libraries/science/math/ipopt { };
gmsh = callPackage ../applications/science/math/gmsh { };