2017-11-25 15:20:31 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, fetchpatch
|
|
|
|
, ipykernel
|
|
|
|
, isPy27
|
2017-11-28 21:39:36 +00:00
|
|
|
, python
|
2017-11-25 15:20:31 +00:00
|
|
|
, pexpect
|
2020-08-07 18:11:13 +01:00
|
|
|
, bash
|
2017-11-25 15:20:31 +00:00
|
|
|
}:
|
2017-12-25 18:42:43 +00:00
|
|
|
|
2017-11-25 15:20:31 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bash_kernel";
|
2021-01-21 10:52:09 +00:00
|
|
|
version = "0.7.2";
|
2017-11-25 15:20:31 +00:00
|
|
|
format = "flit";
|
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-01-21 10:52:09 +00:00
|
|
|
sha256 = "0w0nbr3iqqsgpk83rgd0f5b02462bkyj2n0h6i9dwyc1vpnq9350";
|
2017-11-25 15:20:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://patch-diff.githubusercontent.com/raw/takluyver/bash_kernel/pull/69.diff";
|
|
|
|
sha256 = "1qd7qjjmcph4dk6j0bl31h2fdmfiyyazvrc9xqqj8y21ki2sl33j";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-08-07 18:11:13 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace bash_kernel/kernel.py \
|
|
|
|
--replace "'bash'" "'${bash}/bin/bash'" \
|
|
|
|
--replace "\"bash\"" "'${bash}/bin/bash'"
|
|
|
|
'';
|
|
|
|
|
2017-11-25 15:20:31 +00:00
|
|
|
propagatedBuildInputs = [ ipykernel pexpect ];
|
|
|
|
|
2017-12-25 18:42:43 +00:00
|
|
|
# no tests
|
2017-11-25 15:20:31 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
preBuild = ''
|
2017-12-25 18:42:43 +00:00
|
|
|
export HOME=$TMPDIR
|
2017-11-25 15:20:31 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2017-11-28 21:39:36 +00:00
|
|
|
${python.interpreter} -m bash_kernel.install --prefix $out
|
2017-11-25 15:20:31 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Bash Kernel for Jupyter";
|
|
|
|
homepage = "https://github.com/takluyver/bash_kernel";
|
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
maintainers = with lib.maintainers; [ zimbatm ];
|
|
|
|
};
|
|
|
|
}
|