2021-01-19 07:50:56 +01:00
|
|
|
{ lib, stdenv, pkgsBuildBuild, rustPlatform, fetchFromGitHub, pkg-config, libunwind, python3 }:
|
2020-11-23 12:24:00 +01:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "py-spy";
|
2021-11-03 23:29:38 +01:00
|
|
|
version = "0.3.10";
|
2020-11-23 12:24:00 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "benfred";
|
|
|
|
repo = "py-spy";
|
|
|
|
rev = "v${version}";
|
2021-11-03 23:29:38 +01:00
|
|
|
sha256 = "sha256-OiYYWLbdDrte0+YeJklt5pX2u2f4PnWJ4dyGWJBiTmQ=";
|
2020-11-23 12:24:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = "-L${libunwind}/lib";
|
|
|
|
|
|
|
|
# error: linker `arm-linux-gnueabihf-gcc` not found
|
2021-01-23 13:26:19 +01:00
|
|
|
preConfigure = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
|
2020-11-23 12:24:00 +01:00
|
|
|
export RUSTFLAGS="-Clinker=$CC"
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [ python3 ];
|
|
|
|
|
2021-11-03 23:29:38 +01:00
|
|
|
cargoSha256 = "sha256-Dn+1C+RRjxu8onejeKB9WsVGtthTy3Uit9jm2JtyN1w=";
|
2020-11-23 12:24:00 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-11-23 12:24:00 +01:00
|
|
|
description = "Sampling profiler for Python programs";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.lnl7 ];
|
|
|
|
};
|
|
|
|
}
|