From 89d3a605e31b5e4efbe1b28b08206da4e75fd689 Mon Sep 17 00:00:00 2001 From: Kai Wohlfahrt Date: Wed, 29 Apr 2020 23:10:03 +0100 Subject: [PATCH] gpio-tools: init in kernel 5.4 Linux provides some tools to interact with the gpiochip interface (which replaces the deprecated sysfs GPIO interface). Expose these as a package. The tool has not changed much recently, so there is no need to package a version for each kernel. --- pkgs/os-specific/linux/kernel/gpio-utils.nix | 24 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 25 insertions(+) create mode 100644 pkgs/os-specific/linux/kernel/gpio-utils.nix diff --git a/pkgs/os-specific/linux/kernel/gpio-utils.nix b/pkgs/os-specific/linux/kernel/gpio-utils.nix new file mode 100644 index 000000000000..447704eedc8d --- /dev/null +++ b/pkgs/os-specific/linux/kernel/gpio-utils.nix @@ -0,0 +1,24 @@ +{ lib, stdenv, linux }: + +with lib; + +assert versionAtLeast linux.version "4.6"; + +stdenv.mkDerivation { + name = "gpio-utils-${linux.version}"; + + inherit (linux) src makeFlags; + + preConfigure = '' + cd tools/gpio + ''; + + separateDebugInfo = true; + installFlags = [ "install" "DESTDIR=$(out)" "bindir=/bin" ]; + + meta = { + description = "Linux tools to inspect the gpiochip interface"; + maintainers = with stdenv.lib.maintainers; [ kwohlfahrt ]; + platforms = stdenv.lib.platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e03841d1aa79..d516a1ceee50 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26468,4 +26468,5 @@ in vpsfree-client = callPackage ../tools/virtualization/vpsfree-client {}; + gpio-utils = callPackage ../os-specific/linux/kernel/gpio-utils.nix { }; }