1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-19 03:47:13 -04:00
nixpkgs/pkgs/development/libraries/libgpiod/default.nix
Ben Wolsieffer 6421f070e3 libgpiod: fix Python bindings
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.
2023-08-05 22:37:54 -04:00

40 lines
1.2 KiB
Nix

{ lib, stdenv, fetchurl, autoreconfHook, autoconf-archive, pkg-config
, enable-tools ? true }:
stdenv.mkDerivation rec {
pname = "libgpiod";
version = "2.0.1";
src = fetchurl {
url = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-${version}.tar.gz";
hash = "sha256-tu2lU1YWCo5zkG49SOlZ74EpZ4fXZJdbEPJX6WYGaOk=";
};
nativeBuildInputs = [
autoconf-archive
pkg-config
autoreconfHook
];
configureFlags = [
"--enable-tools=${if enable-tools then "yes" else "no"}"
"--enable-bindings-cxx"
];
meta = with lib; {
description = "C library and tools for interacting with the linux GPIO character device";
longDescription = ''
Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
the character device instead. This library encapsulates the ioctl calls and
data structures behind a straightforward API.
'';
homepage = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about/";
license = with licenses; [
lgpl21Plus # libgpiod
lgpl3Plus # C++ bindings
] ++ lib.optional enable-tools gpl2Plus;
maintainers = [ maintainers.expipiplus1 ];
platforms = platforms.linux;
};
}