php.packages.phpspy: Add dependency needed for tracing & install flamegraph helper

This commit is contained in:
Jan Tojnar 2024-07-09 08:10:00 +02:00
parent 00d80d1381
commit 7f5a1170d0

View file

@ -2,6 +2,9 @@
lib,
stdenv,
fetchFromGitHub,
gnugrep,
binutils,
makeBinaryWrapper,
php,
testers,
phpPackages,
@ -19,19 +22,32 @@ stdenv.mkDerivation (finalAttrs: {
fetchSubmodules = true;
};
nativeBuildInputs = [ php.unwrapped ];
nativeBuildInputs = [
makeBinaryWrapper
php.unwrapped
];
env.USE_ZEND = 1;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp phpspy $out/bin
install -Dt "$out/bin" phpspy stackcollapse-phpspy.pl
runHook postInstall
'';
postFixup = ''
wrapProgram "$out/bin/phpspy" \
--prefix PATH : "${
lib.makeBinPath [
gnugrep
# for objdump
binutils
]
}"
'';
passthru.tests.version = testers.testVersion {
version = "v${finalAttrs.version}";
package = phpPackages.phpspy;