3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/ocaml-modules/ocaml-libvirt/default.nix
Sergei Trofimovich 1526d916ab ocamlPackages.ocaml_libvirt: fix build by bringing pre/post phases in
9a778368f2 "move destdir creation to installPhase" moved directory
creation to preInstallHooks and exposed a bug in ocaml_libvirt:

```
ocaml-libvirt> ocamlfind install  -ldconf ignore libvirt \
ocaml-libvirt>   ../META *.so *.a *.cma *.cmx *.cmxa *.cmi *.mli
ocaml-libvirt> ocamlfind: Bad configuration: Cannot mkdir
  /nix/store/...aml-libvirt-0.6.1.5/lib/ocaml/4.12.0/site-lib/libvirt
    because a path component does not exist or is not a directory
ocaml-libvirt> make[1]: *** [Makefile:134: install-opt] Error 2
```

The change restore pre/post phases by overriding build targets instead
of overriding full phases.
2022-01-26 12:06:32 +01:00

35 lines
945 B
Nix

{ lib, stdenv, fetchFromGitLab, libvirt, autoreconfHook, pkg-config, ocaml, findlib, perl }:
stdenv.mkDerivation rec {
pname = "ocaml-libvirt";
version = "0.6.1.5";
src = fetchFromGitLab {
owner = "libvirt";
repo = "libvirt-ocaml";
rev = "v${version}";
sha256 = "0xpkdmknk74yqxgw8z2w8b7ss8hpx92xnab5fsqg2byyj55gzf2k";
};
propagatedBuildInputs = [ libvirt ];
nativeBuildInputs = [ autoreconfHook pkg-config findlib perl ];
buildInputs = [ ocaml ];
buildFlags = [ "all" "opt" "CPPFLAGS=-Wno-error" ];
installTargets = "install-opt";
preInstall = ''
# Fix 'dllmllibvirt.so' install failure into non-existent directory.
mkdir -p $OCAMLFIND_DESTDIR/stublibs
'';
meta = with lib; {
description = "OCaml bindings for libvirt";
homepage = "https://libvirt.org/ocaml/";
license = licenses.gpl2;
maintainers = [ maintainers.volth ];
platforms = ocaml.meta.platforms or [];
};
}