ocamlPackages.nbd: init at 1.20.2

This commit is contained in:
lukts30 2024-10-02 15:36:09 +02:00 committed by Vincent Laporte
parent 0a3cdcf4e5
commit f6f24b0bbb
2 changed files with 32 additions and 6 deletions

View File

@ -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 = [
bash-completion
pkg-config
perl
] ++ lib.optionals buildPythonBindings [ python3 ];
nativeBuildInputs =
[
bash-completion
pkg-config
perl
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

View File

@ -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 { };