aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/os-specific/linux/libbpf/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/libbpf/default.nix')
-rw-r--r--nixpkgs/pkgs/os-specific/linux/libbpf/default.nix33
1 files changed, 22 insertions, 11 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/libbpf/default.nix b/nixpkgs/pkgs/os-specific/linux/libbpf/default.nix
index aefb5ff6835..68ccef6529c 100644
--- a/nixpkgs/pkgs/os-specific/linux/libbpf/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/libbpf/default.nix
@@ -1,20 +1,36 @@
{ stdenv, fetchFromGitHub, pkgconfig
, libelf, zlib
+, fetchpatch
}:
with builtins;
stdenv.mkDerivation rec {
pname = "libbpf";
- version = "0.0.8";
+ version = "0.1.0";
src = fetchFromGitHub {
- owner = "libbpf";
- repo = "libbpf";
- rev = "v${version}";
- sha256 = "02vbpg9v5sjcw7ihximy63cjmz82q5izkp91i44m1qp6qj5qn4sr";
+ owner = "libbpf";
+ repo = "libbpf";
+ rev = "v${version}";
+ sha256 = "1wi3a795jq0smqg1c5ml2ghai47n1m5ijmch017wscybx4jdlynv";
};
+ patches = [
+ (fetchpatch { # included upstream for > 0.1.0
+ name = "link-zlib.patch";
+ url = "https://github.com/libbpf/libbpf/commit/8b14cb43ff837.diff";
+ sha256 = "17mvjrs7s727drz013a8qlyj0345ldi2kph6pazcmxv6kl1qrz2z";
+ })
+ ];
+ patchFlags = "-p2";
+ # https://github.com/libbpf/libbpf/pull/201#issuecomment-689174740
+ postPatch = ''
+ substituteInPlace ../scripts/check-reallocarray.sh \
+ --replace 'mktemp /tmp/' 'mktemp ' \
+ --replace '/bin/rm' 'rm'
+ '';
+
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libelf zlib ];
@@ -22,11 +38,6 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
makeFlags = [ "PREFIX=$(out)" ];
- patchPhase = ''
- substituteInPlace ../scripts/check-reallocarray.sh \
- --replace '/bin/rm' 'rm'
- '';
-
# FIXME: Multi-output requires some fixes to the way the pkgconfig file is
# constructed (it gets put in $out instead of $dev for some reason, with
# improper paths embedded). Don't enable it for now.
@@ -37,7 +48,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 ];
+ maintainers = with maintainers; [ thoughtpolice vcunat ];
platforms = platforms.linux;
};
}