2017-11-25 15:20:31 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, fetchpatch
|
2023-09-10 00:04:22 +02:00
|
|
|
, flit-core
|
2017-11-25 15:20:31 +00:00
|
|
|
, ipykernel
|
|
|
|
, isPy27
|
2017-11-28 21:39:36 +00:00
|
|
|
, python
|
2017-11-25 15:20:31 +00:00
|
|
|
, pexpect
|
2020-08-07 13:11:13 -04:00
|
|
|
, bash
|
2017-11-25 15:20:31 +00:00
|
|
|
}:
|
2017-12-25 19:42:43 +01:00
|
|
|
|
2017-11-25 15:20:31 +00:00
|
|
|
buildPythonPackage rec {
|
2023-11-10 13:17:10 +01:00
|
|
|
pname = "bash-kernel";
|
2023-09-15 14:05:50 +02:00
|
|
|
version = "0.9.1";
|
|
|
|
format = "flit";
|
2017-11-25 15:20:31 +00:00
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
2023-11-10 13:17:10 +01:00
|
|
|
pname = "bash_kernel";
|
|
|
|
inherit version;
|
2023-09-15 14:05:50 +02:00
|
|
|
sha256 = "sha256-AYPVPjYP+baEcQUqmiiagWIXMlFrA04njpcgtdFaFis=";
|
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 13:11:13 -04:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace bash_kernel/kernel.py \
|
|
|
|
--replace "'bash'" "'${bash}/bin/bash'" \
|
|
|
|
--replace "\"bash\"" "'${bash}/bin/bash'"
|
|
|
|
'';
|
|
|
|
|
2023-09-10 00:04:22 +02:00
|
|
|
nativeBuildInputs = [ flit-core ];
|
|
|
|
|
2017-11-25 15:20:31 +00:00
|
|
|
propagatedBuildInputs = [ ipykernel pexpect ];
|
|
|
|
|
2017-12-25 19:42:43 +01:00
|
|
|
# no tests
|
2017-11-25 15:20:31 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
preBuild = ''
|
2017-12-25 19:42:43 +01:00
|
|
|
export HOME=$TMPDIR
|
2017-11-25 15:20:31 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-11-05 17:38:24 -08:00
|
|
|
${python.pythonOnBuildForHost.interpreter} -m bash_kernel.install --prefix $out
|
2017-11-25 15:20:31 +00:00
|
|
|
'';
|
|
|
|
|
2023-03-05 10:50:43 +01:00
|
|
|
meta = with lib; {
|
2017-11-25 15:20:31 +00:00
|
|
|
description = "Bash Kernel for Jupyter";
|
|
|
|
homepage = "https://github.com/takluyver/bash_kernel";
|
2023-03-05 10:50:43 +01:00
|
|
|
changelog = "https://github.com/takluyver/bash_kernel/releases/tag/${version}";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ zimbatm ];
|
2017-11-25 15:20:31 +00:00
|
|
|
};
|
|
|
|
}
|