Skip to content

Commit

Permalink
ocamlPackages.nbd: init at 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
lukts30 authored and vbgl committed Oct 8, 2024
1 parent 0a3cdcf commit f6f24b0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
33 changes: 27 additions & 6 deletions pkgs/by-name/li/libnbd/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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
Expand All @@ -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}"
];
Expand Down Expand Up @@ -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 changes: 5 additions & 0 deletions pkgs/top-level/ocaml-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down

0 comments on commit f6f24b0

Please sign in to comment.