libbpf: add libbpf_1 for libbpf 1.0.1

libbpf 1.x breaks too many packages to do a hard transition: just keep
both packages for a while longer.

See https://github.com/libbpf/libbpf/issues/590 for discussion with upstream

+55 -3
+49
pkgs/os-specific/linux/libbpf/0.x.nix
··· 1 + { fetchFromGitHub 2 + , elfutils 3 + , pkg-config 4 + , stdenv 5 + , zlib 6 + , lib 7 + , nixosTests 8 + }: 9 + 10 + stdenv.mkDerivation rec { 11 + pname = "libbpf"; 12 + version = "0.8.1"; 13 + 14 + src = fetchFromGitHub { 15 + owner = "libbpf"; 16 + repo = "libbpf"; 17 + rev = "v${version}"; 18 + sha256 = "sha256-daVS+TErmDU8ksThOvcepg1A61iD8N8GIkC40cmc9/8="; 19 + }; 20 + 21 + nativeBuildInputs = [ pkg-config ]; 22 + buildInputs = [ elfutils zlib ]; 23 + 24 + enableParallelBuilding = true; 25 + makeFlags = [ "PREFIX=$(out)" "-C src" ]; 26 + 27 + passthru.tests = { 28 + bpf = nixosTests.bpf; 29 + }; 30 + 31 + postInstall = '' 32 + # install linux's libbpf-compatible linux/btf.h 33 + install -Dm444 include/uapi/linux/*.h -t $out/include/linux 34 + ''; 35 + 36 + # FIXME: Multi-output requires some fixes to the way the pkg-config file is 37 + # constructed (it gets put in $out instead of $dev for some reason, with 38 + # improper paths embedded). Don't enable it for now. 39 + 40 + # outputs = [ "out" "dev" ]; 41 + 42 + meta = with lib; { 43 + description = "Upstream mirror of libbpf"; 44 + homepage = "https://github.com/libbpf/libbpf"; 45 + license = with licenses; [ lgpl21 /* or */ bsd2 ]; 46 + maintainers = with maintainers; [ thoughtpolice vcunat saschagrunert martinetd ]; 47 + platforms = platforms.linux; 48 + }; 49 + }
+2 -2
pkgs/os-specific/linux/libbpf/default.nix
··· 9 9 10 10 stdenv.mkDerivation rec { 11 11 pname = "libbpf"; 12 - version = "0.8.1"; 12 + version = "1.0.1"; 13 13 14 14 src = fetchFromGitHub { 15 15 owner = "libbpf"; 16 16 repo = "libbpf"; 17 17 rev = "v${version}"; 18 - sha256 = "sha256-daVS+TErmDU8ksThOvcepg1A61iD8N8GIkC40cmc9/8="; 18 + sha256 = "sha256-2rzVah+CxCztKnlEWMIQrUS2JJTLiWscfIA1aOBtIzs="; 19 19 }; 20 20 21 21 nativeBuildInputs = [ pkg-config ];
+4 -1
pkgs/top-level/all-packages.nix
··· 16111 16111 16112 16112 bump = callPackage ../development/tools/github/bump { }; 16113 16113 16114 - libbpf = callPackage ../os-specific/linux/libbpf { }; 16114 + libbpf_1 = callPackage ../os-specific/linux/libbpf { }; 16115 + libbpf_0 = callPackage ../os-specific/linux/libbpf/0.x.nix { }; 16116 + # until more issues are fixed default to libbpf 0.x 16117 + libbpf = libbpf_0; 16115 16118 16116 16119 bpftools = callPackage ../os-specific/linux/bpftools { }; 16117 16120