From 78a4ea51e4186180397abd281f918d8c248ae1ea Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sat, 4 Dec 2021 20:25:09 +0900 Subject: [PATCH] libbpf: install linux/btf.h This installs the linux/btf.h header in libbpf, which is necessarily compatible with bpf/btf.h Note that we also ship the linux header's linux/btf.h with glibc, but explicit buildInputs should have priority over default headers so hopefully this one will always be used. --- pkgs/os-specific/linux/libbpf/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/libbpf/default.nix b/pkgs/os-specific/linux/libbpf/default.nix index 5debfd2ef2c8..ba765b4f92e2 100644 --- a/pkgs/os-specific/linux/libbpf/default.nix +++ b/pkgs/os-specific/linux/libbpf/default.nix @@ -23,6 +23,11 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; makeFlags = [ "PREFIX=$(out)" ]; + postInstall = '' + # install linux's libbpf-compatible linux/btf.h + install -Dm444 ../include/uapi/linux/btf.h -t $out/include/linux + ''; + # FIXME: Multi-output requires some fixes to the way the pkg-config file is # constructed (it gets put in $out instead of $dev for some reason, with # improper paths embedded). Don't enable it for now. @@ -33,7 +38,7 @@ stdenv.mkDerivation rec { description = "Upstream mirror of libbpf"; homepage = "https://github.com/libbpf/libbpf"; license = with licenses; [ lgpl21 /* or */ bsd2 ]; - maintainers = with maintainers; [ thoughtpolice vcunat saschagrunert ]; + maintainers = with maintainers; [ thoughtpolice vcunat saschagrunert martinetd ]; platforms = platforms.linux; }; }