wl-clipboard-rs: add man pages and shell completions

This commit is contained in:
yellowhat 2024-11-26 10:56:40 +00:00 committed by GitHub
parent 2c4fbc0313
commit e01c3b9ff3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,7 @@
{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
, pkg-config
, wayland
, withNativeLibs ? false
@ -26,11 +27,15 @@ rustPlatform.buildRustPackage rec {
"--features=native_lib"
];
nativeBuildInputs = lib.optionals withNativeLibs [
nativeBuildInputs = [
installShellFiles
] ++ lib.optionals withNativeLibs [
pkg-config
];
buildInputs = lib.optionals withNativeLibs [
buildInputs = [
installShellFiles
]++ lib.optionals withNativeLibs [
wayland
];
@ -47,6 +52,21 @@ rustPlatform.buildRustPackage rec {
"--skip=tests::copy::copy_test"
];
postInstall = ''
installManPage target/man/wl-copy.1
installManPage target/man/wl-paste.1
installShellCompletion --cmd wl-copy \
--bash target/completions/wl-copy.bash \
--fish target/completions/wl-copy.fish \
--zsh target/completions/_wl-copy
installShellCompletion --cmd wl-paste \
--bash target/completions/wl-paste.bash \
--fish target/completions/wl-paste.fish \
--zsh target/completions/_wl-paste
'';
meta = with lib; {
description = "Command-line copy/paste utilities for Wayland, written in Rust";
homepage = "https://github.com/YaLTeR/wl-clipboard-rs";