summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/llvm/default.nix
blob: 2f58c41ba355f282752c230d66f3c93e3801b487 (plain) (blame)
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
{ stdenv, python, llvm, ocaml, findlib, ctypes }:

let version = stdenv.lib.getVersion llvm; in

stdenv.mkDerivation {
  name = "ocaml-llvm-${version}";

  inherit (llvm) src;

  buildInputs = [ python llvm ocaml findlib ctypes ];

  configurePhase = ''
    mkdir build
    cd build
    ../configure CC=gcc CXX=g++ --disable-compiler-version-checks --prefix=$out \
    --disable-doxygen --disable-docs --with-ocaml-libdir=$OCAMLFIND_DESTDIR/llvm \
    --enable-static
    '';

  enableParallelBuilding = false;

  makeFlags = [ "-C bindings" "SYSTEM_LLVM_CONFIG=llvm-config" ];

  postInstall = ''
    mv $OCAMLFIND_DESTDIR/llvm/META{.llvm,}
  '';

  meta = {
    inherit (llvm.meta) license homepage;
    platforms = ocaml.meta.platforms or [];
    description = "OCaml bindings distributed with LLVM";
    maintainers = with stdenv.lib.maintainers; [ vbgl ];
  };

}