3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #222522 from K900/fix-systemtap

This commit is contained in:
Bernardo Meurer 2023-03-22 11:21:01 -03:00 committed by GitHub
commit 396918ad01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,22 +22,10 @@ let
env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=deprecated-declarations" ]; # Needed with GCC 12
};
## a kernel build dir as expected by systemtap
kernelBuildDir = runCommand "kbuild-${kernel.version}-merged" { } ''
mkdir -p $out
for f in \
${kernel}/System.map \
${kernel.dev}/vmlinux \
${kernel.dev}/lib/modules/${kernel.modDirVersion}/build/{*,.*}
do
ln -s $(readlink -f $f) $out
done
'';
pypkgs = with python3.pkgs; makePythonPath [ pyparsing ];
in runCommand "systemtap-${kernel.version}-${version}" {
inherit stapBuild kernelBuildDir;
inherit stapBuild;
nativeBuildInputs = [ makeWrapper ];
meta = {
homepage = "https://sourceware.org/systemtap/";
@ -52,7 +40,7 @@ in runCommand "systemtap-${kernel.version}-${version}" {
done
rm $out/bin/stap $out/bin/dtrace
makeWrapper $stapBuild/bin/stap $out/bin/stap \
--add-flags "-r $kernelBuildDir" \
--add-flags "-r ${kernel.dev}" \
--prefix PATH : ${lib.makeBinPath [ stdenv.cc.cc stdenv.cc.bintools elfutils gnumake ]}
makeWrapper $stapBuild/bin/dtrace $out/bin/dtrace \
--prefix PYTHONPATH : ${pypkgs}