depot/third_party/nixpkgs/pkgs/os-specific/linux/libbpf/default.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

43 lines
1.1 KiB
Nix

{ stdenv, fetchFromGitHub, pkgconfig
, libelf, zlib
}:
with builtins;
stdenv.mkDerivation rec {
pname = "libbpf";
version = "0.0.7";
src = fetchFromGitHub {
owner = "libbpf";
repo = "libbpf";
rev = "v${version}";
sha256 = "1jcqhqvfbnbijm4jn949ibw1qywai9rwhyijf6lg8cvnyxkib2bs";
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libelf zlib ];
sourceRoot = "source/src";
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.
# outputs = [ "out" "dev" ];
meta = with stdenv.lib; {
description = "Upstream mirror of libbpf";
homepage = "https://github.com/libbpf/libbpf";
license = with licenses; [ lgpl21 /* or */ bsd2 ];
maintainers = with maintainers; [ thoughtpolice ];
platforms = platforms.linux;
};
}