nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchurl,
4 fetchpatch,
5 applyPatches,
6 buildDunePackage,
7 ocaml,
8 cppo,
9 gettext,
10 fileutils,
11 ounit2,
12}:
13
14buildDunePackage (finalAttrs: {
15 pname = "gettext";
16 version = "0.5.0";
17
18 src = applyPatches {
19 src = fetchurl {
20 url = "https://github.com/gildor478/ocaml-gettext/releases/download/v${finalAttrs.version}/gettext-${finalAttrs.version}.tbz";
21 hash = "sha256-CN2d9Vsq8YOOIxK+S+lCtDddvBjCrtDKGSRIh1DjT10=";
22 };
23 patches = [
24 # Disable dune sites
25 # See https://github.com/gildor478/ocaml-gettext/pull/37
26 (fetchpatch {
27 url = "https://github.com/gildor478/ocaml-gettext/commit/5462396bee53cb13d8d6fde4c6d430412a17b64d.patch";
28 hash = "sha256-tOR+xgZTadvNeQpZnFTJEvZglK8P+ySvYnE3c1VWvKQ=";
29 })
30 ]
31 # Compatibility with OCaml ≥ 5.4
32 # See https://github.com/gildor478/ocaml-gettext/pull/41
33 ++ lib.optional (lib.versionAtLeast ocaml.version "5.4") (fetchpatch {
34 url = "https://github.com/gildor478/ocaml-gettext/commit/5d521981e39dcaeada6bbe7b15c5432d6de5d33c.patch";
35 hash = "sha256-82ajmpyXSd2RdVq/ND4lS8PIugRSkKe5oL8BL9CsLo4=";
36 });
37 };
38
39 nativeBuildInputs = [ cppo ];
40
41 propagatedBuildInputs = [
42 gettext
43 fileutils
44 ];
45
46 # Tests of version 0.5.0 fail
47 doCheck = false;
48
49 checkInputs = [ ounit2 ];
50
51 meta = {
52 description = "OCaml Bindings to gettext";
53 homepage = "https://github.com/gildor478/ocaml-gettext";
54 license = lib.licenses.lgpl21;
55 maintainers = [ ];
56 mainProgram = "ocaml-gettext";
57 };
58})