2024-06-05 15:53:02 +00:00
|
|
|
{ lib, stdenv, kernel, udev, autoconf, automake, libtool, hwdata, kernelOlder }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "usbip-${kernel.name}";
|
|
|
|
|
|
|
|
src = kernel.src;
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
patches = lib.optionals (kernelOlder "5.4") [
|
2020-04-24 23:36:52 +00:00
|
|
|
# fixes build with gcc8
|
|
|
|
./fix-snprintf-truncation.patch
|
|
|
|
# fixes build with gcc9
|
|
|
|
./fix-strncpy-truncation.patch
|
2022-06-16 17:23:12 +00:00
|
|
|
] ++ kernel.patches;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ autoconf automake libtool ];
|
|
|
|
buildInputs = [ udev ];
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=address-of-packed-member" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd tools/usb/usbip
|
|
|
|
./autogen.sh
|
|
|
|
'';
|
|
|
|
|
2021-04-25 03:57:28 +00:00
|
|
|
configureFlags = [ "--with-usbids-dir=${hwdata}/share/hwdata/" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/torvalds/linux/tree/master/tools/usb/usbip";
|
|
|
|
description = "allows to pass USB device from server to client over the network";
|
2021-04-26 19:14:03 +00:00
|
|
|
license = with licenses; [ gpl2Only gpl2Plus ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
2020-11-03 02:18:15 +00:00
|
|
|
broken = kernelOlder "4.10";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|