1{ lib, fetchFromGitHub, installShellFiles, rustPlatform, rustfmt, xorg
2, pkg-config, llvmPackages, clang, protobuf, python3 }:
3
4rustPlatform.buildRustPackage rec {
5 pname = "clipcat";
6 version = "0.5.0";
7
8 src = fetchFromGitHub {
9 owner = "xrelkd";
10 repo = pname;
11 rev = "v${version}";
12 sha256 = "0rxl3ksjinw07q3p2vjqg80k3c6wx2q7pzpf2344zyfb4gkqzx1c";
13 };
14
15 cargoLock = {
16 lockFile = ./Cargo.lock;
17 outputHashes = {
18 "x11-clipboard-0.6.0" = "sha256-dKx2kda5JC79juksP2qiO9yfeFCWymcYhGPSygQ0mrg=";
19 };
20 };
21
22 # needed for internal protobuf c wrapper library
23 PROTOC = "${protobuf}/bin/protoc";
24 PROTOC_INCLUDE = "${protobuf}/include";
25
26 nativeBuildInputs = [
27 pkg-config
28
29 rustPlatform.bindgenHook
30
31 rustfmt
32 protobuf
33
34 python3
35
36 installShellFiles
37 ];
38 buildInputs = [ xorg.libxcb ];
39
40 buildFeatures = [ "all" ];
41
42 postInstall = ''
43 installShellCompletion --bash completions/bash-completion/completions/*
44 installShellCompletion --fish completions/fish/completions/*
45 installShellCompletion --zsh completions/zsh/site-functions/*
46 '';
47
48 meta = with lib; {
49 description = "Clipboard Manager written in Rust Programming Language";
50 homepage = "https://github.com/xrelkd/clipcat";
51 license = licenses.gpl3Only;
52 platforms = platforms.linux;
53 maintainers = with maintainers; [ xrelkd ];
54 };
55}