depot/third_party/nixpkgs/pkgs/development/tools/py-spy/default.nix
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

30 lines
830 B
Nix

{ lib, stdenv, pkgsBuildBuild, rustPlatform, fetchFromGitHub, pkg-config, libunwind, python3 }:
rustPlatform.buildRustPackage rec {
pname = "py-spy";
version = "0.3.12";
src = fetchFromGitHub {
owner = "benfred";
repo = "py-spy";
rev = "v${version}";
sha256 = "sha256-k58PPJAF9MsKRlscFSqdtTY5/rriaF0mXjgkADT+F4s=";
};
NIX_CFLAGS_COMPILE = "-L${libunwind}/lib";
# error: linker `arm-linux-gnueabihf-gcc` not found
preConfigure = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
export RUSTFLAGS="-Clinker=$CC"
'';
checkInputs = [ python3 ];
cargoSha256 = "sha256-DC+EfJ671/bvFoHHjpJlFCO/phdndNcldnP3DsIKqAg=";
meta = with lib; {
description = "Sampling profiler for Python programs";
license = licenses.mit;
maintainers = [ maintainers.lnl7 ];
};
}