forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / development / ocaml-modules / ocaml-libvirt / default.nix
blobe27fbca0a4a082a8c5df2a8a2d8295b2f6ac118f
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";
8   version = "0.6.1.5";
10   src = fetchFromGitLab {
11     owner = "libvirt";
12     repo = "libvirt-ocaml";
13     rev = "v${version}";
14     sha256 = "0xpkdmknk74yqxgw8z2w8b7ss8hpx92xnab5fsqg2byyj55gzf2k";
15   };
17   propagatedBuildInputs = [ libvirt ];
19   nativeBuildInputs = [ autoreconfHook pkg-config findlib perl ocaml ];
21   buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
22     Foundation
23     AppKit
24   ];
26   strictDeps = true;
28   buildFlags = [ "all" "opt" "CPPFLAGS=-Wno-error" ];
29   installTargets = "install-opt";
30   preInstall = ''
31     # Fix 'dllmllibvirt.so' install failure into non-existent directory.
32     mkdir -p $OCAMLFIND_DESTDIR/stublibs
33   '';
35   meta = with lib; {
36     description = "OCaml bindings for libvirt";
37     homepage = "https://libvirt.org/ocaml/";
38     license = licenses.gpl2;
39     maintainers = [ ];
40     inherit (ocaml.meta) platforms;
41   };