summary refs log tree commit diff
path: root/pkgs/os-specific/linux/can-isotp/default.nix
blob: 7c20b74e54cb406ea24c43bcac51b683682e27df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ lib, stdenv, kernel, fetchFromGitHub }:

stdenv.mkDerivation {
  pname = "can-isotp";
  version = "20200910";

  hardeningDisable = [ "pic" ];

  src = fetchFromGitHub {
    owner = "hartkopp";
    repo = "can-isotp";
    rev = "21a3a59e2bfad246782896841e7af042382fcae7";
    sha256 = "1laax93czalclg7cy9iq1r7hfh9jigh7igj06y9lski75ap2vhfq";
  };

  makeFlags = kernel.makeFlags ++ [
    "KERNELDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
    "INSTALL_MOD_PATH=${placeholder "out"}"
  ];

  buildFlags = [ "modules" ];
  installTargets = [ "modules_install" ];

  nativeBuildInputs = kernel.moduleBuildDependencies;

  meta = with lib; {
    broken = kernel.kernelAtLeast "5.16";
    description = "Kernel module for ISO-TP (ISO 15765-2)";
    homepage = "https://github.com/hartkopp/can-isotp";
    license = licenses.gpl2;
    platforms = platforms.linux;
    maintainers = [ maintainers.evck ];
  };
}