Skip to content

Commit

Permalink
ocamlPackages.llvm: 8 -> 10, fix bytecode linking
Browse files Browse the repository at this point in the history
Fixes #119532
  • Loading branch information
symphorien authored and vbgl committed Aug 5, 2021
1 parent 06552b7 commit 308c004
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions pkgs/development/ocaml-modules/llvm/default.nix
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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"
Expand All @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/ocaml-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down

0 comments on commit 308c004

Please sign in to comment.