mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-24 22:53:42 +00:00
6421f070e3
libgpiod's Python bindings no longer worked after the upgrade to 2.0.1. The build system installs an egg, which doesn't work in nixpkgs. To fix this, I adopted the same approach I took in #204884. This patch builds the Python bindings as a separate package, using the normal nixpkgs Python infrastructure. Besides fixing the bindings, this has the added benefit of avoiding the need to build a redundant copy of libgpiod as part of the Python bindings package. Lastly, I cleaned up the libgpiod package a bit, removing an unused dependency on kmod and an unnecessary configure flag. I also added the full list of licenses that apply to the package.
26 lines
561 B
Nix
26 lines
561 B
Nix
{ lib
|
|
, buildPythonPackage
|
|
, libgpiod
|
|
}:
|
|
buildPythonPackage {
|
|
inherit (libgpiod) pname version src;
|
|
format = "setuptools";
|
|
|
|
buildInputs = [ libgpiod ];
|
|
|
|
preConfigure = ''
|
|
cd bindings/python
|
|
'';
|
|
|
|
# Requires libgpiod built with --enable-tests
|
|
doCheck = false;
|
|
pythonImportsCheck = [ "gpiod" ];
|
|
|
|
meta = with lib; {
|
|
description = "Python bindings for libgpiod";
|
|
homepage = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about/";
|
|
license = licenses.lgpl21Plus;
|
|
maintainers = with maintainers; [ lopsided98 ];
|
|
};
|
|
}
|