Commit f6f24b0b authored by lukts30's avatar lukts30 Committed by Vincent Laporte
Browse files

ocamlPackages.nbd: init at 1.20.2

parent 0a3cdcf4
Loading
Loading
Loading
Loading
+27 −6
Original line number Diff line number Diff line
@@ -6,13 +6,19 @@
  pkg-config,
  perl,
  buildPythonBindings ? false,
  buildOcamlBindings ? false,
  ocamlPackages,
  python3,
  libxml2,
  fuse,
  fuse3,
  gnutls,
  autoreconfHook,
}:

lib.throwIf (buildOcamlBindings && !lib.versionAtLeast ocamlPackages.ocaml.version "4.05")
  "OCaml binding are not available for OCaml < 4.05"

stdenv.mkDerivation rec {
  pname = "libnbd";
  version = "1.20.2";
@@ -22,11 +28,21 @@ stdenv.mkDerivation rec {
    hash = "sha256-7DgviwGPPLccTPvomyH+0CMknXmR2wENsxpXD97OP84=";
  };

  nativeBuildInputs = [
  nativeBuildInputs =
    [
      bash-completion
      pkg-config
      perl
  ] ++ lib.optionals buildPythonBindings [ python3 ];
      autoreconfHook
    ]
    ++ lib.optionals buildPythonBindings [ python3 ]
    ++ lib.optionals buildOcamlBindings (
      with ocamlPackages;
      [
        findlib
        ocaml
      ]
    );

  buildInputs = [
    fuse
@@ -35,6 +51,11 @@ stdenv.mkDerivation rec {
    libxml2
  ];

  postPatch = lib.optionalString buildOcamlBindings ''
    substituteInPlace ocaml/Makefile.am \
        --replace-fail '$(DESTDIR)$(OCAMLLIB)' '$(out)/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib'
  '';

  configureFlags = lib.optionals buildPythonBindings [
    "--with-python-installdir=${placeholder "out"}/${python3.sitePackages}"
  ];
@@ -75,4 +96,4 @@ stdenv.mkDerivation rec {
}
# TODO: package the 1.6-stable version too
# TODO: git version needs ocaml
# TODO: bindings for go and ocaml
# TODO: bindings for go
+5 −0
Original line number Diff line number Diff line
@@ -1229,6 +1229,11 @@ let

    ### N ###

    nbd = pkgs.libnbd.override {
      ocamlPackages = self;
      buildOcamlBindings = true;
    };

    netchannel = callPackage ../development/ocaml-modules/netchannel { };

    ninja_utils = callPackage ../development/ocaml-modules/ninja_utils { };