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