summaryrefslogtreecommitdiffstats
path: root/pkgs/development/ocaml-modules/lem/default.nix
blob: dd711fb3d258bd02a141853c7f32d037af13ca7d (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
{
  stdenv,
  fetchFromGitHub,
  lib,
  makeWrapper,
  ocamlbuild,
  findlib,
  ocaml,
  num,
  zarith,
}:

stdenv.mkDerivation rec {
  pname = "ocaml${ocaml.version}-lem";
  version = "2025-03-13";

  src = fetchFromGitHub {
    owner = "rems-project";
    repo = "lem";
    rev = version;
    hash = "sha256-ZV2OiFonMlNzqtsumMQ8jzY9/ATaZxiNHZ7JzOfGluY=";
  };

  nativeBuildInputs = [
    makeWrapper
    ocamlbuild
    findlib
    ocaml
  ];
  propagatedBuildInputs = [
    zarith
    num
  ];

  installFlags = [ "INSTALL_DIR=$(out)" ];

  createFindlibDestdir = true;

  postInstall = ''
    wrapProgram $out/bin/lem --set LEMLIB $out/share/lem/library
  '';

  meta = {
    homepage = "https://github.com/rems-project/lem";
    description = "Tool for lightweight executable mathematics";
    mainProgram = "lem";
    maintainers = [ ];
    license = with lib.licenses; [
      bsd3
      gpl2
    ];
    platforms = ocaml.meta.platforms;
    broken = !(lib.versionAtLeast ocaml.version "4.07");
  };
}