about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/mldoc/default.nix
blob: b55faf222cffe2eb5f4eca3988829bd8ba4b88ce (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
59
60
61
62
63
64
65
66
67
68
69
{ lib
, buildDunePackage
, fetchFromGitHub
, fetchpatch
, angstrom
, cmdliner
, core
, core_bench
, core_unix ? null
, js_of_ocaml
, js_of_ocaml-ppx
, ppx_deriving_yojson
, uri
, yojson
, lwt
, xmlm
}:
let
  angstrom' = angstrom.overrideAttrs (attrs: {
    patches = attrs.patches or [ ] ++ [
      # mldoc requires Angstrom to expose `unsafe_lookahead`
      (fetchpatch {
        url = "https://github.com/logseq/angstrom/commit/bbe36c99c13678937d4c983a427e02a733d6cc24.patch";
        sha256 = "sha256-RapY1QJ8U0HOqJ9TFDnCYB4tFLFuThESzdBZqjYuDUA=";
      })
    ];
  });
  uri' = uri.override { angstrom = angstrom'; };
in
buildDunePackage rec {
  pname = "mldoc";
  version = "1.5.8";

  minimalOCamlVersion = "4.10";

  duneVersion = "3";

  src = fetchFromGitHub {
    owner = "logseq";
    repo = "mldoc";
    rev = "v${version}";
    hash = "sha256-7uuNUFMSQEgakTKfpYixp43gnfpQSW++snBzgr0Ni0Y=";
  };

  buildInputs = [
    cmdliner
    core
    core_bench
    core_unix
    js_of_ocaml
    js_of_ocaml-ppx
    lwt
  ];

  propagatedBuildInputs = [
    angstrom'
    uri'
    yojson
    ppx_deriving_yojson
    xmlm
  ];

  meta = with lib; {
    homepage = "https://github.com/logseq/mldoc";
    description = "Another Emacs Org-mode and Markdown parser";
    license = licenses.agpl3Only;
    maintainers = with maintainers; [ marsam ];
  };
}