nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitLab, ocaml, findlib, iri, ppx_tools, js_of_ocaml
2, js_of_ocaml-ppx, re }:
3
4if lib.versionOlder ocaml.version "4.03"
5|| lib.versionAtLeast ocaml.version "4.11"
6then throw "xtmpl not supported for ocaml ${ocaml.version}"
7else
8stdenv.mkDerivation rec {
9 name = "ocaml${ocaml.version}-xtmpl-${version}";
10 version = "0.17.0";
11 src = fetchFromGitLab {
12 domain = "framagit.org";
13 owner = "zoggy";
14 repo = "xtmpl";
15 rev = version;
16 sha256 = "1hq6y4rhz958q40145k4av8hx8jyvspg78xf741samd7vc3jd221";
17 };
18
19 patches = [ ./jsoo.patch ];
20
21 postPatch = ''
22 substituteInPlace Makefile --replace js_of_ocaml.ppx js_of_ocaml-ppx
23 '';
24
25 buildInputs = [ ocaml findlib ppx_tools js_of_ocaml js_of_ocaml-ppx ];
26 propagatedBuildInputs = [ iri re ];
27
28 createFindlibDestdir = true;
29
30 dontStrip = true;
31
32 meta = with lib; {
33 description = "XML templating library for OCaml";
34 homepage = "https://www.good-eris.net/xtmpl/";
35 license = licenses.lgpl3;
36 platforms = ocaml.meta.platforms or [];
37 maintainers = with maintainers; [ regnat ];
38 };
39}