Unverified Commit 107c3239 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #234414 from NixOS/rbspy-refactor

rbspy: fix build on aarch64-linux
parents d289ed9e 8f9039a8
Loading
Loading
Loading
Loading
+8 −13
Original line number Diff line number Diff line
@@ -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.
+1 −1
Original line number Diff line number Diff line
@@ -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 { };