nixpkgs/pkgs/by-name/us/usbutils/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.1 KiB
Nix
Raw Normal View History

2021-08-17 23:28:01 +01:00
{ lib, stdenv, fetchurl, substituteAll, autoreconfHook, pkg-config, libusb1, hwdata, python3 }:
stdenv.mkDerivation rec {
2021-08-17 23:28:01 +01:00
pname = "usbutils";
version = "017";
2012-09-29 04:09:34 +01:00
src = fetchurl {
2021-08-17 23:28:01 +01:00
url = "mirror://kernel/linux/utils/usb/usbutils/usbutils-${version}.tar.xz";
hash = "sha256-pqJf/c+RA+ONekRzKsoXBz9OYCuS5K5VYlIxqCcC4Fs=";
};
patches = [
(substituteAll {
src = ./fix-paths.patch;
inherit hwdata;
})
];
2012-09-29 04:09:34 +01:00
nativeBuildInputs = [ autoreconfHook pkg-config ];
buildInputs = [ libusb1 python3 ];
outputs = [ "out" "man" "python" ];
2024-07-24 14:20:05 +01:00
postBuild = ''
$CC $NIX_CFLAGS -o usbreset usbreset.c
'';
postInstall = ''
moveToOutput "bin/lsusb.py" "$python"
2024-07-24 14:20:05 +01:00
install -Dm555 usbreset -t $out/bin
'';
2024-07-24 14:20:27 +01:00
meta = {
homepage = "http://www.linux-usb.org/";
description = "Tools for working with USB devices, such as lsusb";
2024-07-24 14:20:27 +01:00
maintainers = with lib.maintainers; [ cafkafk ];
license = with lib.licenses; [
gpl2Only # manpages, usbreset
gpl2Plus # most of the code
];
platforms = lib.platforms.linux;
mainProgram = "lsusb";
};
}