lol
1{ lib, stdenv, fetchurl, autoreconfHook, autoconf-archive, pkg-config
2, enable-tools ? true }:
3
4stdenv.mkDerivation rec {
5 pname = "libgpiod";
6 version = "2.1";
7
8 src = fetchurl {
9 url = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-${version}.tar.gz";
10 hash = "sha256-/W7UssZ0/mzDtIGID2zeHup54pbpWhObhUAequpt4/w=";
11 };
12
13 nativeBuildInputs = [
14 autoconf-archive
15 pkg-config
16 autoreconfHook
17 ];
18
19 configureFlags = [
20 "--enable-tools=${if enable-tools then "yes" else "no"}"
21 "--enable-bindings-cxx"
22 ];
23
24 meta = with lib; {
25 description = "C library and tools for interacting with the linux GPIO character device";
26 longDescription = ''
27 Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
28 the character device instead. This library encapsulates the ioctl calls and
29 data structures behind a straightforward API.
30 '';
31 homepage = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about/";
32 license = with licenses; [
33 lgpl21Plus # libgpiod
34 lgpl3Plus # C++ bindings
35 ] ++ lib.optional enable-tools gpl2Plus;
36 maintainers = [ maintainers.expipiplus1 ];
37 platforms = platforms.linux;
38 };
39}