nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, fetchpatch, python, cmake, llvm, ocaml, findlib, ctypes }:
2
3let version = stdenv.lib.getVersion llvm; in
4
5stdenv.mkDerivation {
6 name = "ocaml-llvm-${version}";
7
8 inherit (llvm) src;
9
10 buildInputs = [ python cmake llvm ocaml findlib ctypes ];
11
12 patches = [ (fetchpatch {
13 url = https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/llvm/llvm.3.9/files/cmake.patch;
14 sha256 = "1fcc6ylfiw1npdhx7mrsj7h0dx7cym7i9664kpr76zqazb52ikm9";
15 })];
16
17 cmakeFlags = [ "-DLLVM_OCAML_OUT_OF_TREE=TRUE" ];
18
19 buildFlags = "ocaml_all";
20
21 installFlags = "-C bindings/ocaml";
22
23 postInstall = ''
24 mv $out/lib/ocaml $out/ocaml
25 mkdir -p $OCAMLFIND_DESTDIR/
26 mv $out/ocaml $OCAMLFIND_DESTDIR/llvm
27 mv $OCAMLFIND_DESTDIR/llvm/META{.llvm,}
28 '';
29
30 meta = {
31 inherit (llvm.meta) license homepage;
32 platforms = ocaml.meta.platforms or [];
33 description = "OCaml bindings distributed with LLVM";
34 maintainers = with stdenv.lib.maintainers; [ vbgl ];
35 };
36
37}