{stdenv, fetchurl}:

stdenv.mkDerivation {
  name = "libusb-0.1.12";

  # On non-linux, we get warnings compiling, and we don't want the
  # build to break.
  patchPhase = ''
    sed -i s/-Werror// Makefile.in
  '';

  src = fetchurl {
    url = mirror://sourceforge/libusb/libusb-0.1.12.tar.gz;
    sha256 = "0i4bacxkyr7xyqxbmb00ypkrv4swkgm0mghbzjsnw6blvvczgxip";
  };
}

{stdenv, fetchurl, pkgconfig, libusb1}:

stdenv.mkDerivation {
  name = "libusb-compat-0.1.5";

  buildInputs = [ pkgconfig libusb1 ];

  src = fetchurl {
    url = mirror://sourceforge/libusb/libusb-compat-0.1.5.tar.bz2;
    sha256 = "0nn5icrfm9lkhzw1xjvaks9bq3w6mjg86ggv3fn7kgi4nfvg8kj0";
  };
}

Use libusb-compat instead of unmaintained libusb
Use libusb-compat instead of unmaintained libusb

Close #4945.
