2022-06-04 06:47:40 +00:00
|
|
|
{ lib, stdenv, fetchpatch, kernel, udev, autoconf, automake, libtool, hwdata, kernelOlder }:
|
2017-11-22 22:54:50 +00:00
|
|
|
|
2019-08-13 21:52:01 +00: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 09:23:19 +00: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
|
2022-06-04 06:47:40 +00:00
|
|
|
] ++ kernel.patches;
|
2019-06-17 09:23:19 +00: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-22 23:13:28 +00:00
|
|
|
configureFlags = [ "--with-usbids-dir=${hwdata}/share/hwdata/" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00: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";
|
2021-04-25 20:43:21 +00:00
|
|
|
license = with licenses; [ gpl2Only gpl2Plus ];
|
2017-11-22 22:54:50 +00:00
|
|
|
platforms = platforms.linux;
|
2020-10-29 08:15:31 +00:00
|
|
|
broken = kernelOlder "4.10";
|
2017-11-22 22:54:50 +00:00
|
|
|
};
|
|
|
|
}
|