libguestfs: fix build with OCaml 4.12

This commit is contained in:
Vincent Laporte 2021-04-20 05:33:20 +02:00 committed by Vincent Laporte
parent 61a31ad3d6
commit 731288ed01
2 changed files with 12 additions and 1 deletions

View File

@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
'';
configureFlags = [ "--disable-appliance" "--disable-daemon" "--with-distro=NixOS" ]
++ lib.optionals (!javaSupport) [ "--disable-java" "--without-java" ];
patches = [ ./libguestfs-syms.patch ];
patches = [ ./libguestfs-syms.patch ./ocaml-4.12.patch ];
NIX_CFLAGS_COMPILE="-I${libxml2.dev}/include/libxml2/";
installFlags = [ "REALLY_INSTALL=yes" ];
enableParallelBuilding = true;

View File

@ -0,0 +1,11 @@
--- a/common/mlstdutils/std_utils.ml 2019-02-07 15:45:56.516955598 +0100
+++ b/common/mlstdutils/std_utils.ml 2019-02-07 15:45:56.516955598 +0100
@@ -305,7 +305,7 @@
| x::xs, y::ys, z::zs -> (x, y, z) :: combine3 xs ys zs
| _ -> invalid_arg "combine3"
- let rec assoc_lbl ?(cmp = compare) ~default x = function
+ let rec assoc_lbl ?(cmp = Pervasives.compare) ~default x = function
| [] -> default
| (y, y') :: _ when cmp x y = 0 -> y'
| _ :: ys -> assoc_lbl ~cmp ~default x ys