Unverified Commit 8ab44677 authored by illustris's avatar illustris
Browse files

bpftrace: 0.21.2 -> 0.21.3, fix broken build

parent c4974366
Loading
Loading
Loading
Loading
+6 −21
Original line number Diff line number Diff line
@@ -22,13 +22,13 @@

stdenv.mkDerivation rec {
  pname = "bpftrace";
  version = "0.21.2";
  version = "0.21.3";

  src = fetchFromGitHub {
    owner = "bpftrace";
    repo = "bpftrace";
    rev = "v${version}";
    hash = "sha256-/2m+5iFE7R+ZEc/VcgWAhkLD/jEK88roUUOUyYODi0U=";
    hash = "sha256-cmKm2g1lzl625t4z7ZM04QgqDubBsCMqtibXmg+3y9w=";
  };

  buildInputs = with llvmPackages; [
@@ -52,31 +52,15 @@ stdenv.mkDerivation rec {
    util-linux
  ];

  # tests aren't built, due to gtest shenanigans. see:
  #
  #     https://github.com/bpftrace/bpftrace/issues/161#issuecomment-453606728
  #     https://github.com/bpftrace/bpftrace/pull/363
  #
  cmakeFlags = [
    "-DBUILD_TESTING=FALSE"
    "-DLIBBCC_INCLUDE_DIRS=${bcc}/include"
    "-DINSTALL_TOOL_DOCS=OFF"
    "-DSYSTEM_INCLUDE_PATHS=${glibc.dev}/include"
  ];

  patches = [
    (fetchpatch {
      name = "runqlat-bt-no-includes.patch";
      url = "https://github.com/bpftrace/bpftrace/pull/3262.patch";
      hash = "sha256-9yqaZeG1Uf2cC9Aa40c2QUTQRl8n2NO1nq278hf9P4M=";
    })
    (fetchpatch {
      name = "kheaders-not-found-message-only-on-error.patch";
      url = "https://github.com/bpftrace/bpftrace/pull/3265.patch";
      hash = "sha256-8AICMzwq5Evy9+hmZhFjccw/HmgZ9t+YIoHApjLv6Uc=";
      excludes = [ "CHANGELOG.md" ];
    })
  ];
  postPatch = ''
    substituteInPlace CMakeLists.txt --replace "set(MAX_LLVM_MAJOR 18)" "set(MAX_LLVM_MAJOR 19)"
  '';

  # Pull BPF scripts into $PATH (next to their bcc program equivalents), but do
  # not move them to keep `${pkgs.bpftrace}/share/bpftrace/tools/...` working.
@@ -107,6 +91,7 @@ stdenv.mkDerivation rec {
      thoughtpolice
      martinetd
      mfrw
      illustris
    ];
    platforms = platforms.linux;
  };