libbpf: fix incomplete linkage
Also use a better reallocarray fix.
This commit is contained in:
parent
fa0ed8d276
commit
16124457d0
|
@ -1,5 +1,6 @@
|
||||||
{ stdenv, fetchFromGitHub, pkgconfig
|
{ stdenv, fetchFromGitHub, pkgconfig
|
||||||
, libelf, zlib
|
, libelf, zlib
|
||||||
|
, fetchpatch
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with builtins;
|
with builtins;
|
||||||
|
@ -15,6 +16,21 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "1wi3a795jq0smqg1c5ml2ghai47n1m5ijmch017wscybx4jdlynv";
|
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 ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
buildInputs = [ libelf zlib ];
|
buildInputs = [ libelf zlib ];
|
||||||
|
|
||||||
|
@ -22,14 +38,6 @@ stdenv.mkDerivation rec {
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
makeFlags = [ "PREFIX=$(out)" ];
|
makeFlags = [ "PREFIX=$(out)" ];
|
||||||
|
|
||||||
patchPhase = ''
|
|
||||||
substituteInPlace ../scripts/check-reallocarray.sh \
|
|
||||||
--replace '/bin/rm' 'rm'
|
|
||||||
# Without patching this the config-test program will be refused by our CC wrapper.
|
|
||||||
chmod +w ../scripts
|
|
||||||
sed -e '2a NIX_ENFORCE_PURITY=0' -i ../scripts/check-reallocarray.sh
|
|
||||||
'';
|
|
||||||
|
|
||||||
# FIXME: Multi-output requires some fixes to the way the pkgconfig file is
|
# 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
|
# constructed (it gets put in $out instead of $dev for some reason, with
|
||||||
# improper paths embedded). Don't enable it for now.
|
# improper paths embedded). Don't enable it for now.
|
||||||
|
|
Loading…
Reference in New Issue