about summary refs log tree commit diff
path: root/pkgs/tools/misc/lookatme/default.nix
blob: b046e1569044b611ab14d9e79466ff92e81d4a5d (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
{ lib, python3, fetchFromGitHub }:

let
  py = python3.override {
    packageOverrides = self: super: {
      self = py;
      # use click 7
      click = self.callPackage ../../../development/python2-modules/click/default.nix { };
      # needs pyyaml 5
      pyyaml = super.pyyaml.overridePythonAttrs (oldAttrs: rec {
        name = "${oldAttrs.pname}-${version}";
        version = "5.4.1";
        src = fetchFromGitHub {
          owner = "yaml";
          repo = "pyyaml";
          rev = version;
          sha256 = "sha256-VUqnlOF/8zSOqh6JoEYOsfQ0P4g+eYqxyFTywgCS7gM=";
        };
        checkPhase = ''
          runHook preCheck
          PYTHONPATH="tests/lib3:$PYTHONPATH" ${self.python.interpreter} -m test_all
          runHook postCheck
        '';
      });
    };
  };
in
with py.pkgs;

buildPythonApplication rec {
  pname = "lookatme";
  version = "2.3.2";
  format = "setuptools";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-qIZMkgOm5jXmxTFLTqMBhpLBhfCL8xvUxxqpS6NjcVw=";
  };

  checkInputs = [ pytest ];

  propagatedBuildInputs = [
    click
    pyyaml
    pygments
    marshmallow
    mistune
    urwid
  ];

  meta = with lib; {
    description = "An interactive, terminal-based markdown presenter";
    homepage = "https://github.com/d0c-s4vage/lookatme";
    license = licenses.mit;
    maintainers = with maintainers; [ ameer ];
  };
}