aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/xtmpl/default.nix
blob: 31c671538a58a15c015dcc3d194caa36e7f9269f (plain)
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
{ stdenv, fetchFromGitLab, ocaml, findlib, iri, ppx_tools, js_of_ocaml
, js_of_ocaml-ppx, re }:

if stdenv.lib.versionOlder ocaml.version "4.03"
|| stdenv.lib.versionAtLeast ocaml.version "4.11"
then throw "xtmpl not supported for ocaml ${ocaml.version}"
else
stdenv.mkDerivation rec {
  name = "ocaml${ocaml.version}-xtmpl-${version}";
  version = "0.17.0";
  src = fetchFromGitLab {
    domain = "framagit.org";
    owner = "zoggy";
    repo = "xtmpl";
    rev = version;
    sha256 = "1hq6y4rhz958q40145k4av8hx8jyvspg78xf741samd7vc3jd221";
  };

  patches = [ ./jsoo.patch ];

  postPatch = ''
    substituteInPlace Makefile --replace js_of_ocaml.ppx js_of_ocaml-ppx
  '';

  buildInputs = [ ocaml findlib ppx_tools js_of_ocaml js_of_ocaml-ppx ];
  propagatedBuildInputs = [ iri re ];

  createFindlibDestdir = true;

  dontStrip = true;

  meta = with stdenv.lib; {
    description = "XML templating library for OCaml";
    homepage = "https://www.good-eris.net/xtmpl/";
    license = licenses.lgpl3;
    platforms = ocaml.meta.platforms or [];
    maintainers = with maintainers; [ regnat ];
  };
}