1{stdenv, fetchurl, pkgconfig, libusb1}:
2
3stdenv.mkDerivation {
4 name = "libusb-compat-0.1.5";
5
6 outputs = [ "out" "dev" ]; # get rid of propagating systemd closure
7 outputBin = "dev";
8
9 nativeBuildInputs = [ pkgconfig ];
10 propagatedBuildInputs = [ libusb1 ];
11
12 src = fetchurl {
13 url = mirror://sourceforge/libusb/libusb-compat-0.1.5.tar.bz2;
14 sha256 = "0nn5icrfm9lkhzw1xjvaks9bq3w6mjg86ggv3fn7kgi4nfvg8kj0";
15 };
16
17 patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch;
18
19 meta = with stdenv.lib; {
20 homepage = "https://libusb.info/";
21 repositories.git = "https://github.com/libusb/libusb-compat-0.1";
22 description = "cross-platform user-mode USB device library";
23 longDescription = ''
24 libusb is a cross-platform user-mode library that provides access to USB devices.
25 The current API is of 1.0 version (libusb-1.0 API), this library is a wrapper exposing the legacy API.
26 '';
27 license = licenses.lgpl2Plus;
28 platforms = platforms.unix;
29 };
30}