gnomeExtensions.pop-shell: 1.2.0-unstable-2024-10-09 -> 1.2.0-unstable-2024-12-31...
[NixPkgs.git] / pkgs / by-name / wl / wl-clipboard-rs / package.nix
blobe11744ea8c32d485ded94e431358d83bc9650c16
2   lib,
3   rustPlatform,
4   fetchFromGitHub,
5   installShellFiles,
6   pkg-config,
7   wayland,
8   withNativeLibs ? false,
9 }:
11 rustPlatform.buildRustPackage rec {
12   pname = "wl-clipboard-rs";
13   version = "0.9.1";
15   src = fetchFromGitHub {
16     owner = "YaLTeR";
17     repo = "wl-clipboard-rs";
18     rev = "v${version}";
19     hash = "sha256-jGTWcVR6atkEeEUunystJ4B6I3GzYiCOMs0MC6pvPfI=";
20   };
22   cargoHash = "sha256-P0WLYHNLN8ZqoDRszsgfQTiWeVpfBpFHiEWpQMBjNJM=";
24   cargoBuildFlags =
25     [
26       "--package=wl-clipboard-rs"
27       "--package=wl-clipboard-rs-tools"
28     ]
29     ++ lib.optionals withNativeLibs [
30       "--features=native_lib"
31     ];
33   nativeBuildInputs =
34     [
35       installShellFiles
36     ]
37     ++ lib.optionals withNativeLibs [
38       pkg-config
39     ];
41   buildInputs =
42     [
43       installShellFiles
44     ]
45     ++ lib.optionals withNativeLibs [
46       wayland
47     ];
49   preCheck = ''
50     export XDG_RUNTIME_DIR=$(mktemp -d)
51   '';
53   # Assertion errors
54   checkFlags = [
55     "--skip=tests::copy::copy_large"
56     "--skip=tests::copy::copy_multi_no_additional_text_mime_types_test"
57     "--skip=tests::copy::copy_multi_test"
58     "--skip=tests::copy::copy_randomized"
59     "--skip=tests::copy::copy_test"
60   ];
62   postInstall = ''
63     installManPage target/man/wl-copy.1
64     installManPage target/man/wl-paste.1
66     installShellCompletion --cmd wl-copy \
67       --bash target/completions/wl-copy.bash \
68       --fish target/completions/wl-copy.fish \
69       --zsh target/completions/_wl-copy
71     installShellCompletion --cmd wl-paste \
72       --bash target/completions/wl-paste.bash \
73       --fish target/completions/wl-paste.fish \
74       --zsh target/completions/_wl-paste
75   '';
77   meta = with lib; {
78     description = "Command-line copy/paste utilities for Wayland, written in Rust";
79     homepage = "https://github.com/YaLTeR/wl-clipboard-rs";
80     changelog = "https://github.com/YaLTeR/wl-clipboard-rs/blob/v${version}/CHANGELOG.md";
81     platforms = platforms.linux;
82     license = with licenses; [
83       asl20
84       mit
85     ];
86     mainProgram = "wl-clip";
87     maintainers = with maintainers; [
88       thiagokokada
89       donovanglover
90     ];
91   };