summary refs log tree commit diff
path: root/pkgs/tools/networking/ebpf-verifier/default.nix
blob: 972c72c4e57ffa4626df4a41d370e20422b91572 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ lib
, stdenv
, fetchFromGitHub
, boost
, cmake
, catch2
, pkg-config
, substituteAll
, yaml-cpp
}:

stdenv.mkDerivation {
  pname = "ebpf-verifier";
  version = "unstable-2023-07-15";

  src = fetchFromGitHub {
    owner = "vbpf";
    repo = "ebpf-verifier";
    rev = "de14d3aa3cd2845b621faf32b599766a66e158cf";
    fetchSubmodules = true;
    hash = "sha256-gnxB8ZLbTyIYpd61T57LPKFm1MHufeVEq/qN9pu2Vpk=";
  };

  patches = [
    (substituteAll {
      # We will download them instead of cmake's fetchContent
      src = ./remove-fetchcontent-usage.patch;
      catch2Src = catch2.src;
    })
  ];

  nativeBuildInputs = [
    pkg-config
    cmake
  ];

  buildInputs = [
    boost
    yaml-cpp
  ];

  cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    cp ../check $out/bin/ebpf-verifier

    runHook postInstall
  '';

  meta = with lib; {
    description = "eBPF verifier based on abstract interpretation";
    homepage = "https://github.com/vbpf/ebpf-verifier";
    license = licenses.mit;
    platforms = platforms.linux;
    maintainers = with maintainers; [ gaelreyrol ];
  };
}