summaryrefslogtreecommitdiff
path: root/pkgs/development/ocaml-modules/seq/default.nix
blob: 9a4a6db31ce813cd4ce96d9f4906ba5c1e86f740 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  stdenv,
  lib,
  fetchFromGitHub,
  ocaml,
  findlib,
  ocamlbuild,
}:

stdenv.mkDerivation (
  {
    version = "0.1";
    pname = "ocaml${ocaml.version}-seq";

    meta = {
      license = lib.licenses.lgpl21;
      maintainers = [ lib.maintainers.vbgl ];
      homepage = "https://github.com/c-cube/seq";
      inherit (ocaml.meta) platforms;
    };

  }
  // (
    if lib.versionOlder ocaml.version "4.07" then
      {

        src = fetchFromGitHub {
          owner = "c-cube";
          repo = "seq";
          rev = "0.1";
          sha256 = "1cjpsc7q76yfgq9iyvswxgic4kfq2vcqdlmxjdjgd4lx87zvcwrv";
        };

        nativeBuildInputs = [
          ocaml
          findlib
          ocamlbuild
        ];
        strictDeps = true;

        createFindlibDestdir = true;

        meta.description = "Compatibility package for OCaml’s standard iterator type starting from 4.07";

      }
    else
      {

        src = ./src-base;

        dontBuild = true;

        installPhase = ''
          mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/seq
          cp META $out/lib/ocaml/${ocaml.version}/site-lib/seq
        '';

        meta.description = "Dummy backward-compatibility package for iterators";

      }
  )
)