diff --git a/pkgs/tools/text/mdcat/default.nix b/pkgs/tools/text/mdcat/default.nix index a928b74a1518..0361889157ca 100644 --- a/pkgs/tools/text/mdcat/default.nix +++ b/pkgs/tools/text/mdcat/default.nix @@ -13,20 +13,20 @@ rustPlatform.buildRustPackage rec { pname = "mdcat"; - version = "2.1.2"; + version = "2.3.0"; src = fetchFromGitHub { owner = "swsnr"; repo = "mdcat"; rev = "mdcat-${version}"; - hash = "sha256-qdNORp9THxHWR95uVcYtCy59OQqdop1012thZN5i64w="; + hash = "sha256-OgqWlWORLbohok9gJWiVUf0EdFP7Duk0Iw1PiSl4350="; }; nativeBuildInputs = [ pkg-config asciidoctor installShellFiles ]; buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security SystemConfiguration ]; - cargoHash = "sha256-/avxRvT35LxCBWkTYJDCtdd95VC67epZIPCMv994uBo="; + cargoHash = "sha256-jLKqJQ+T2KaS1bZ6MSQ6l/1iXvfLoyeI68WvO5smuwU="; nativeCheckInputs = [ ansi2html ]; # Skip tests that use the network and that include files. @@ -44,12 +44,12 @@ rustPlatform.buildRustPackage rec { postInstall = '' installManPage $releaseDir/build/mdcat-*/out/mdcat.1 ln -sr $out/bin/{mdcat,mdless} - + '' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' for bin in mdcat mdless; do - installShellCompletion \ - --bash $releaseDir/build/mdcat-*/out/completions/$bin.bash \ - --fish $releaseDir/build/mdcat-*/out/completions/$bin.fish \ - --zsh $releaseDir/build/mdcat-*/out/completions/_$bin + installShellCompletion --cmd $bin \ + --bash <($out/bin/$bin --completions bash) \ + --fish <($out/bin/$bin --completions fish) \ + --zsh <($out/bin/$bin --completions zsh) done '';