summary refs log tree commit diff
path: root/pkgs/development/python-modules/bash-kernel/default.nix
blob: 1c50b151f01e64c2f6b17f4282e74c7a5dc0d5e3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{ lib
, buildPythonPackage
, fetchPypi
, fetchpatch
, flit-core
, ipykernel
, python
, pexpect
, bash
, substituteAll
}:

buildPythonPackage rec {
  pname = "bash-kernel";
  version = "0.9.1";
  pyproject = true;

  src = fetchPypi {
    pname = "bash_kernel";
    inherit version;
    hash = "sha256-AYPVPjYP+baEcQUqmiiagWIXMlFrA04njpcgtdFaFis=";
  };

  patches = [
    (substituteAll {
      src = ./bash-path.patch;
      bash = lib.getExe bash;
    })
  ];

  nativeBuildInputs = [
    flit-core
  ];

  propagatedBuildInputs = [
    ipykernel
    pexpect
  ];

  preBuild = ''
    export HOME=$TMPDIR
  '';

  postInstall = ''
    ${python.pythonOnBuildForHost.interpreter} -m bash_kernel.install --prefix $out
  '';

  # no tests
  doCheck = false;

  meta = with lib; {
    description = "Bash Kernel for Jupyter";
    homepage = "https://github.com/takluyver/bash_kernel";
    changelog = "https://github.com/takluyver/bash_kernel/releases/tag/${version}";
    license = licenses.bsd3;
    maintainers = with maintainers; [ zimbatm ];
  };
}