nixpkgs/pkgs/development/ocaml-modules/llvm/default.nix

38 lines
996 B
Nix
Raw Normal View History

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;
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;
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 ];
};
}