From 80ce1323828c649728f22bc9661a604ebc3498bd Mon Sep 17 00:00:00 2001 From: happysalada Date: Mon, 12 Oct 2020 13:19:41 +0900 Subject: [PATCH 1/2] cargo-edit: fix Darwin build --- .../package-management/cargo-edit/default.nix | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/package-management/cargo-edit/default.nix b/pkgs/tools/package-management/cargo-edit/default.nix index 3115b720b6b8..02bb38a1f15c 100644 --- a/pkgs/tools/package-management/cargo-edit/default.nix +++ b/pkgs/tools/package-management/cargo-edit/default.nix @@ -1,6 +1,14 @@ -{ stdenv, lib, darwin -, rustPlatform, fetchFromGitHub -, openssl, pkg-config, libiconv }: +{ stdenv +, lib +, darwin +, rustPlatform +, fetchFromGitHub +, pkg-config +, xcbuild +, openssl +, libiconv +, zlib +}: rustPlatform.buildRustPackage rec { pname = "cargo-edit"; @@ -15,8 +23,18 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "1h1sy54p7zxijydnhzvkxli90d72biv1inni17licb0vb9dihmnf"; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ libiconv darwin.apple_sdk.frameworks.Security ]; + nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.isDarwin [ + # The cc crate runs xcbuild. This dependency can be removed once + # the following PR is merged from staging into master: + # + # https://github.com/NixOS/nixpkgs/pull/97000 + xcbuild + ]; + + buildInputs = [ openssl zlib ] ++ lib.optionals stdenv.isDarwin [ + libiconv + darwin.apple_sdk.frameworks.Security + ]; doCheck = false; # integration tests depend on changing cargo config From f91426713b85f6b1e6d0d5d0b0e38366aa3b2c9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Tue, 13 Oct 2020 08:51:35 +0200 Subject: [PATCH 2/2] cargo-edit: pass the Security dependency properly --- pkgs/tools/package-management/cargo-edit/default.nix | 4 ++-- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/package-management/cargo-edit/default.nix b/pkgs/tools/package-management/cargo-edit/default.nix index 02bb38a1f15c..ef286ae64494 100644 --- a/pkgs/tools/package-management/cargo-edit/default.nix +++ b/pkgs/tools/package-management/cargo-edit/default.nix @@ -1,12 +1,12 @@ { stdenv , lib -, darwin , rustPlatform , fetchFromGitHub , pkg-config , xcbuild , openssl , libiconv +, Security , zlib }: @@ -33,7 +33,7 @@ rustPlatform.buildRustPackage rec { buildInputs = [ openssl zlib ] ++ lib.optionals stdenv.isDarwin [ libiconv - darwin.apple_sdk.frameworks.Security + Security ]; doCheck = false; # integration tests depend on changing cargo config diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 066ae06f22ad..8e0ccc957020 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9702,7 +9702,9 @@ in }; cargo-deps = callPackage ../tools/package-management/cargo-deps { }; cargo-download = callPackage ../tools/package-management/cargo-download { }; - cargo-edit = callPackage ../tools/package-management/cargo-edit { }; + cargo-edit = callPackage ../tools/package-management/cargo-edit { + inherit (darwin.apple_sdk.frameworks) Security; + }; cargo-kcov = callPackage ../tools/package-management/cargo-kcov { }; cargo-graph = callPackage ../tools/package-management/cargo-graph { }; cargo-license = callPackage ../tools/package-management/cargo-license { };