diff --git a/pkgs/by-name/cl/clipcat/dummy.patch b/pkgs/by-name/cl/clipcat/dummy.patch new file mode 100644 index 000000000000..4fdc3d60526a --- /dev/null +++ b/pkgs/by-name/cl/clipcat/dummy.patch @@ -0,0 +1,14 @@ +diff --git a/crates/server/src/notification/dummy.rs b/crates/server/src/notification/dummy.rs +index f85dda0..7489f22 100644 +--- a/crates/server/src/notification/dummy.rs ++++ b/crates/server/src/notification/dummy.rs +@@ -1,6 +1,9 @@ ++#[cfg(test)] + use crate::notification::traits; + ++#[cfg(test)] + #[derive(Clone, Copy, Debug, Default)] + pub struct Notification {} + ++#[cfg(test)] + impl traits::Notification for Notification {} diff --git a/pkgs/by-name/cl/clipcat/package.nix b/pkgs/by-name/cl/clipcat/package.nix index 56e2e87e051f..2b674db07e8f 100644 --- a/pkgs/by-name/cl/clipcat/package.nix +++ b/pkgs/by-name/cl/clipcat/package.nix @@ -5,6 +5,7 @@ rustPlatform, protobuf, installShellFiles, + writableTmpDirAsHomeHook, }: rustPlatform.buildRustPackage rec { @@ -20,9 +21,20 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-UA+NTtZ2qffUPUmvCidnTHwFzD3WOPTlxHR2e2vKwPQ="; + 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 = [