libbytesize: fix Python bindings

This commit is contained in:
Vladimir Panteleev 2023-12-24 13:33:39 +00:00
parent 3e51623839
commit 387bdb9c5e
No known key found for this signature in database
GPG Key ID: 5004F0FAD051576D
2 changed files with 12 additions and 2 deletions

View File

@ -11,7 +11,7 @@
mpfr, mpfr,
pcre2, pcre2,
pkg-config, pkg-config,
python3, python3Packages,
stdenv, stdenv,
}: }:
@ -41,7 +41,8 @@ stdenv.mkDerivation (finalAttrs: {
gtk-doc gtk-doc
libxslt libxslt
pkg-config pkg-config
python3 python3Packages.python
python3Packages.pythonImportsCheckHook
]; ];
buildInputs = [ buildInputs = [
@ -52,6 +53,13 @@ stdenv.mkDerivation (finalAttrs: {
strictDeps = true; strictDeps = true;
postInstall = ''
substituteInPlace $out/${python3Packages.python.sitePackages}/bytesize/bytesize.py \
--replace-fail 'CDLL("libbytesize.so.1")' "CDLL('$out/lib/libbytesize.so.1')"
'';
pythonImportsCheck = [ "bytesize" ];
meta = { meta = {
homepage = "https://github.com/storaged-project/libbytesize"; homepage = "https://github.com/storaged-project/libbytesize";
description = "Tiny library providing a C 'class' for working with arbitrary big sizes in bytes"; description = "Tiny library providing a C 'class' for working with arbitrary big sizes in bytes";

View File

@ -1923,6 +1923,8 @@ self: super: with self; {
bytecode = callPackage ../development/python-modules/bytecode { }; bytecode = callPackage ../development/python-modules/bytecode { };
bytesize = toPythonModule (pkgs.libbytesize.override { python3Packages = self; });
bytewax = callPackage ../development/python-modules/bytewax { }; bytewax = callPackage ../development/python-modules/bytewax { };
bz2file = callPackage ../development/python-modules/bz2file { }; bz2file = callPackage ../development/python-modules/bz2file { };