summaryrefslogtreecommitdiffstats
path: root/pkgs/development/ocaml-modules/mlcuddidl/default.nix
blob: d503a106dcffbd24a16797752b01e517d4ab4c32 (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
{
  stdenv,
  lib,
  fetchFromGitLab,
  ocaml,
  findlib,
  camlidl,
  m4,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "ocaml${ocaml.version}-mlcuddidl";
  version = "3.0.8";

  __structuredAttrs = true;

  src = fetchFromGitLab {
    owner = "nberth";
    repo = "mlcuddidl";
    domain = "framagit.org";
    tag = finalAttrs.version;
    hash = "sha256-2tyZ1O8XARsJwU/+R7nM18hIPMYPk5JgbqgIzM9Xzfg=";
  };

  postPatch = ''
    substituteInPlace Makefile \
      --replace-fail '-ccopt "' '-ccopt="'
    substituteInPlace ocamlpack \
      --replace-fail '/bin/rm' 'rm'
  '';

  postConfigure = ''
    mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/stublibs
  '';

  strictDeps = true;

  nativeBuildInputs = [
    ocaml
    findlib
    camlidl
    m4
  ];

  buildInputs = [
    camlidl # otherwise, ocamlfind: Package `camlidl' not found
  ];

  env.NIX_CFLAGS_COMPILE = "-Wno-error=int-conversion";

  meta = {
    description = "C library offering an interface to the CUDD BDD library for OCaml";
    homepage = "https://pop-art.inrialpes.fr/people/bjeannet/mlxxxidl-forge/mlcuddidl/index.html";
    license = with lib.licenses; [
      bsd3 # cudd
      lgpl21Only # mlcuddidl
    ];
    maintainers = with lib.maintainers; [ luc65r ];
    broken = lib.versionAtLeast ocaml.version "5.0";
  };
})