about summary refs log tree commit diff
path: root/pkgs/tools/security
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2023-02-19 14:27:49 -0500
committerGitHub <noreply@github.com>2023-02-19 14:27:49 -0500
commita38798bc32ade74049402dfeaa8c943c5e9c96e7 (patch)
treec7464ea5a196ca87d0c490f0d92d72c396e9c9bc /pkgs/tools/security
parent48d298f85383765664e76b5fb98dd91f2b0d0292 (diff)
parent16f68c3db5e4e975953053f4c9fc70d80269c25c (diff)
Merge pull request #217161 from marsam/update-rbw
rbw: 1.4.3 -> 1.5.0
Diffstat (limited to 'pkgs/tools/security')
-rw-r--r--pkgs/tools/security/rbw/default.nix58
1 files changed, 22 insertions, 36 deletions
diff --git a/pkgs/tools/security/rbw/default.nix b/pkgs/tools/security/rbw/default.nix
index a5eb83f1e0b5c..04b3f1aecbd06 100644
--- a/pkgs/tools/security/rbw/default.nix
+++ b/pkgs/tools/security/rbw/default.nix
@@ -26,61 +26,47 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "rbw";
-  version = "1.4.3";
+  version = "1.5.0";
 
   src = fetchCrate {
     inherit version;
     crateName = pname;
-    sha256 = "sha256-teeGKQNf+nuUcF9BcdiTV/ycENTbcGvPZZ34FdOO31k=";
+    sha256 = "sha256-3kSBE2D+kC9CTbWlCKPro9fLu2tnd6LFTV4EshHMm3Y=";
   };
 
-  cargoSha256 = "sha256-Soquc3OuGlDsGSwNCvYOWQeraYpkzX1oJwmM03Rc3Jg=";
+  cargoSha256 = "sha256-DL3qaUZxWnzsJOxi8+GtXBbZC7vfsridJWqhOTdcsgM=";
 
   nativeBuildInputs = [
-    pkg-config
-    makeWrapper
     installShellFiles
-  ];
+  ] ++ lib.optionals stdenv.isLinux [ pkg-config ];
 
-  buildInputs = lib.optionals stdenv.isDarwin [ Security libiconv ];
+  buildInputs = lib.optionals stdenv.isDarwin [ Security ];
 
-  postPatch = ''
-    patchShebangs bin/git-credential-rbw
-    substituteInPlace bin/git-credential-rbw \
-        --replace rbw $out/bin/rbw
-  '' + lib.optionalString withFzf ''
-    patchShebangs bin/rbw-fzf
-    substituteInPlace bin/rbw-fzf \
-        --replace fzf ${fzf}/bin/fzf \
-        --replace perl ${perl}/bin/perl
-  '' + lib.optionalString withRofi ''
-    patchShebangs bin/rbw-rofi
-    substituteInPlace bin/rbw-rofi \
-        --replace rofi ${rofi}/bin/rofi \
-        --replace xclip ${xclip}/bin/xclip
-  '' + lib.optionalString withRofi ''
-    patchShebangs bin/pass-import
-    substituteInPlace bin/pass-import \
-        --replace pass ${pass}/bin/pass
-  '';
-
-  preConfigure = ''
+  preConfigure = lib.optionalString stdenv.isLinux ''
     export OPENSSL_INCLUDE_DIR="${openssl.dev}/include"
     export OPENSSL_LIB_DIR="${lib.getLib openssl}/lib"
   '';
 
   postInstall = ''
-    for shell in bash zsh fish; do
-      $out/bin/rbw gen-completions $shell > rbw.$shell
-      installShellCompletion rbw.$shell
-    done
-    cp bin/git-credential-rbw $out/bin
+    install -Dm755 -t $out/bin bin/git-credential-rbw
+    installShellCompletion --cmd rbw \
+      --bash <($out/bin/rbw gen-completions bash) \
+      --fish <($out/bin/rbw gen-completions fish) \
+      --zsh <($out/bin/rbw gen-completions zsh)
   '' + lib.optionalString withFzf ''
-    cp bin/rbw-fzf $out/bin
+    install -Dm755 -t $out/bin bin/rbw-fzf
+    substituteInPlace $out/bin/rbw-fzf \
+      --replace fzf ${fzf}/bin/fzf \
+      --replace perl ${perl}/bin/perl
   '' + lib.optionalString withRofi ''
-    cp bin/rbw-rofi $out/bin
+    install -Dm755 -t $out/bin bin/rbw-rofi
+    substituteInPlace $out/bin/rbw-rofi \
+      --replace rofi ${rofi}/bin/rofi \
+      --replace xclip ${xclip}/bin/xclip
   '' + lib.optionalString withPass ''
-    cp bin/pass-import $out/bin
+    install -Dm755 -t $out/bin bin/pass-import
+    substituteInPlace $out/bin/pass-import \
+      --replace pass ${pass}/bin/pass
   '';
 
   meta = with lib; {