nixpkgs/pkgs/development/tools/py-spy/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.5 KiB
Nix
Raw Normal View History

2023-03-13 19:57:27 +00:00
{ lib
, stdenv
, darwin
, fetchFromGitHub
, libunwind
, python3
, rustPlatform
}:
2020-11-23 11:24:00 +00:00
rustPlatform.buildRustPackage rec {
pname = "py-spy";
2023-02-01 21:42:27 +00:00
version = "0.3.14";
2020-11-23 11:24:00 +00:00
src = fetchFromGitHub {
owner = "benfred";
repo = "py-spy";
2023-03-13 19:57:27 +00:00
rev = "refs/tags/v${version}";
hash = "sha256-NciyzKiDKIMeuHhTjzmHIc3dYW4AniuCNjZugm4hMss=";
2020-11-23 11:24:00 +00:00
};
2023-03-13 19:57:27 +00:00
cargoHash = "sha256-nm+44YWSJOOg9a9d8b3APXW50ThV3iA2C/QsJMttscE=";
2023-07-10 11:15:37 +00:00
# error: linker `arm-linux-gnueabihf-gcc` not found
postPatch = ''
rm .cargo/config
'';
2023-03-13 19:57:27 +00:00
nativeBuildInputs = [
rustPlatform.bindgenHook
];
nativeCheckInputs = [
python3
];
2023-02-02 23:53:05 +00:00
buildInputs = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
# Pull a header that contains a definition of proc_pid_rusage().
2023-07-10 11:15:37 +00:00
darwin.apple_sdk_11_0.Libsystem
2023-02-02 23:53:05 +00:00
];
env.NIX_CFLAGS_COMPILE = "-L${libunwind}/lib";
2020-11-23 11:24:00 +00:00
2023-03-13 20:17:07 +00:00
checkFlags = [
# thread 'python_data_access::tests::test_copy_string' panicked at 'called `Result::unwrap()` on an `Err`
"--skip=python_data_access::tests::test_copy_string"
2023-05-09 12:17:05 +00:00
] ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [
# panicked at 'called `Result::unwrap()` on an `Err` value: failed to get os threadid
"--skip=test_thread_reuse"
2023-03-13 20:17:07 +00:00
];
meta = with lib; {
2020-11-23 11:24:00 +00:00
description = "Sampling profiler for Python programs";
mainProgram = "py-spy";
2023-03-13 20:41:33 +00:00
homepage = "https://github.com/benfred/py-spy";
changelog = "https://github.com/benfred/py-spy/releases/tag/v${version}";
2020-11-23 11:24:00 +00:00
license = licenses.mit;
2023-03-13 19:57:27 +00:00
maintainers = with maintainers; [ lnl7 ];
2020-11-23 11:24:00 +00:00
};
}