2023-01-20 10:41:00 +00:00
|
|
|
{ lib, stdenv, fetchFromGitLab, libvirt, AppKit, Foundation, autoreconfHook, pkg-config, ocaml, findlib, perl }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
lib.throwIfNot (lib.versionAtLeast ocaml.version "4.02")
|
|
|
|
"libvirt is not available for OCaml ${ocaml.version}"
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ocaml-libvirt";
|
2020-11-12 09:05:59 +00:00
|
|
|
version = "0.6.1.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-12 09:05:59 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "libvirt";
|
|
|
|
repo = "libvirt-ocaml";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0xpkdmknk74yqxgw8z2w8b7ss8hpx92xnab5fsqg2byyj55gzf2k";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ libvirt ];
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config findlib perl ocaml ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
Foundation
|
|
|
|
AppKit
|
|
|
|
];
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-27 00:19:43 +00:00
|
|
|
buildFlags = [ "all" "opt" "CPPFLAGS=-Wno-error" ];
|
|
|
|
installTargets = "install-opt";
|
|
|
|
preInstall = ''
|
|
|
|
# Fix 'dllmllibvirt.so' install failure into non-existent directory.
|
|
|
|
mkdir -p $OCAMLFIND_DESTDIR/stublibs
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "OCaml bindings for libvirt";
|
|
|
|
homepage = "https://libvirt.org/ocaml/";
|
|
|
|
license = licenses.gpl2;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = [ ];
|
2022-05-18 14:49:53 +00:00
|
|
|
inherit (ocaml.meta) platforms;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|