15 stdenv.mkDerivation rec {
20 url = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-${version}.tar.gz";
21 hash = "sha256-gp1KwmjfB4U2CdZ8/H9HbpqnNssqaKYwvpno+tGXvgo=";
26 # https://github.com/brgl/libgpiod/pull/45
27 ./0001-Drop-AC_FUNC_MALLOC-and-_REALLOC-and-check-for-them-.patch
32 ++ lib.optionals enablePython [
43 "--enable-tools=${if enable-tools then "yes" else "no"}"
44 "--enable-bindings-cxx"
45 "--prefix=${placeholder "out"}"
46 ] ++ lib.optional enablePython "--enable-bindings-python";
49 description = "C library and tools for interacting with the linux GPIO character device";
51 Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
52 the character device instead. This library encapsulates the ioctl calls and
53 data structures behind a straightforward API.
55 homepage = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about/";
56 license = licenses.lgpl2;
58 platforms = platforms.linux;