From b8266fc5210f3ebaf513eda2281af98ab7264b1b Mon Sep 17 00:00:00 2001 From: evils <30512529+evils@users.noreply.github.com> Date: Mon, 5 Jul 2021 19:10:01 +0200 Subject: [PATCH] usb-reset: init at 0.3 (#129296) Co-authored-by: Sandro --- pkgs/applications/misc/usb-reset/default.nix | 41 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/applications/misc/usb-reset/default.nix diff --git a/pkgs/applications/misc/usb-reset/default.nix b/pkgs/applications/misc/usb-reset/default.nix new file mode 100644 index 00000000000..db05eda0d41 --- /dev/null +++ b/pkgs/applications/misc/usb-reset/default.nix @@ -0,0 +1,41 @@ +{ lib +, stdenv +, fetchFromGitHub +, libusb1 +}: + +stdenv.mkDerivation rec { + pname = "usb-reset"; + # not tagged, but changelog has this with the date of the e9a9d6c commit + # and no significant change occured between bumping the version in the Makefile and that + # and the changes since then (up to ff822d8) seem snap related + version = "0.3"; + + src = fetchFromGitHub { + owner = "ralight"; + repo = pname; + rev = "e9a9d6c4a533430e763e111a349efbba69e7a5bb"; + sha256 = "0k9qmhqi206gcnv3z4vwya82g5nm225972ylf67zjiikk8pn8m0s"; + }; + + buildInputs = [ libusb1 ]; + + postPatch = '' + substituteInPlace Makefile \ + --replace /usr/include/libusb-1.0 ${libusb1.dev}/include/libusb-1.0 + ''; + + makeFlags = [ + "DESTDIR=${placeholder "out"}" + "prefix=" + ]; + + meta = with lib; { + description = "Perform a bus reset on a USB device using its vendor and product ID"; + homepage = "https://github.com/ralight/usb-reset"; + changelog = "https://github.com/ralight/usb-reset/blob/master/ChangeLog.txt"; + license = licenses.mit; + maintainers = [ maintainers.evils ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 02a069d157f..a54f0c7925c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31568,6 +31568,8 @@ in urbit = callPackage ../misc/urbit { }; + usb-reset = callPackage ../applications/misc/usb-reset { }; + usql = callPackage ../applications/misc/usql { }; utf8cpp = callPackage ../development/libraries/utf8cpp { };