diff --git a/pkgs/os-specific/linux/bpftrace/default.nix b/pkgs/os-specific/linux/bpftrace/default.nix index 4d2f29491fca..f62ecc24b6aa 100644 --- a/pkgs/os-specific/linux/bpftrace/default.nix +++ b/pkgs/os-specific/linux/bpftrace/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchFromGitHub , cmake, pkg-config, flex, bison -, llvmPackages, kernel, elfutils +, llvmPackages, elfutils , libelf, libbfd, libbpf, libopcodes, bcc }: @@ -17,22 +17,11 @@ stdenv.mkDerivation rec { buildInputs = with llvmPackages; [ llvm libclang - kernel elfutils libelf bcc + elfutils libelf bcc libbpf libbfd libopcodes ]; - nativeBuildInputs = [ cmake pkg-config flex bison llvmPackages.llvm.dev ] - # libelf is incompatible with elfutils-libelf - ++ lib.filter (x: x != libelf) kernel.moduleBuildDependencies; - - # patch the source, *then* substitute on @NIX_KERNEL_SRC@ in the result. we could - # also in theory make this an environment variable around bpftrace, but this works - # nicely without wrappers. - patchPhase = '' - patch -p1 < ${./fix-kernel-include-dir.patch} - substituteInPlace ./src/utils.cpp \ - --subst-var-by NIX_KERNEL_SRC '${kernel.dev}/lib/modules/${kernel.modDirVersion}' - ''; + nativeBuildInputs = [ cmake pkg-config flex bison llvmPackages.llvm.dev ]; # tests aren't built, due to gtest shenanigans. see: # diff --git a/pkgs/os-specific/linux/bpftrace/fix-kernel-include-dir.patch b/pkgs/os-specific/linux/bpftrace/fix-kernel-include-dir.patch deleted file mode 100644 index bff370d51e27..000000000000 --- a/pkgs/os-specific/linux/bpftrace/fix-kernel-include-dir.patch +++ /dev/null @@ -1,22 +0,0 @@ -commit b6172952c0150d84912fa6f09bab782dd0549f1e -Author: Austin Seipp -Date: Fri May 3 00:47:12 2019 -0500 - - src: special case nix build directories for clang - - Signed-off-by: Austin Seipp - -diff --git a/src/clang_parser.cpp b/src/clang_parser.cpp -index b1db8ff..0cfb01f 100644 ---- a/src/utils.cpp -+++ b/src/utils.cpp -@@ -140,6 +140,9 @@ static bool is_dir(const std::string& path) - // Both ksrc and kobj are guaranteed to be != "", if at least some trace of kernel sources was found. - std::tuple get_kernel_dirs(const struct utsname& utsname) - { -+ // NB (aseipp): special case the kernel directory for nix -+ return { "@NIX_KERNEL_SRC@/source", "@NIX_KERNEL_SRC@/build" }; -+ - #ifdef KERNEL_HEADERS_DIR - return {KERNEL_HEADERS_DIR, KERNEL_HEADERS_DIR}; - #endif diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fd5a63bdc2cb..d806d62d961e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14153,6 +14153,8 @@ with pkgs; python = pkgs.python3; }; + bpftrace = callPackage ../os-specific/linux/bpftrace { }; + bpm-tools = callPackage ../tools/audio/bpm-tools { }; byacc = callPackage ../development/tools/parsing/byacc { }; diff --git a/pkgs/top-level/linux-kernels.nix b/pkgs/top-level/linux-kernels.nix index e17bef470559..64b5d068220f 100644 --- a/pkgs/top-level/linux-kernels.nix +++ b/pkgs/top-level/linux-kernels.nix @@ -250,7 +250,7 @@ in { inherit (kernel) kernelOlder kernelAtLeast; # Obsolete aliases (these packages do not depend on the kernel). inherit (pkgs) odp-dpdk pktgen; # added 2018-05 - inherit (pkgs) bcc; # added 2021-12 + inherit (pkgs) bcc bpftrace; # added 2021-12 acpi_call = callPackage ../os-specific/linux/acpi-call {}; @@ -264,8 +264,6 @@ in { batman_adv = callPackage ../os-specific/linux/batman-adv {}; - bpftrace = callPackage ../os-specific/linux/bpftrace { }; - bbswitch = callPackage ../os-specific/linux/bbswitch {}; chipsec = callPackage ../tools/security/chipsec {