From 0a66a6bbe2226e298909281dd7a4c775baada2de Mon Sep 17 00:00:00 2001 From: figsoda Date: Wed, 19 Oct 2022 19:46:56 -0400 Subject: [PATCH] cargo-show-asm: unbreak on darwin --- .../tools/rust/cargo-show-asm/default.nix | 31 +++++++++++++------ 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/pkgs/development/tools/rust/cargo-show-asm/default.nix b/pkgs/development/tools/rust/cargo-show-asm/default.nix index 094753f955ca..e67a6a696d69 100644 --- a/pkgs/development/tools/rust/cargo-show-asm/default.nix +++ b/pkgs/development/tools/rust/cargo-show-asm/default.nix @@ -1,13 +1,16 @@ { lib -, stdenv -, fetchFromGitHub , rustPlatform -, pkg-config +, fetchFromGitHub +, curl , installShellFiles +, pkg-config , openssl +, stdenv +, darwin , nix-update-script , callPackage }: + rustPlatform.buildRustPackage rec { pname = "cargo-asm"; version = "0.1.24"; @@ -21,14 +24,25 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-S7OpHNjiTfQg7aPmHEx6Q/OV5QA9pB29F3MTIeiLAXg="; - nativeBuildInputs = [ pkg-config installShellFiles ]; - buildInputs = [ openssl ]; + nativeBuildInputs = [ + curl.dev + installShellFiles + pkg-config + ]; + + buildInputs = [ + curl + openssl + ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ + CoreFoundation + SystemConfiguration + ]); postInstall = '' - installShellCompletion --cmd foobar \ + installShellCompletion --cmd cargo-asm \ --bash <($out/bin/cargo-asm --bpaf-complete-style-bash) \ --fish <($out/bin/cargo-asm --bpaf-complete-style-fish) \ - --zsh <($out/bin/cargo-asm --bpaf-complete-style-zsh ) + --zsh <($out/bin/cargo-asm --bpaf-complete-style-zsh) ''; passthru = { @@ -44,7 +58,6 @@ rustPlatform.buildRustPackage rec { description = "Cargo subcommand showing the assembly, LLVM-IR and MIR generated for Rust code"; homepage = "https://github.com/pacak/cargo-show-asm"; license = with licenses; [ asl20 mit ]; - maintainers = with maintainers; [ oxalica ]; - broken = stdenv.isDarwin; # FIXME: Seems to have issue compiling bundled curl. + maintainers = with maintainers; [ figsoda oxalica ]; }; }