depot/third_party/nixpkgs/pkgs/development/tools/py-spy/default.nix
Default email ec92d4d331 Project import generated by Copybara.
GitOrigin-RevId: 540dccb2aeaffa9dc69bfdc41c55abd7ccc6baa3
2021-05-28 11:39:13 +02:00

30 lines
829 B
Nix

{ lib, stdenv, pkgsBuildBuild, rustPlatform, fetchFromGitHub, pkg-config, libunwind, python3 }:
rustPlatform.buildRustPackage rec {
pname = "py-spy";
version = "0.3.5";
src = fetchFromGitHub {
owner = "benfred";
repo = "py-spy";
rev = "v${version}";
sha256 = "sha256-O6DbY/0ZI+BeG22jd9snbE718Y2vv7fqmeDdGWTnqfY=";
};
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-hmqrVGNu3zb109TQfhLI3wvGVnlc4CfbkrIKMfRSn7M=";
meta = with lib; {
description = "Sampling profiler for Python programs";
license = licenses.mit;
maintainers = [ maintainers.lnl7 ];
};
}