1{ lib 2, buildPythonPackage 3, fetchPypi 4, fetchpatch 5, flit-core 6, ipykernel 7, python 8, pexpect 9, bash 10, substituteAll 11}: 12 13buildPythonPackage rec { 14 pname = "bash-kernel"; 15 version = "0.9.1"; 16 pyproject = true; 17 18 src = fetchPypi { 19 pname = "bash_kernel"; 20 inherit version; 21 hash = "sha256-AYPVPjYP+baEcQUqmiiagWIXMlFrA04njpcgtdFaFis="; 22 }; 23 24 patches = [ 25 (substituteAll { 26 src = ./bash-path.patch; 27 bash = lib.getExe bash; 28 }) 29 ]; 30 31 nativeBuildInputs = [ 32 flit-core 33 ]; 34 35 propagatedBuildInputs = [ 36 ipykernel 37 pexpect 38 ]; 39 40 preBuild = '' 41 export HOME=$TMPDIR 42 ''; 43 44 postInstall = '' 45 ${python.pythonOnBuildForHost.interpreter} -m bash_kernel.install --prefix $out 46 ''; 47 48 # no tests 49 doCheck = false; 50 51 meta = with lib; { 52 description = "Bash Kernel for Jupyter"; 53 homepage = "https://github.com/takluyver/bash_kernel"; 54 changelog = "https://github.com/takluyver/bash_kernel/releases/tag/${version}"; 55 license = licenses.bsd3; 56 maintainers = with maintainers; [ zimbatm ]; 57 }; 58}