1{ stdenv
2, buildPythonPackage
3, fetchPypi
4, curtsies
5, greenlet
6, mock
7, pygments
8, requests
9, substituteAll
10, urwid
11, which }:
12
13buildPythonPackage rec {
14 pname = "bpython";
15 version = "0.19";
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "1764ikgj24jjq46s50apwkydqvy5a13adb2nbszk8kbci6df0v27";
20 };
21
22 patches = [ (substituteAll {
23 src = ./clipboard-make-which-substitutable.patch;
24 which = "${which}/bin/which";
25 })];
26
27 propagatedBuildInputs = [ curtsies greenlet pygments requests urwid ];
28
29 postInstall = ''
30 substituteInPlace "$out/share/applications/org.bpython-interpreter.bpython.desktop" \
31 --replace "Exec=/usr/bin/bpython" "Exec=$out/bin/bpython"
32 '';
33
34 checkInputs = [ mock ];
35
36 # tests fail: https://github.com/bpython/bpython/issues/712
37 doCheck = false;
38
39 meta = with stdenv.lib; {
40 description = "A fancy curses interface to the Python interactive interpreter";
41 homepage = "https://bpython-interpreter.org/";
42 license = licenses.mit;
43 maintainers = with maintainers; [ flokli ];
44 };
45}