diff options
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/usbutils')
-rw-r--r-- | nixpkgs/pkgs/os-specific/linux/usbutils/default.nix | 32 | ||||
-rw-r--r-- | nixpkgs/pkgs/os-specific/linux/usbutils/fix-paths.patch | 11 |
2 files changed, 43 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/usbutils/default.nix b/nixpkgs/pkgs/os-specific/linux/usbutils/default.nix new file mode 100644 index 000000000000..fba025b29d94 --- /dev/null +++ b/nixpkgs/pkgs/os-specific/linux/usbutils/default.nix @@ -0,0 +1,32 @@ +{ lib, stdenv, fetchurl, substituteAll, autoreconfHook, pkg-config, libusb1, hwdata , python3 }: + +stdenv.mkDerivation rec { + name = "usbutils-013"; + + src = fetchurl { + url = "mirror://kernel/linux/utils/usb/usbutils/${name}.tar.xz"; + sha256 = "0f0klk6d3hmbpf6p4dcwa1qjzblmkhbxs1wsw87aidvqri7lj8wy"; + }; + + patches = [ + (substituteAll { + src = ./fix-paths.patch; + inherit hwdata; + }) + ]; + + nativeBuildInputs = [ autoreconfHook pkg-config ]; + buildInputs = [ libusb1 python3 ]; + + outputs = [ "out" "man" "python" ]; + postInstall = '' + moveToOutput "bin/lsusb.py" "$python" + ''; + + meta = with lib; { + homepage = "http://www.linux-usb.org/"; + description = "Tools for working with USB devices, such as lsusb"; + license = licenses.gpl2Plus; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/os-specific/linux/usbutils/fix-paths.patch b/nixpkgs/pkgs/os-specific/linux/usbutils/fix-paths.patch new file mode 100644 index 000000000000..ef63a41e726c --- /dev/null +++ b/nixpkgs/pkgs/os-specific/linux/usbutils/fix-paths.patch @@ -0,0 +1,11 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -61,7 +61,7 @@ EXTRA_DIST = \ + LICENSES/GPL-3.0-only.txt + + lsusb.py: $(srcdir)/lsusb.py.in +- sed 's|VERSION|$(VERSION)|g;s|@usbids@|$(datadir)/usb.ids|g' $< >$@ ++ sed 's|VERSION|$(VERSION)|g;s|@usbids@|@hwdata@/share/hwdata/usb.ids|g' $< >$@ + chmod 755 $@ + + lsusb.8: $(srcdir)/lsusb.8.in |