ocamlPackages.llvm: 8 -> 10, fix bytecode linking

Fixes #119532
This commit is contained in:
Guillaume Girol 2021-08-05 12:00:00 +00:00 committed by Vincent Laporte
parent 06552b7234
commit 308c004ace
2 changed files with 4 additions and 7 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchpatch, python, cmake, libllvm, ocaml, findlib, ctypes }:
{ stdenv, lib, python, cmake, libllvm, ocaml, findlib, ctypes }:
let version = lib.getVersion libllvm; in
@ -12,12 +12,8 @@ stdenv.mkDerivation {
buildInputs = [ python ocaml findlib ctypes ];
propagatedBuildInputs = [ libllvm ];
patches = [ (fetchpatch {
url = "https://raw.githubusercontent.com/ocaml/opam-repository/2bdc193f5a9305ea93bf0f0dfc1fbc327c8b9306/packages/llvm/llvm.7.0.0/files/fix-shared.patch";
sha256 = "1p98j3b1vrryfn1xa7i50m6mmm4dyw5ldafq6kyh9sfmdihz4zsx";
})];
cmakeFlags = [
"-DBUILD_SHARED_LIBS=YES" # fixes bytecode builds
"-DLLVM_OCAML_OUT_OF_TREE=TRUE"
"-DLLVM_OCAML_INSTALL_PATH=${placeholder "out"}/ocaml"
"-DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR=${lib.getLib libllvm}/lib"
@ -31,6 +27,7 @@ stdenv.mkDerivation {
mkdir -p $OCAMLFIND_DESTDIR/
mv $out/ocaml $OCAMLFIND_DESTDIR/llvm
mv $OCAMLFIND_DESTDIR/llvm/META{.llvm,}
mv $OCAMLFIND_DESTDIR/llvm/stublibs $OCAMLFIND_DESTDIR/stublibs
'';
passthru = {

View file

@ -610,7 +610,7 @@ let
linenoise = callPackage ../development/ocaml-modules/linenoise { };
llvm = callPackage ../development/ocaml-modules/llvm {
libllvm = pkgs.llvmPackages_8.libllvm;
libllvm = pkgs.llvmPackages_10.libllvm;
};
logs = callPackage ../development/ocaml-modules/logs { };