about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/wl/wl-clipboard-rs/package.nix
blob: 4fab6ae6574eba6134237f91e79c86b4262560dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, wayland
, withNativeLibs ? false
}:

rustPlatform.buildRustPackage {
  pname = "wl-clipboard-rs";
  version = "0.8.0-unstable-2023-11-27";

  src = fetchFromGitHub {
    owner = "YaLTeR";
    repo = "wl-clipboard-rs";
    rev = "be851408e0f91edffdc2f1a76805035847f9f8a9";
    hash = "sha256-OfLn7izG1KSUjdd2gO4aaSCDlcaWoFiFmgwwhR1hRsQ=";
  };

  cargoHash = "sha256-rYFCPyWTUhyrEcoRM8I+iX7IaY/6i1tBVjhs47m3XY8=";

  cargoBuildFlags = [
    "--package=wl-clipboard-rs"
    "--package=wl-clipboard-rs-tools"
  ] ++ lib.optionals withNativeLibs [
    "--features=native_lib"
  ];

  nativeBuildInputs = lib.optionals withNativeLibs [
    pkg-config
  ];

  buildInputs = lib.optionals withNativeLibs [
    wayland
  ];

  preCheck = ''
    export XDG_RUNTIME_DIR=$(mktemp -d)
  '';

  # Assertion errors
  checkFlags = [
    "--skip=tests::copy::copy_large"
    "--skip=tests::copy::copy_multi_no_additional_text_mime_types_test"
    "--skip=tests::copy::copy_multi_test"
    "--skip=tests::copy::copy_randomized"
    "--skip=tests::copy::copy_test"
  ];

  meta = {
    description = "Command-line copy/paste utilities for Wayland, written in Rust";
    homepage = "https://github.com/YaLTeR/wl-clipboard-rs";
    # TODO: add `${version}` once we switch to tagged release
    changelog = "https://github.com/YaLTeR/wl-clipboard-rs/blob/master/CHANGELOG.md";
    platforms = lib.platforms.linux;
    license = with lib.licenses; [ asl20 mit ];
    mainProgram = "wl-clip";
    maintainers = with lib.maintainers; [ thiagokokada ];
  };
}