summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/tools/rbspy/default.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/development/tools/rbspy/default.nix b/pkgs/development/tools/rbspy/default.nix
index 018d8d3310f..0e66f21a5cc 100644
--- a/pkgs/development/tools/rbspy/default.nix
+++ b/pkgs/development/tools/rbspy/default.nix
@@ -4,6 +4,8 @@
 , fetchFromGitHub
 , ruby
 , which
+, runCommand
+, darwin
 }:
 
 rustPlatform.buildRustPackage rec {
@@ -39,6 +41,15 @@ rustPlatform.buildRustPackage rec {
 
   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";
+
   meta = with lib; {
     broken = (stdenv.isLinux && stdenv.isAarch64);
     homepage = "https://rbspy.github.io/";