1 { lib, stdenv, fetchFromGitLab, libvirt, AppKit, Foundation, autoreconfHook, pkg-config, ocaml, findlib, perl }:
3 lib.throwIfNot (lib.versionAtLeast ocaml.version "4.02")
4 "libvirt is not available for OCaml ${ocaml.version}"
6 stdenv.mkDerivation rec {
7 pname = "ocaml-libvirt";
10 src = fetchFromGitLab {
12 repo = "libvirt-ocaml";
14 sha256 = "0xpkdmknk74yqxgw8z2w8b7ss8hpx92xnab5fsqg2byyj55gzf2k";
17 propagatedBuildInputs = [ libvirt ];
19 nativeBuildInputs = [ autoreconfHook pkg-config findlib perl ocaml ];
21 buildInputs = lib.optionals stdenv.isDarwin [
28 buildFlags = [ "all" "opt" "CPPFLAGS=-Wno-error" ];
29 installTargets = "install-opt";
31 # Fix 'dllmllibvirt.so' install failure into non-existent directory.
32 mkdir -p $OCAMLFIND_DESTDIR/stublibs
36 description = "OCaml bindings for libvirt";
37 homepage = "https://libvirt.org/ocaml/";
38 license = licenses.gpl2;
40 inherit (ocaml.meta) platforms;