python3Packages.libnbd: init at 1.18.2 (#313358)

Co-authored-by: Anderson Torres <torres.anderson.85@protonmail.com>
This commit is contained in:
Physics Enthusiast 2024-06-03 03:41:08 +08:00 committed by GitHub
parent d0babee7c4
commit a8e75ef7d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 20 additions and 3 deletions

View File

@ -4,6 +4,7 @@
, bash-completion
, pkg-config
, perl
, buildPythonBindings ? false, python3
, libxml2
, fuse
, fuse3
@ -23,7 +24,8 @@ stdenv.mkDerivation rec {
bash-completion
pkg-config
perl
];
]
++ lib.optionals buildPythonBindings [ python3 ];
buildInputs = [
fuse
@ -32,8 +34,16 @@ stdenv.mkDerivation rec {
libxml2
];
configureFlags = lib.optionals buildPythonBindings [ "--with-python-installdir=${placeholder "out"}/${python3.sitePackages}" ];
installFlags = [ "bashcompdir=$(out)/share/bash-completion/completions" ];
postInstall = lib.optionalString buildPythonBindings ''
LIBNBD_PYTHON_METADATA='${placeholder "out"}/${python3.sitePackages}/nbd-${version}.dist-info/METADATA'
install -Dm644 -T ${./libnbd-metadata} $LIBNBD_PYTHON_METADATA
substituteAllInPlace $LIBNBD_PYTHON_METADATA
'';
meta = with lib; {
homepage = "https://gitlab.com/nbdkit/libnbd";
description = "Network Block Device client library in userspace";
@ -59,5 +69,4 @@ stdenv.mkDerivation rec {
}
# TODO: package the 1.6-stable version too
# TODO: git version needs ocaml
# TODO: bindings for go, ocaml and python
# TODO: bindings for go and ocaml

View File

@ -0,0 +1,3 @@
Metadata-Version: 2.1
Name: nbd
Version: @version@

View File

@ -6694,6 +6694,11 @@ self: super: with self; {
inherit (pkgs) libsodium;
};
libnbd = toPythonModule (pkgs.libnbd.override {
buildPythonBindings = true;
python3 = python;
});
libpcap = callPackage ../development/python-modules/libpcap {
pkgsLibpcap = pkgs.libpcap; # Needs the C library
};