nixpkgs/pkgs/os-specific/linux/usbip/default.nix
Artturin f9fdf2d402 treewide: move NIX_CFLAGS_COMPILE to the env attrset
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper

this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists
in env cause a eval failure
2023-02-22 21:23:04 +02:00

34 lines
978 B
Nix

{ lib, stdenv, fetchpatch, kernel, udev, autoconf, automake, libtool, hwdata, kernelOlder }:
stdenv.mkDerivation {
name = "usbip-${kernel.name}";
src = kernel.src;
patches = lib.optionals (kernelOlder "5.4") [
# fixes build with gcc8
./fix-snprintf-truncation.patch
# fixes build with gcc9
./fix-strncpy-truncation.patch
] ++ kernel.patches;
nativeBuildInputs = [ autoconf automake libtool ];
buildInputs = [ udev ];
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=address-of-packed-member" ];
preConfigure = ''
cd tools/usb/usbip
./autogen.sh
'';
configureFlags = [ "--with-usbids-dir=${hwdata}/share/hwdata/" ];
meta = with lib; {
homepage = "https://github.com/torvalds/linux/tree/master/tools/usb/usbip";
description = "allows to pass USB device from server to client over the network";
license = with licenses; [ gpl2Only gpl2Plus ];
platforms = platforms.linux;
broken = kernelOlder "4.10";
};
}