Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 53 lines 1.0 kB view raw
1{ 2 lib, 3 stdenv, 4 kernel, 5 udev, 6 autoconf, 7 automake, 8 libtool, 9 hwdata, 10 kernelOlder, 11}: 12 13stdenv.mkDerivation { 14 name = "usbip-${kernel.name}"; 15 16 src = kernel.src; 17 18 patches = 19 lib.optionals (kernelOlder "5.4") [ 20 # fixes build with gcc8 21 ./fix-snprintf-truncation.patch 22 # fixes build with gcc9 23 ./fix-strncpy-truncation.patch 24 ] 25 ++ kernel.patches; 26 27 nativeBuildInputs = [ 28 autoconf 29 automake 30 libtool 31 ]; 32 buildInputs = [ udev ]; 33 34 env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=address-of-packed-member" ]; 35 36 preConfigure = '' 37 cd tools/usb/usbip 38 ./autogen.sh 39 ''; 40 41 configureFlags = [ "--with-usbids-dir=${hwdata}/share/hwdata/" ]; 42 43 meta = with lib; { 44 homepage = "https://github.com/torvalds/linux/tree/master/tools/usb/usbip"; 45 description = "Allows to pass USB device from server to client over the network"; 46 license = with licenses; [ 47 gpl2Only 48 gpl2Plus 49 ]; 50 platforms = platforms.linux; 51 broken = kernelOlder "4.10"; 52 }; 53}