Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
cf29b2c5
Unverified
Commit
cf29b2c5
authored
Sep 12, 2021
by
Vaibhav Sagar
Committed by
GitHub
Sep 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
release.nix: construct kernel.json manually, obviating the need for ihaskell wrappers (#1277)
parent
119655f9
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
22 deletions
+49
-22
nix.yml
.github/workflows/nix.yml
+1
-1
README.md
README.md
+1
-1
release-8.10.nix
release-8.10.nix
+1
-2
release-9.0.nix
release-9.0.nix
+1
-2
release.nix
release.nix
+45
-16
No files found.
.github/workflows/nix.yml
View file @
cf29b2c5
...
@@ -50,5 +50,5 @@ jobs:
...
@@ -50,5 +50,5 @@ jobs:
nix-shell \
nix-shell \
-I nixpkgs=https://github.com/NixOS/nixpkgs/tarball/nixos-21.05 \
-I nixpkgs=https://github.com/NixOS/nixpkgs/tarball/nixos-21.05 \
-p jq --run \
-p jq --run \
'test/acceptance.nbconvert.sh result/bin/
ihaskell-
nbconvert'
'test/acceptance.nbconvert.sh result/bin/
jupyter
nbconvert'
README.md
View file @
cf29b2c5
...
@@ -156,7 +156,7 @@ notebook environment with one command. For example:
...
@@ -156,7 +156,7 @@ notebook environment with one command. For example:
```
bash
```
bash
$
nix-build
-I
nixpkgs
=
https://github.com/NixOS/nixpkgs-channels/archive/nixos-20.03.tar.gz release.nix
--argstr
compiler ghc865
--arg
packages
"haskellPackages: [ haskellPackages.lens ]"
$
nix-build
-I
nixpkgs
=
https://github.com/NixOS/nixpkgs-channels/archive/nixos-20.03.tar.gz release.nix
--argstr
compiler ghc865
--arg
packages
"haskellPackages: [ haskellPackages.lens ]"
<result path>
<result path>
$
<result path>/bin/
ihaskell-
notebook
$
<result path>/bin/
jupyter
notebook
```
```
It might take a while the first time, but subsequent builds will be much
It might take a while the first time, but subsequent builds will be much
...
...
release-8.10.nix
View file @
cf29b2c5
{
compiler
?
"ghc8104"
{
compiler
?
"ghc8104"
,
jupyterlabAppDir
?
null
,
nixpkgs
?
import
<
nixpkgs
>
{}
,
nixpkgs
?
import
<
nixpkgs
>
{}
,
packages
?
(
_
:
[])
,
packages
?
(
_
:
[])
,
pythonPackages
?
(
_
:
[])
,
pythonPackages
?
(
_
:
[])
,
rtsopts
?
"-M3g -N2"
,
rtsopts
?
"-M3g -N2"
,
systemPackages
?
(
_
:
[])
,
systemPackages
?
(
_
:
[])
}:
}:
import
(
./release.nix
)
{
inherit
compiler
jupyterlabAppDir
nixpkgs
packages
pythonPackages
rtsopts
systemPackages
;
}
import
(
./release.nix
)
{
inherit
compiler
nixpkgs
packages
pythonPackages
rtsopts
systemPackages
;
}
release-9.0.nix
View file @
cf29b2c5
...
@@ -5,11 +5,10 @@ let
...
@@ -5,11 +5,10 @@ let
};
};
in
in
{
compiler
?
"ghc901"
{
compiler
?
"ghc901"
,
jupyterlabAppDir
?
null
,
nixpkgs
?
import
nixpkgs-src
{}
,
nixpkgs
?
import
nixpkgs-src
{}
,
packages
?
(
_
:
[])
,
packages
?
(
_
:
[])
,
pythonPackages
?
(
_
:
[])
,
pythonPackages
?
(
_
:
[])
,
rtsopts
?
"-M3g -N2"
,
rtsopts
?
"-M3g -N2"
,
systemPackages
?
(
_
:
[])
,
systemPackages
?
(
_
:
[])
}:
}:
import
(
./release.nix
)
{
inherit
compiler
jupyterlabAppDir
nixpkgs
packages
pythonPackages
rtsopts
systemPackages
;
}
import
(
./release.nix
)
{
inherit
compiler
nixpkgs
packages
pythonPackages
rtsopts
systemPackages
;
}
release.nix
View file @
cf29b2c5
{
compiler
{
compiler
,
jupyterlabAppDir
?
null
,
nixpkgs
?
import
<
nixpkgs
>
{}
,
nixpkgs
?
import
<
nixpkgs
>
{}
,
packages
?
(
_
:
[])
,
packages
?
(
_
:
[])
,
pythonPackages
?
(
_
:
[])
,
pythonPackages
?
(
_
:
[])
...
@@ -59,34 +58,64 @@ let
...
@@ -59,34 +58,64 @@ let
exec
${
ihaskellEnv
}
/bin/ihaskell "$@"
exec
${
ihaskellEnv
}
/bin/ihaskell "$@"
''
;
''
;
ihaskellJupyterCmdSh
=
cmd
:
extraArgs
:
nixpkgs
.
writeShellScriptBin
"ihaskell-
${
cmd
}
"
''
ihaskellGhcLib
=
nixpkgs
.
writeShellScriptBin
"ihaskell"
''
export PATH="
${
nixpkgs
.
lib
.
makeBinPath
([
ihaskellEnv
jupyterlab
]
++
systemPackages
nixpkgs
)
}
''$
{PATH:+:}$PATH"
${
haskellPackages
.
ihaskell
}
/bin/ihaskell -l $(
${
ihaskellEnv
}
/bin/ghc --print-libdir) "$@"
export JUPYTER_DATA_DIR=$(mktemp -d) # Install IHaskell kernel and extension files to a fresh directory
''
;
${
ihaskellEnv
}
/bin/ihaskell install \
-l $(
${
ihaskellEnv
}
/bin/ghc --print-libdir) \
kernelFile
=
{
--use-rtsopts="
${
rtsopts
}
" \
display_name
=
"Haskell"
;
&&
${
jupyterlab
}
/bin/jupyter
${
cmd
}
${
extraArgs
}
"$@"
argv
=
[
"
${
ihaskellGhcLib
}
/bin/ihaskell"
"kernel"
"{connection_file}"
"+RTS"
]
++
(
nixpkgs
.
lib
.
splitString
" "
rtsopts
)
++
[
"-RTS"
];
language
=
"haskell"
;
};
ihaskellKernelSpec
=
nixpkgs
.
runCommand
"ihaskell-kernel"
{}
''
export kerneldir=$out/kernels/haskell
mkdir -p $kerneldir
cp
${
./html
}
/* $kerneldir
echo '
${
builtins
.
toJSON
kernelFile
}
' > $kerneldir/kernel.json
''
;
''
;
appDir
=
if
jupyterlabAppDir
!=
null
then
"--app-dir=
${
jupyterlabAppDir
}
"
ihaskellLabextension
=
nixpkgs
.
runCommand
"ihaskell-labextension"
{}
''
else
""
;
export labextensiondir=$out/labextensions/jupyterlab-ihaskell
mkdir -p $labextensiondir
cp -R
${
./jupyterlab-ihaskell/labextension
}
/* $labextensiondir
''
;
ihaskellDataDir
=
nixpkgs
.
buildEnv
{
name
=
"ihaskell-data-dir"
;
paths
=
[
ihaskellKernelSpec
ihaskellLabextension
];
};
in
in
nixpkgs
.
buildEnv
{
nixpkgs
.
buildEnv
{
name
=
"ihaskell-with-packages"
;
name
=
"ihaskell-with-packages"
;
buildInputs
=
[
nixpkgs
.
makeWrapper
];
paths
=
[
ihaskellEnv
jupyterlab
];
paths
=
[
ihaskellEnv
jupyterlab
];
postBuild
=
''
postBuild
=
''
ln -s
${
ihaskellJupyterCmdSh
"lab"
appDir
}
/bin/ihaskell-lab $out/bin/
for prg in $out/bin"/"*;do
ln -s
${
ihaskellJupyterCmdSh
"notebook"
""
}
/bin/ihaskell-notebook $out/bin/
if [[ -f $prg && -x $prg ]]; then
ln -s
${
ihaskellJupyterCmdSh
"nbconvert"
""
}
/bin/ihaskell-nbconvert $out/bin/
wrapProgram $prg \
ln -s
${
ihaskellJupyterCmdSh
"console"
"--kernel=haskell"
}
/bin/ihaskell-console $out/bin/
--prefix PATH : "
${
nixpkgs
.
lib
.
makeBinPath
([
ihaskellEnv
]
++
systemPackages
nixpkgs
)
}
" \
--prefix JUPYTER_PATH : "
${
ihaskellDataDir
}
"
fi
done
''
;
''
;
passthru
=
{
passthru
=
{
inherit
haskellPackages
;
inherit
haskellPackages
;
inherit
ihaskellEnv
;
inherit
ihaskellEnv
;
inherit
jupyterlab
;
inherit
jupyterlab
;
inherit
ihaskellJupyterCmdSh
;
inherit
ihaskellWrapperSh
;
inherit
ihaskellWrapperSh
;
inherit
ihaskellKernelSpec
;
inherit
ihaskellLabextension
;
inherit
ihaskellDataDir
;
ihaskellJsFile
=
./.
+
"/html/kernel.js"
;
ihaskellJsFile
=
./.
+
"/html/kernel.js"
;
ihaskellLogo64
=
./.
+
"/html/logo-64x64.svg"
;
ihaskellLogo64
=
./.
+
"/html/logo-64x64.svg"
;
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment