nixpkgs/pkgs/os-specific/linux/libbpf/0.x.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

70 lines
1.5 KiB
Nix

{
fetchFromGitHub,
elfutils,
pkg-config,
stdenv,
zlib,
lib,
nixosTests,
}:
# update bot does not seem to limit updates here to 0.8.x despite
# the all-packages derivation being libbpf_0 as the libbpf base alias
# is still present: just disable it for 0.x:
# nixpkgs-update: no auto update
stdenv.mkDerivation rec {
pname = "libbpf";
version = "0.8.3";
src = fetchFromGitHub {
owner = "libbpf";
repo = "libbpf";
rev = "v${version}";
sha256 = "sha256-J5cUvfUYc+uLdkFa2jx/2bqBoZg/eSzc6SWlgKqcfIc=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
elfutils
zlib
];
enableParallelBuilding = true;
makeFlags = [
"PREFIX=$(out)"
"-C src"
];
passthru.tests = {
bpf = nixosTests.bpf;
};
postInstall = ''
# install linux's libbpf-compatible linux/btf.h
install -Dm444 include/uapi/linux/*.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.
# outputs = [ "out" "dev" ];
meta = with lib; {
description = "Upstream mirror of libbpf";
homepage = "https://github.com/libbpf/libbpf";
license = with licenses; [
lgpl21 # or
bsd2
];
maintainers = with maintainers; [
thoughtpolice
vcunat
saschagrunert
martinetd
];
platforms = platforms.linux;
};
}