2017-03-12 18:22:01 +00:00
|
|
|
{ stdenv, fetchpatch, python, cmake, llvm, ocaml, findlib, ctypes }:
|
2015-10-16 11:22:36 +00:00
|
|
|
|
|
|
|
let version = stdenv.lib.getVersion llvm; in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "ocaml-llvm-${version}";
|
|
|
|
|
|
|
|
inherit (llvm) src;
|
|
|
|
|
2017-03-12 18:22:01 +00:00
|
|
|
buildInputs = [ python cmake llvm ocaml findlib ctypes ];
|
2015-10-16 11:22:36 +00:00
|
|
|
|
2017-03-12 18:22:01 +00:00
|
|
|
patches = [ (fetchpatch {
|
|
|
|
url = https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/llvm/llvm.3.9/files/cmake.patch;
|
2017-04-28 16:15:50 +00:00
|
|
|
sha256 = "1fcc6ylfiw1npdhx7mrsj7h0dx7cym7i9664kpr76zqazb52ikm9";
|
2017-03-12 18:22:01 +00:00
|
|
|
})];
|
2015-10-16 11:22:36 +00:00
|
|
|
|
2017-03-12 18:22:01 +00:00
|
|
|
cmakeFlags = [ "-DLLVM_OCAML_OUT_OF_TREE=TRUE" ];
|
2015-10-16 11:22:36 +00:00
|
|
|
|
2017-03-12 18:22:01 +00:00
|
|
|
buildFlags = "ocaml_all";
|
|
|
|
|
|
|
|
installFlags = "-C bindings/ocaml";
|
2015-10-16 11:22:36 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2017-03-12 18:22:01 +00:00
|
|
|
mv $out/lib/ocaml $out/ocaml
|
|
|
|
mkdir -p $OCAMLFIND_DESTDIR/
|
|
|
|
mv $out/ocaml $OCAMLFIND_DESTDIR/llvm
|
2015-10-16 11:22:36 +00:00
|
|
|
mv $OCAMLFIND_DESTDIR/llvm/META{.llvm,}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
inherit (llvm.meta) license homepage;
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2015-10-16 11:22:36 +00:00
|
|
|
description = "OCaml bindings distributed with LLVM";
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ vbgl ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|