From fb6b402c3e6e09ba1f72ab2f2bb84e26f8693584 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Tue, 22 Oct 2024 18:46:46 +0800 Subject: [PATCH 1/2] clipcat: nixfmt --- pkgs/by-name/cl/clipcat/package.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/cl/clipcat/package.nix b/pkgs/by-name/cl/clipcat/package.nix index b5d22c8b5081..cbbf14013a59 100644 --- a/pkgs/by-name/cl/clipcat/package.nix +++ b/pkgs/by-name/cl/clipcat/package.nix @@ -1,10 +1,11 @@ -{ lib -, stdenv -, fetchFromGitHub -, rustPlatform -, protobuf -, installShellFiles -, darwin +{ + lib, + stdenv, + fetchFromGitHub, + rustPlatform, + protobuf, + installShellFiles, + darwin, }: rustPlatform.buildRustPackage rec { From 7fc412404a198fcca3df7bfc48e4acb48cd962c7 Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Tue, 22 Oct 2024 18:47:37 +0800 Subject: [PATCH 2/2] clipcat: fix build --- pkgs/by-name/cl/clipcat/0001-fix-build.patch | 50 ++++++++++++++++++++ pkgs/by-name/cl/clipcat/package.nix | 17 ++++--- 2 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 pkgs/by-name/cl/clipcat/0001-fix-build.patch diff --git a/pkgs/by-name/cl/clipcat/0001-fix-build.patch b/pkgs/by-name/cl/clipcat/0001-fix-build.patch new file mode 100644 index 000000000000..e92bb6c7a850 --- /dev/null +++ b/pkgs/by-name/cl/clipcat/0001-fix-build.patch @@ -0,0 +1,50 @@ +From 9ba11f90c4364529f220c44a3266926bf8f6a4b4 Mon Sep 17 00:00:00 2001 +From: wxt <3264117476@qq.com> +Date: Tue, 22 Oct 2024 18:43:20 +0800 +Subject: [PATCH] fix build + +--- + Cargo.toml | 1 - + crates/proto/build.rs | 1 - + crates/proto/src/lib.rs | 1 - + 3 files changed, 3 deletions(-) + +diff --git a/Cargo.toml b/Cargo.toml +index 8deae48..214a0e3 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -122,7 +122,6 @@ clipcat-server = { path = "./crates/server" } + + [workspace.lints.rust] + async_fn_in_trait = "allow" +-box_pointers = "allow" + + # TODO: deny `unused_crate_dependencies` after https://github.com/rust-lang/rust/issues/95513 being solved + unused_crate_dependencies = "allow" +diff --git a/crates/proto/build.rs b/crates/proto/build.rs +index 5e38f62..d6ba4be 100644 +--- a/crates/proto/build.rs ++++ b/crates/proto/build.rs +@@ -6,7 +6,6 @@ fn prost_config() -> Config { + config + } + +-#[allow(box_pointers)] + fn main() -> Result<(), Box> { + tonic_build::configure().compile_with_config( + prost_config(), +diff --git a/crates/proto/src/lib.rs b/crates/proto/src/lib.rs +index a7205ab..e4dcd02 100644 +--- a/crates/proto/src/lib.rs ++++ b/crates/proto/src/lib.rs +@@ -2,7 +2,6 @@ mod utils; + mod proto { + // SAFETY: allow: prost + #![allow( +- box_pointers, + unreachable_pub, + unused_qualifications, + unused_results, +-- +2.46.1 + diff --git a/pkgs/by-name/cl/clipcat/package.nix b/pkgs/by-name/cl/clipcat/package.nix index cbbf14013a59..f62b214f9de3 100644 --- a/pkgs/by-name/cl/clipcat/package.nix +++ b/pkgs/by-name/cl/clipcat/package.nix @@ -14,8 +14,8 @@ rustPlatform.buildRustPackage rec { src = fetchFromGitHub { owner = "xrelkd"; - repo = pname; - rev = "v${version}"; + repo = "clipcat"; + rev = "refs/tags/v${version}"; hash = "sha256-95y/HiLmhqt1DFmAxLg/W7lr/9dfVtce4+tx+vG2Nuw="; }; @@ -29,10 +29,13 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ protobuf - installShellFiles ]; + patches = [ + ./0001-fix-build.patch + ]; + checkFlags = [ # Some test cases interact with X11, skip them "--skip=test_x11_clipboard" @@ -48,12 +51,12 @@ rustPlatform.buildRustPackage rec { done ''; - meta = with lib; { + meta = { description = "Clipboard Manager written in Rust Programming Language"; homepage = "https://github.com/xrelkd/clipcat"; - license = licenses.gpl3Only; - platforms = platforms.linux ++ platforms.darwin; - maintainers = with maintainers; [ xrelkd ]; + license = lib.licenses.gpl3Only; + platforms = lib.platforms.linux ++ lib.platforms.darwin; + maintainers = with lib.maintainers; [ xrelkd bot-wxt1221 ]; mainProgram = "clipcatd"; }; }