summaryrefslogtreecommitdiffstats
path: root/pkgs/development/compilers/smlnj/llvm.nix
blob: 46e4b2c67a0b56b1bee528b09eab63198ba562cb (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
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  git,
  python3,
  ninja,
  src,
  version,
}:
let
  targets =
    lib.optional stdenv.targetPlatform.isx86_64 "X86"
    ++ lib.optional stdenv.targetPlatform.isAarch64 "AArch64";
in
stdenv.mkDerivation {
  pname = "smlnj-llvm";
  inherit version;
  src = "${src}/runtime/llvm21";
  strictDeps = true;
  __structuredAttrs = true;

  nativeBuildInputs = [
    cmake
    git
    python3
    ninja
  ];

  cmakeFlags = [
    "--preset=smlnj-llvm-release"
    (lib.cmakeFeature "LLVM_TARGETS_TO_BUILD" (lib.concatStringsSep ";" targets))
    (lib.cmakeBool "LLVM_ENABLE_DUMP" true)
  ];

  meta = {
    description = "Custom LLVM for Standard ML of New Jersey";
    homepage = "https://smlnj.org";
    license = lib.licenses.bsd3;
    platforms = [
      "x86_64-linux"
      "aarch64-linux"
      "aarch64-darwin"
    ];
    maintainers = with lib.maintainers; [
      skyesoss
    ];
  };
}