2021-01-19 07:50:56 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config
|
2020-03-09 23:53:53 +01:00
|
|
|
, libelf, zlib
|
2020-09-09 17:09:16 +02:00
|
|
|
, fetchpatch
|
2019-05-21 20:06:36 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
with builtins;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "libbpf";
|
2021-08-22 14:45:17 +02:00
|
|
|
version = "0.4.0";
|
2019-05-21 20:06:36 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2020-09-01 00:26:57 +02:00
|
|
|
owner = "libbpf";
|
|
|
|
repo = "libbpf";
|
|
|
|
rev = "v${version}";
|
2021-08-22 14:45:17 +02:00
|
|
|
sha256 = "1by5w7g3i2fc10bi6f0j8jqi2nq0x8r973j2qx7qlfryjxr7b2v3";
|
2019-05-21 20:06:36 +02:00
|
|
|
};
|
|
|
|
|
2021-01-19 07:50:56 +01:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-03-09 23:53:53 +01:00
|
|
|
buildInputs = [ libelf zlib ];
|
2019-05-21 20:06:36 +02:00
|
|
|
|
|
|
|
sourceRoot = "source/src";
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
2021-01-19 07:50:56 +01:00
|
|
|
# FIXME: Multi-output requires some fixes to the way the pkg-config file is
|
2019-05-21 20:06:36 +02:00
|
|
|
# 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" ];
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-05-21 20:06:36 +02:00
|
|
|
description = "Upstream mirror of libbpf";
|
|
|
|
homepage = "https://github.com/libbpf/libbpf";
|
|
|
|
license = with licenses; [ lgpl21 /* or */ bsd2 ];
|
2020-09-07 18:41:21 +02:00
|
|
|
maintainers = with maintainers; [ thoughtpolice vcunat ];
|
2019-05-21 20:06:36 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|