From 56f9e7571cd088f8488de72169e51f6a2e69ef60 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 1 Oct 2020 04:20:00 +0000 Subject: [PATCH] rbw: fix build on darwin --- pkgs/tools/security/rbw/default.nix | 7 +++++-- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/rbw/default.nix b/pkgs/tools/security/rbw/default.nix index 9eb670102fb8..dd7d96c361a9 100644 --- a/pkgs/tools/security/rbw/default.nix +++ b/pkgs/tools/security/rbw/default.nix @@ -1,11 +1,12 @@ { lib +, stdenv , rustPlatform , fetchCrate , pinentry , openssl , pkgconfig , makeWrapper -, cargo +, Security # rbw-fzf , withFzf ? false, fzf, perl @@ -34,9 +35,11 @@ rustPlatform.buildRustPackage rec { makeWrapper ]; + buildInputs = lib.optionals stdenv.isDarwin [ Security ]; + postPatch = '' substituteInPlace src/pinentry.rs \ - --replace "Command::new(\"pinentry\")" "Command::new(\"${pinentry}/bin/pinentry\")" + --replace 'Command::new("pinentry")' 'Command::new("${pinentry}/${pinentry.binaryPath or "bin/pinentry"}")' '' + lib.optionalString withFzf '' patchShebangs bin/rbw-fzf substituteInPlace bin/rbw-fzf \ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7a9ce10607d6..58ceb8936688 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6465,7 +6465,9 @@ in pywal = with python3Packages; toPythonApplication pywal; - rbw = callPackage ../tools/security/rbw { }; + rbw = callPackage ../tools/security/rbw { + inherit (darwin.apple_sdk.frameworks) Security; + }; remarshal = callPackage ../development/tools/remarshal { };