@@ -0,0 +1,36 @@
1+{ stdenv, fetchurl, ocaml, findlib, camlp4, ounit, gettext, fileutils, camomile }:
2+
3+stdenv.mkDerivation rec {
4+ name = "ocaml-gettext-${version}";
5+ version = "0.3.5";
6+
7+ src = fetchurl {
8+ url = "https://forge.ocamlcore.org/frs/download.php/1433/ocaml-gettext-${version}.tar.gz";
9+ sha256 = "0s625h7y9xxqvzk4bnw45k4wvl4fn8gblv56bp47il0lgsx8956i";
10+ };
11+
12+ propagatedBuildInputs = [ gettext fileutils camomile ];
13+
14+ buildInputs = [ ocaml findlib camlp4 ounit ];
15+
16+ postPatch = stdenv.lib.optionalString (camlp4 != null) ''
17+ substituteInPlace test/test.ml --replace "+camlp4" "${camlp4}/lib/ocaml/${ocaml.version}/site-lib/camlp4"
18+ substituteInPlace ocaml-gettext/OCamlGettext.ml --replace "+camlp4" "${camlp4}/lib/ocaml/${ocaml.version}/site-lib/camlp4"
19+ substituteInPlace ocaml-gettext/Makefile --replace "+camlp4" "${camlp4}/lib/ocaml/${ocaml.version}/site-lib/camlp4"
20+ substituteInPlace ocaml-gettext/Makefile --replace "unix.cma" ""
21+ substituteInPlace libgettext-ocaml/Makefile --replace "+camlp4" "${camlp4}/lib/ocaml/${ocaml.version}/site-lib/camlp4"
22+ substituteInPlace libgettext-ocaml/Makefile --replace "\$(shell ocamlc -where)" "${camlp4}/lib/ocaml/${ocaml.version}/site-lib"
23+ '';
24+
25+ configureFlags = [ "--disable-doc" ];
26+
27+ createFindlibDestdir = true;
28+
29+ meta = with stdenv.lib; {
30+ description = "OCaml Bindings to gettext";
31+ homepage = https://forge.ocamlcore.org/projects/ocaml-gettext;
32+ license = licenses.gpl2;
33+ maintainers = [ maintainers.volth ];
34+ platforms = ocaml.meta.platforms or [];
35+ };
36+}