It won't be enough to fix cross in all cases, but it is in at least one: pywayland. I've only made the change in cases I'm confident it's correct, as it would be wrong to change this when python.interpreter is used in wrappers, and possibly when it's used for running tests.
56 lines
1.1 KiB
Nix
56 lines
1.1 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchPypi
|
|
, fetchpatch
|
|
, ipykernel
|
|
, isPy27
|
|
, python
|
|
, pexpect
|
|
, bash
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "bash_kernel";
|
|
version = "0.7.2";
|
|
format = "flit";
|
|
disabled = isPy27;
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "0w0nbr3iqqsgpk83rgd0f5b02462bkyj2n0h6i9dwyc1vpnq9350";
|
|
};
|
|
|
|
patches = [
|
|
(fetchpatch {
|
|
url = "https://patch-diff.githubusercontent.com/raw/takluyver/bash_kernel/pull/69.diff";
|
|
sha256 = "1qd7qjjmcph4dk6j0bl31h2fdmfiyyazvrc9xqqj8y21ki2sl33j";
|
|
})
|
|
];
|
|
|
|
postPatch = ''
|
|
substituteInPlace bash_kernel/kernel.py \
|
|
--replace "'bash'" "'${bash}/bin/bash'" \
|
|
--replace "\"bash\"" "'${bash}/bin/bash'"
|
|
'';
|
|
|
|
propagatedBuildInputs = [ ipykernel pexpect ];
|
|
|
|
# no tests
|
|
doCheck = false;
|
|
|
|
preBuild = ''
|
|
export HOME=$TMPDIR
|
|
'';
|
|
|
|
postInstall = ''
|
|
${python.pythonForBuild.interpreter} -m bash_kernel.install --prefix $out
|
|
'';
|
|
|
|
meta = {
|
|
description = "Bash Kernel for Jupyter";
|
|
homepage = "https://github.com/takluyver/bash_kernel";
|
|
license = lib.licenses.bsd3;
|
|
maintainers = with lib.maintainers; [ zimbatm ];
|
|
};
|
|
}
|