From 18ff588551b15433f795260ca1760e603f6de196 Mon Sep 17 00:00:00 2001 From: Andrey Kuznetsov Date: Tue, 16 Mar 2021 20:27:10 +0400 Subject: [PATCH] rust-analyzer: fix build on darwin --- pkgs/development/tools/rust/rust-analyzer/default.nix | 4 +++- pkgs/development/tools/rust/rust-analyzer/generic.nix | 9 ++++++--- pkgs/top-level/all-packages.nix | 4 +++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/rust/rust-analyzer/default.nix b/pkgs/development/tools/rust/rust-analyzer/default.nix index 642f2e936e1..09e24775a35 100644 --- a/pkgs/development/tools/rust/rust-analyzer/default.nix +++ b/pkgs/development/tools/rust/rust-analyzer/default.nix @@ -1,4 +1,4 @@ -{ pkgs, callPackage }: +{ pkgs, callPackage, CoreServices }: { rust-analyzer-unwrapped = callPackage ./generic.nix rec { @@ -6,6 +6,8 @@ version = "unstable-${rev}"; sha256 = "150gydm0mg72bbhgjjks8qc5ldiqyzhai9z4yfh4f1s2bwdfh3yf"; cargoSha256 = "10l0lk5p11002q59dqa5yrrz6n6s11i7bmr1wnl141bxqvm873q2"; + + inherit CoreServices; }; rust-analyzer = callPackage ./wrapper.nix {} { diff --git a/pkgs/development/tools/rust/rust-analyzer/generic.nix b/pkgs/development/tools/rust/rust-analyzer/generic.nix index ecca83f89a4..ddb834af6c3 100644 --- a/pkgs/development/tools/rust/rust-analyzer/generic.nix +++ b/pkgs/development/tools/rust/rust-analyzer/generic.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, fetchFromGitHub, rustPlatform, darwin, cmake +{ lib, stdenv, fetchFromGitHub, rustPlatform, CoreServices, cmake +, libiconv , useMimalloc ? false , doCheck ? true @@ -22,8 +23,10 @@ rustPlatform.buildRustPackage { nativeBuildInputs = lib.optional useMimalloc cmake; - buildInputs = lib.optionals stdenv.hostPlatform.isDarwin - [ darwin.apple_sdk.frameworks.CoreServices ]; + buildInputs = lib.optionals stdenv.isDarwin [ + CoreServices + libiconv + ]; RUST_ANALYZER_REV = rev; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8b40b3f8877..c1c595fa488 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11054,7 +11054,9 @@ in rustracerd = callPackage ../development/tools/rust/racerd { inherit (darwin.apple_sdk.frameworks) Security; }; - inherit (callPackage ../development/tools/rust/rust-analyzer { }) + inherit (callPackage ../development/tools/rust/rust-analyzer { + inherit (darwin.apple_sdk.frameworks) CoreServices; + }) rust-analyzer-unwrapped rust-analyzer; rust-bindgen = callPackage ../development/tools/rust/bindgen { }; rust-cbindgen = callPackage ../development/tools/rust/cbindgen {