Commit 76525c38 authored by Vaibhav Sagar's avatar Vaibhav Sagar

release{,-8.2}.nix: add ihaskell-nbconvert script

parent 71cca569
...@@ -104,6 +104,12 @@ let ...@@ -104,6 +104,12 @@ let
export PATH="${nixpkgs.stdenv.lib.makeBinPath ([ ihaskellEnv jupyter ] ++ systemPackages nixpkgs)}" export PATH="${nixpkgs.stdenv.lib.makeBinPath ([ ihaskellEnv jupyter ] ++ systemPackages nixpkgs)}"
${ihaskellEnv}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) --use-rtsopts="${rtsopts}" && ${jupyter}/bin/jupyter notebook ${ihaskellEnv}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) --use-rtsopts="${rtsopts}" && ${jupyter}/bin/jupyter notebook
''; '';
nbconvertSh = nixpkgs.writeScriptBin "ihaskell-nbconvert" ''
#! ${nixpkgs.stdenv.shell}
export GHC_PACKAGE_PATH="$(echo ${ihaskellEnv}/lib/*/package.conf.d| tr ' ' ':'):$GHC_PACKAGE_PATH"
export PATH="${nixpkgs.stdenv.lib.makeBinPath ([ ihaskellEnv jupyter ] ++ systemPackages nixpkgs)}"
${ihaskellEnv}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) --use-rtsopts="${rtsopts}" && ${jupyter}/bin/jupyter nbconvert "$@"
'';
in in
nixpkgs.buildEnv { nixpkgs.buildEnv {
name = "ihaskell-with-packages"; name = "ihaskell-with-packages";
...@@ -111,6 +117,7 @@ nixpkgs.buildEnv { ...@@ -111,6 +117,7 @@ nixpkgs.buildEnv {
paths = [ ihaskellEnv jupyter ]; paths = [ ihaskellEnv jupyter ];
postBuild = '' postBuild = ''
ln -s ${ihaskellSh}/bin/ihaskell-notebook $out/bin/ ln -s ${ihaskellSh}/bin/ihaskell-notebook $out/bin/
ln -s ${nbconvertSh}/bin/ihaskell-nbconvert $out/bin/
for prg in $out/bin"/"*;do for prg in $out/bin"/"*;do
if [[ -f $prg && -x $prg ]]; then if [[ -f $prg && -x $prg ]]; then
wrapProgram $prg --set PYTHONPATH "$(echo ${jupyter}/lib/*/site-packages)" wrapProgram $prg --set PYTHONPATH "$(echo ${jupyter}/lib/*/site-packages)"
......
...@@ -71,6 +71,12 @@ let ...@@ -71,6 +71,12 @@ let
export PATH="${nixpkgs.stdenv.lib.makeBinPath ([ ihaskellEnv jupyter ] ++ systemPackages nixpkgs)}" export PATH="${nixpkgs.stdenv.lib.makeBinPath ([ ihaskellEnv jupyter ] ++ systemPackages nixpkgs)}"
${ihaskellEnv}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) --use-rtsopts="${rtsopts}" && ${jupyter}/bin/jupyter notebook ${ihaskellEnv}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) --use-rtsopts="${rtsopts}" && ${jupyter}/bin/jupyter notebook
''; '';
nbconvertSh = nixpkgs.writeScriptBin "ihaskell-nbconvert" ''
#! ${nixpkgs.stdenv.shell}
export GHC_PACKAGE_PATH="$(echo ${ihaskellEnv}/lib/*/package.conf.d| tr ' ' ':'):$GHC_PACKAGE_PATH"
export PATH="${nixpkgs.stdenv.lib.makeBinPath ([ ihaskellEnv jupyter ] ++ systemPackages nixpkgs)}"
${ihaskellEnv}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) --use-rtsopts="${rtsopts}" && ${jupyter}/bin/jupyter nbconvert "$@"
'';
in in
nixpkgs.buildEnv { nixpkgs.buildEnv {
name = "ihaskell-with-packages"; name = "ihaskell-with-packages";
...@@ -78,6 +84,7 @@ nixpkgs.buildEnv { ...@@ -78,6 +84,7 @@ nixpkgs.buildEnv {
paths = [ ihaskellEnv jupyter ]; paths = [ ihaskellEnv jupyter ];
postBuild = '' postBuild = ''
ln -s ${ihaskellSh}/bin/ihaskell-notebook $out/bin/ ln -s ${ihaskellSh}/bin/ihaskell-notebook $out/bin/
ln -s ${nbconvertSh}/bin/ihaskell-nbconvert $out/bin/
for prg in $out/bin"/"*;do for prg in $out/bin"/"*;do
if [[ -f $prg && -x $prg ]]; then if [[ -f $prg && -x $prg ]]; then
wrapProgram $prg --set PYTHONPATH "$(echo ${jupyter}/lib/*/site-packages)" wrapProgram $prg --set PYTHONPATH "$(echo ${jupyter}/lib/*/site-packages)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment