about summary refs log tree commit diff
path: root/pkgs/by-name/op/openpgp-card-tools/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/op/openpgp-card-tools/package.nix')
-rw-r--r--pkgs/by-name/op/openpgp-card-tools/package.nix19
1 files changed, 14 insertions, 5 deletions
diff --git a/pkgs/by-name/op/openpgp-card-tools/package.nix b/pkgs/by-name/op/openpgp-card-tools/package.nix
index 00a4be3e9ece..08f64ba4547a 100644
--- a/pkgs/by-name/op/openpgp-card-tools/package.nix
+++ b/pkgs/by-name/op/openpgp-card-tools/package.nix
@@ -2,8 +2,10 @@
 , stdenv
 , rustPlatform
 , fetchFromGitea
+, installShellFiles
 , pkg-config
 , pcsclite
+, dbus
 , testers
 , openpgp-card-tools
 , darwin
@@ -11,21 +13,21 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "openpgp-card-tools";
-  version = "0.11.3";
+  version = "0.11.7";
 
   src = fetchFromGitea {
     domain = "codeberg.org";
     owner = "openpgp-card";
     repo = "openpgp-card-tools";
     rev = "v${version}";
-    hash = "sha256-htFhNzBuinj9qiTzcW0eia74jvCT/+9b1aLli594JJQ=";
+    hash = "sha256-sR+jBCSuDH4YdJz3YuvA4EE36RHV3m/xU8hIEXXsqKo=";
   };
 
-  cargoHash = "sha256-I2ExtUUM0ZJyhtyzP+IsgiMPMUFVHqPiMHFlvuUMjRc=";
+  cargoHash = "sha256-G5+lVK41hbzy/Ltc0EKoUfqF0M1OYu679jyVjYKJmn0=";
 
-  nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook ];
+  nativeBuildInputs = [ installShellFiles pkg-config rustPlatform.bindgenHook ];
 
-  buildInputs = [ pcsclite ] ++ lib.optionals stdenv.isDarwin [
+  buildInputs = [ pcsclite dbus ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
     darwin.apple_sdk.frameworks.PCSC
     darwin.apple_sdk.frameworks.Security
   ];
@@ -36,6 +38,13 @@ rustPlatform.buildRustPackage rec {
     };
   };
 
+  postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
+    OCT_COMPLETION_OUTPUT_DIR=$PWD/shell $out/bin/oct
+    installShellCompletion ./shell/oct.{bash,fish} ./shell/_oct
+    OCT_MANPAGE_OUTPUT_DIR=$PWD/man $out/bin/oct
+    installManPage ./man/*.1
+  '';
+
   meta = with lib; {
     description = "Tool for inspecting and configuring OpenPGP cards";
     homepage = "https://codeberg.org/openpgp-card/openpgp-card-tools";