Merge pull request #234414 from NixOS/rbspy-refactor

rbspy: fix build on aarch64-linux
This commit is contained in:
Weijia Wang 2023-05-27 15:42:32 +03:00 committed by GitHub
commit 107c3239e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 14 deletions

View File

@ -4,8 +4,6 @@
, fetchFromGitHub
, ruby
, which
, runCommand
, darwin
}:
rustPlatform.buildRustPackage rec {
@ -20,6 +18,12 @@ rustPlatform.buildRustPackage rec {
};
cargoHash = "sha256-JzspNL4T28awa/1Uajw0gLM3bYyUBYTjnfCXn9qG7SY=";
# error: linker `aarch64-linux-gnu-gcc` not found
postPatch = ''
rm .cargo/config
'';
doCheck = true;
# The current implementation of rbspy fails to detect the version of ruby
@ -39,19 +43,10 @@ rustPlatform.buildRustPackage rec {
"--skip=test_sample_subprocesses"
];
nativeBuildInputs = [ ruby which ];
buildInputs = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
# Pull a header that contains a definition of proc_pid_rusage().
(runCommand "${pname}_headers" { } ''
install -Dm444 ${lib.getDev darwin.apple_sdk.sdk}/include/libproc.h $out/include/libproc.h
'')
];
LIBCLANG_PATH = lib.optionalString stdenv.isDarwin "${stdenv.cc.cc.lib}/lib";
nativeBuildInputs = [ ruby which ]
++ lib.optional stdenv.isDarwin rustPlatform.bindgenHook;
meta = with lib; {
broken = (stdenv.isLinux && stdenv.isAarch64);
homepage = "https://rbspy.github.io/";
description = ''
A Sampling CPU Profiler for Ruby.

View File

@ -39562,7 +39562,7 @@ with pkgs;
rauc = callPackage ../tools/misc/rauc { };
rbspy = callPackage ../development/tools/rbspy { };
rbspy = darwin.apple_sdk_11_0.callPackage ../development/tools/rbspy { };
redprl = callPackage ../applications/science/logic/redprl { };