diff options
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/xtmpl')
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/xtmpl/default.nix | 39 | ||||
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/xtmpl/jsoo.patch | 26 |
2 files changed, 65 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/xtmpl/default.nix b/infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/xtmpl/default.nix new file mode 100644 index 000000000000..31c671538a58 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/xtmpl/default.nix @@ -0,0 +1,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 ]; + }; +} diff --git a/infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/xtmpl/jsoo.patch b/infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/xtmpl/jsoo.patch new file mode 100644 index 000000000000..7546dbca924a --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/development/ocaml-modules/xtmpl/jsoo.patch @@ -0,0 +1,26 @@ +diff --git a/xtmpl_js.ml b/xtmpl_js.ml +index e0d3894..991d1b3 100644 +--- a/xtmpl_js.ml ++++ b/xtmpl_js.ml +@@ -25,6 +25,8 @@ + + (** *) + ++open Js_of_ocaml ++ + let log s = Firebug.console##log (Js.string s);; + + module X = Xtmpl_rewrite +diff --git a/xtmpl_js.mli b/xtmpl_js.mli +index d709896..5ed471c 100644 +--- a/xtmpl_js.mli ++++ b/xtmpl_js.mli +@@ -25,6 +25,8 @@ + + (** Convenient functions to use in JS code *) + ++open Js_of_ocaml ++ + (** Create a new tree of DOM nodes from a given XML tree. + Errors are logged to the firebug console. + @param doc Default is [Dom_html.document]. |