2021-04-23 00:13:28 +01:00
|
|
|
{ lib, stdenv, kernel, udev, autoconf, automake, libtool, hwdata, kernelOlder }:
|
2017-11-22 22:54:50 +00:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2017-11-22 22:54:50 +00:00
|
|
|
name = "usbip-${kernel.name}";
|
|
|
|
|
|
|
|
src = kernel.src;
|
|
|
|
|
2020-10-29 08:15:31 +00:00
|
|
|
patches = lib.optionals (kernelOlder "5.4") [
|
2019-06-17 10:23:19 +01:00
|
|
|
# fixes build with gcc8
|
|
|
|
./fix-snprintf-truncation.patch
|
2019-11-03 00:22:41 +00:00
|
|
|
# fixes build with gcc9
|
|
|
|
./fix-strncpy-truncation.patch
|
2019-06-17 10:23:19 +01:00
|
|
|
];
|
|
|
|
|
2017-11-22 22:54:50 +00:00
|
|
|
nativeBuildInputs = [ autoconf automake libtool ];
|
|
|
|
buildInputs = [ udev ];
|
|
|
|
|
2019-11-03 00:22:41 +00:00
|
|
|
NIX_CFLAGS_COMPILE = [ "-Wno-error=address-of-packed-member" ];
|
|
|
|
|
2017-11-22 22:54:50 +00:00
|
|
|
preConfigure = ''
|
|
|
|
cd tools/usb/usbip
|
|
|
|
./autogen.sh
|
|
|
|
'';
|
|
|
|
|
2021-04-23 00:13:28 +01:00
|
|
|
configureFlags = [ "--with-usbids-dir=${hwdata}/share/hwdata/" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/torvalds/linux/tree/master/tools/usb/usbip";
|
2017-11-22 22:54:50 +00:00
|
|
|
description = "allows to pass USB device from server to client over the network";
|
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
2020-10-29 08:15:31 +00:00
|
|
|
broken = kernelOlder "4.10";
|
2017-11-22 22:54:50 +00:00
|
|
|
};
|
|
|
|
}
|