Files
nixpkgs/pkgs/by-name/cl/clipcat/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

67 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
protobuf,
installShellFiles,
writableTmpDirAsHomeHook,
}:
rustPlatform.buildRustPackage rec {
pname = "clipcat";
version = "0.21.1";
src = fetchFromGitHub {
owner = "xrelkd";
repo = "clipcat";
tag = "v${version}";
hash = "sha256-MYWkUb9v8hnW6gUTpIcz0+jhlc8y3hZxsEQxRIZVVxI=";
};
cargoHash = "sha256-7ntsq6x/8QFaU6Hl4tk+Rtvc8ttcK9Mp00nlirNlUKY=";
patches = [
# Fix compilation errors caused by stricter restrictions on unused code in Rust 1.89.
# TODO: remove this patch after upstream fix it.
./dummy.patch
];
nativeBuildInputs = [
protobuf
installShellFiles
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# fix following error on darwin:
# objc/notify.h:1:9: fatal error: could not build module 'Cocoa'
writableTmpDirAsHomeHook
];
checkFlags = [
# Some test cases interact with X11, skip them
"--skip=test_x11_clipboard"
"--skip=test_x11_primary"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
for cmd in clipcatd clipcatctl clipcat-menu clipcat-notify; do
installShellCompletion --cmd $cmd \
--bash <($out/bin/$cmd completions bash) \
--fish <($out/bin/$cmd completions fish) \
--zsh <($out/bin/$cmd completions zsh)
done
'';
meta = {
description = "Clipboard Manager written in Rust Programming Language";
homepage = "https://github.com/xrelkd/clipcat";
license = lib.licenses.gpl3Only;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = with lib.maintainers; [
xrelkd
bot-wxt1221
];
mainProgram = "clipcatd";
};
}