3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/ocaml-modules/llvm/default.nix

41 lines
1.1 KiB
Nix
Raw Normal View History

2017-03-12 18:22:01 +00:00
{ stdenv, fetchpatch, python, cmake, llvm, ocaml, findlib, ctypes }:
2015-10-16 12:22:36 +01:00
let version = stdenv.lib.getVersion llvm; in
stdenv.mkDerivation {
2019-08-13 22:52:01 +01:00
pname = "ocaml-llvm";
inherit version;
2015-10-16 12:22:36 +01:00
inherit (llvm) src;
2017-03-12 18:22:01 +00:00
buildInputs = [ python cmake llvm ocaml findlib ctypes ];
2015-10-16 12:22:36 +01:00
2017-03-12 18:22:01 +00:00
patches = [ (fetchpatch {
2019-09-03 20:25:23 +01:00
url = https://raw.githubusercontent.com/ocaml/opam-repository/2bdc193f5a9305ea93bf0f0dfc1fbc327c8b9306/packages/llvm/llvm.7.0.0/files/fix-shared.patch;
sha256 = "1p98j3b1vrryfn1xa7i50m6mmm4dyw5ldafq6kyh9sfmdihz4zsx";
2017-03-12 18:22:01 +00:00
})];
2015-10-16 12:22:36 +01:00
2019-09-03 20:25:23 +01:00
cmakeFlags = [
"-DLLVM_OCAML_OUT_OF_TREE=TRUE"
"-DLLVM_OCAML_INSTALL_PATH=${placeholder "out"}/ocaml"
];
2015-10-16 12:22:36 +01:00
2017-03-12 18:22:01 +00:00
buildFlags = "ocaml_all";
installFlags = "-C bindings/ocaml";
2015-10-16 12:22:36 +01:00
postInstall = ''
2017-03-12 18:22:01 +00:00
mkdir -p $OCAMLFIND_DESTDIR/
mv $out/ocaml $OCAMLFIND_DESTDIR/llvm
2015-10-16 12:22:36 +01:00
mv $OCAMLFIND_DESTDIR/llvm/META{.llvm,}
'';
meta = {
inherit (llvm.meta) license homepage;
platforms = ocaml.meta.platforms or [];
2015-10-16 12:22:36 +01:00
description = "OCaml bindings distributed with LLVM";
maintainers = with stdenv.lib.maintainers; [ vbgl ];
};
}