From 7345d52e875d5560ad27a76673f6edb19a597571 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Sat, 15 Oct 2022 20:28:50 -0400 Subject: [PATCH] cargo-espflash: fix build on darwin - udev is only needed on linux (and is blocked from building on darwin via systemd being marked as broken) - Security is required (otherwise a link error occurs) --- pkgs/development/tools/rust/cargo-espflash/default.nix | 6 ++++-- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/rust/cargo-espflash/default.nix b/pkgs/development/tools/rust/cargo-espflash/default.nix index 0e3876cbe9b0..26f935c58725 100644 --- a/pkgs/development/tools/rust/cargo-espflash/default.nix +++ b/pkgs/development/tools/rust/cargo-espflash/default.nix @@ -1,4 +1,4 @@ -{ lib, rustPlatform, fetchFromGitHub, pkg-config, udev }: +{ lib, rustPlatform, fetchFromGitHub, pkg-config, udev, stdenv, Security }: rustPlatform.buildRustPackage rec { pname = "cargo-espflash"; @@ -15,8 +15,10 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = [ + buildInputs = lib.optionals stdenv.isLinux [ udev + ] ++ lib.optionals stdenv.isDarwin [ + Security ]; cargoSha256 = "sha256-82o3B6qmBVPpBVAogClmTbxrBRXY8Lmd2sHmonP5/s8="; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7063674249b9..f9f70d21262a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14739,7 +14739,9 @@ with pkgs; buildRustCrateHelpers = callPackage ../build-support/rust/build-rust-crate/helpers.nix { }; cratesIO = callPackage ../build-support/rust/crates-io.nix { }; - cargo-espflash = callPackage ../development/tools/rust/cargo-espflash { }; + cargo-espflash = callPackage ../development/tools/rust/cargo-espflash { + inherit (darwin.apple_sdk.frameworks) Security; + }; cargo-web = callPackage ../development/tools/rust/cargo-web { inherit (darwin.apple_sdk.frameworks) CoreServices Security;