mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-17 14:19:58 +03:00
parent
e1ad1a0aa2
commit
98c94d3d7d
@ -39,6 +39,22 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
jupyter-kernel-definition = {
|
||||||
|
displayName = "SageMath ${sage-src.version}";
|
||||||
|
argv = [
|
||||||
|
"${sage-with-env}/bin/sage" # FIXME which sage
|
||||||
|
"--python"
|
||||||
|
"-m"
|
||||||
|
"sage.repl.ipython_kernel"
|
||||||
|
"-f"
|
||||||
|
"{connection_file}"
|
||||||
|
];
|
||||||
|
language = "sagemath";
|
||||||
|
# just one 16x16 logo is available
|
||||||
|
logo32 = "${sage-src}/doc/common/themes/sage/static/sageicon.png";
|
||||||
|
logo64 = "${sage-src}/doc/common/themes/sage/static/sageicon.png";
|
||||||
|
};
|
||||||
|
|
||||||
# A bash script setting various environment variables to tell sage where
|
# A bash script setting various environment variables to tell sage where
|
||||||
# the files its looking fore are located. Also see `sage-env`.
|
# the files its looking fore are located. Also see `sage-env`.
|
||||||
env-locations = callPackage ./env-locations.nix {
|
env-locations = callPackage ./env-locations.nix {
|
||||||
@ -158,6 +174,6 @@ let
|
|||||||
in
|
in
|
||||||
# A wrapper around sage that makes sure sage finds its docs (if they were build).
|
# A wrapper around sage that makes sure sage finds its docs (if they were build).
|
||||||
callPackage ./sage.nix {
|
callPackage ./sage.nix {
|
||||||
inherit sage-tests sage-with-env sagedoc;
|
inherit sage-tests sage-with-env sagedoc jupyter-kernel-definition;
|
||||||
inherit withDoc;
|
inherit withDoc;
|
||||||
}
|
}
|
||||||
|
@ -2,12 +2,23 @@
|
|||||||
, makeWrapper
|
, makeWrapper
|
||||||
, sage-tests
|
, sage-tests
|
||||||
, sage-with-env
|
, sage-with-env
|
||||||
|
, jupyter-kernel-definition
|
||||||
|
, jupyter-kernel
|
||||||
, sagedoc
|
, sagedoc
|
||||||
, withDoc
|
, withDoc
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# A wrapper that makes sure sage finds its docs (if they were build).
|
# A wrapper that makes sure sage finds its docs (if they were build) and the
|
||||||
|
# jupyter kernel spec.
|
||||||
|
|
||||||
|
let
|
||||||
|
# generate kernel spec + default kernels
|
||||||
|
kernel-specs = jupyter-kernel.create {
|
||||||
|
definitions = jupyter-kernel.default // {
|
||||||
|
sagemath = jupyter-kernel-definition;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = src.version;
|
version = src.version;
|
||||||
name = "sage-${version}";
|
name = "sage-${version}";
|
||||||
@ -30,7 +41,8 @@ stdenv.mkDerivation rec {
|
|||||||
makeWrapper "${sage-with-env}/bin/sage" "$out/bin/sage" \
|
makeWrapper "${sage-with-env}/bin/sage" "$out/bin/sage" \
|
||||||
--set SAGE_DOC_SRC_OVERRIDE "${src}/src/doc" ${
|
--set SAGE_DOC_SRC_OVERRIDE "${src}/src/doc" ${
|
||||||
stdenv.lib.optionalString withDoc "--set SAGE_DOC_OVERRIDE ${sagedoc}/share/doc/sage"
|
stdenv.lib.optionalString withDoc "--set SAGE_DOC_OVERRIDE ${sagedoc}/share/doc/sage"
|
||||||
}
|
} \
|
||||||
|
--prefix JUPYTER_PATH : "${kernel-specs}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doInstallCheck = withDoc;
|
doInstallCheck = withDoc;
|
||||||
@ -44,6 +56,7 @@ stdenv.mkDerivation rec {
|
|||||||
tests = sage-tests;
|
tests = sage-tests;
|
||||||
doc = sagedoc;
|
doc = sagedoc;
|
||||||
lib = sage-with-env.env.lib;
|
lib = sage-with-env.env.lib;
|
||||||
|
kernelspec = jupyter-kernel-definition;
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
Loading…
Reference in New Issue
Block a user