python312Packages.bash-kernel: cleanup, fix on darwin

This commit is contained in:
Gaetan Lepage
2025-04-22 22:47:14 +02:00
parent 750167887e
commit 8965dab3a7
@@ -1,14 +1,15 @@
{
lib,
buildPythonPackage,
fetchPypi,
fetchFromGitHub,
replaceVars,
bashInteractive,
flit-core,
filetype,
ipykernel,
python,
pexpect,
bashInteractive,
replaceVars,
writableTmpDirAsHomeHook,
python,
}:
buildPythonPackage rec {
@@ -16,10 +17,11 @@ buildPythonPackage rec {
version = "0.10.0";
pyproject = true;
src = fetchPypi {
pname = "bash_kernel";
inherit version;
hash = "sha256-LtWgpBbEGNHXUecVBb1siJ4SFXREtQxCh6aF2ndcKMo=";
src = fetchFromGitHub {
owner = "takluyver";
repo = "bash_kernel";
tag = version;
hash = "sha256-ugFMcQx1B1nKoO9rhb6PMllRcoZi0O4B9um8dOu5DU4=";
};
patches = [
@@ -36,9 +38,9 @@ buildPythonPackage rec {
pexpect
];
preBuild = ''
export HOME=$TMPDIR
'';
nativeBuildInputs = [
writableTmpDirAsHomeHook
];
postInstall = ''
${python.pythonOnBuildForHost.interpreter} -m bash_kernel.install --prefix $out
@@ -59,6 +61,8 @@ buildPythonPackage rec {
runHook postCheck
'';
__darwinAllowLocalNetworking = true;
meta = {
description = "Bash Kernel for Jupyter";
homepage = "https://github.com/takluyver/bash_kernel";