1 { lib, stdenv, fetchurl, autoreconfHook, autoconf-archive, pkg-config, kmod
3 , enablePython ? false, python3, ncurses }:
5 stdenv.mkDerivation rec {
10 url = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-${version}.tar.gz";
11 sha256 = "sha256-gp1KwmjfB4U2CdZ8/H9HbpqnNssqaKYwvpno+tGXvgo=";
16 # https://github.com/brgl/libgpiod/pull/45
17 ./0001-Drop-AC_FUNC_MALLOC-and-_REALLOC-and-check-for-them-.patch
20 buildInputs = [ kmod ] ++ lib.optionals enablePython [ python3 ncurses ];
28 "--enable-tools=${if enable-tools then "yes" else "no"}"
29 "--enable-bindings-cxx"
30 "--prefix=${placeholder "out"}"
31 ] ++ lib.optional enablePython "--enable-bindings-python";
34 description = "C library and tools for interacting with the linux GPIO character device";
36 Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
37 the character device instead. This library encapsulates the ioctl calls and
38 data structures behind a straightforward API.
40 homepage = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about/";
41 license = licenses.lgpl2;
42 maintainers = [ maintainers.expipiplus1 ];
43 platforms = platforms.linux;