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