mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-25 20:34:52 +03:00
ocamlPackages.llvm: propagate needed libs, fix missing build parameter
The opam patch makes ocaml link dependent executables with -L${LLVM_OCAML_EXTERNAL_LLVM_LIBDIR}. This variable was previously undefined and as a result the linker would previously be called with just -L which makes it ignore the next argument. This would lead strange linking errors, like missing caml_apply2. Despite defining this variable correctly, propagating llvm is still necessary for linking to complete. In case ocaml-llvm is a transitive dependency only, propagatedBuildInputs is not enough. To avoid having to guess which version of llvm was used, we provide the right one in passthrough.
This commit is contained in:
parent
0277cc1f1c
commit
55ac8ffa43
@ -8,7 +8,8 @@ stdenv.mkDerivation {
|
||||
|
||||
inherit (llvm) src;
|
||||
|
||||
buildInputs = [ python cmake llvm ocaml findlib ctypes ];
|
||||
buildInputs = [ python cmake ocaml findlib ctypes ];
|
||||
propagatedBuildInputs = [ llvm ];
|
||||
|
||||
patches = [ (fetchpatch {
|
||||
url = https://raw.githubusercontent.com/ocaml/opam-repository/2bdc193f5a9305ea93bf0f0dfc1fbc327c8b9306/packages/llvm/llvm.7.0.0/files/fix-shared.patch;
|
||||
@ -18,6 +19,7 @@ stdenv.mkDerivation {
|
||||
cmakeFlags = [
|
||||
"-DLLVM_OCAML_OUT_OF_TREE=TRUE"
|
||||
"-DLLVM_OCAML_INSTALL_PATH=${placeholder "out"}/ocaml"
|
||||
"-DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR=${stdenv.lib.getLib llvm}/lib"
|
||||
];
|
||||
|
||||
buildFlags = "ocaml_all";
|
||||
@ -30,6 +32,10 @@ stdenv.mkDerivation {
|
||||
mv $OCAMLFIND_DESTDIR/llvm/META{.llvm,}
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
inherit llvm;
|
||||
};
|
||||
|
||||
meta = {
|
||||
inherit (llvm.meta) license homepage;
|
||||
platforms = ocaml.meta.platforms or [];
|
||||
|
Loading…
Reference in New Issue
Block a user