2020-10-15 21:49:26 +02:00
|
|
|
{ lib, fetchFromGitHub, installShellFiles, rustPlatform, rustfmt, xorg
|
2021-01-17 03:09:27 +01:00
|
|
|
, pkg-config, llvmPackages, clang, protobuf, python3 }:
|
2020-10-15 21:49:26 +02:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "clipcat";
|
2021-02-08 14:14:19 +01:00
|
|
|
version = "0.5.0";
|
2020-10-15 21:49:26 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xrelkd";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-02-08 14:14:19 +01:00
|
|
|
sha256 = "0rxl3ksjinw07q3p2vjqg80k3c6wx2q7pzpf2344zyfb4gkqzx1c";
|
2020-10-15 21:49:26 +02:00
|
|
|
};
|
|
|
|
|
2021-02-08 14:14:19 +01:00
|
|
|
cargoSha256 = "1ffgvhkdj8wkhlgi0cj0njdm9ycxq2qda4b5qn8bmaygzr2zkwpd";
|
2020-10-15 21:49:26 +02:00
|
|
|
|
llvmPackages: Multuple outputs for everythting
Also begin to start work on cross compilation, though that will have to
be finished later.
The patches are based on the first version of
https://reviews.llvm.org/D99484. It's very annoying to do the
back-porting but the review has uncovered nothing super major so I'm
fine sticking with what I've got.
Beyond making the outputs work, I also strove to re-sync the packages,
as they have been drifting pointlessly apart for some time.
----
Other misc notes, highly incomplete
- lvm-config-native and llvm-config are put in `dev` because they are
tools just for build time.
- Clang no longer has an lld dep. That was introduced in
db29857eb391ed002046090851a44c452b80bdbd, but if clang needs help
finding lld when it is used we should just pass it flags / put in the
resource dir. Providing it at build time increases critical path
length for no good reason.
----
A note on `nativeCC`:
`stdenv` takes tools from the previous stage, so:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)`
while:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)`
3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
2020-10-15 10:23:57 +02:00
|
|
|
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
2020-10-15 21:49:26 +02:00
|
|
|
|
|
|
|
# needed for internal protobuf c wrapper library
|
|
|
|
PROTOC = "${protobuf}/bin/protoc";
|
|
|
|
PROTOC_INCLUDE = "${protobuf}/include";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-01-17 03:09:27 +01:00
|
|
|
pkg-config
|
2020-10-15 21:49:26 +02:00
|
|
|
|
|
|
|
clang
|
|
|
|
llvmPackages.libclang
|
|
|
|
|
|
|
|
rustfmt
|
|
|
|
protobuf
|
|
|
|
|
|
|
|
python3
|
|
|
|
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
buildInputs = [ xorg.libxcb ];
|
|
|
|
|
|
|
|
cargoBuildFlags = [ "--features=all" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
2021-02-08 14:14:19 +01:00
|
|
|
installShellCompletion --bash completions/bash-completion/completions/*
|
|
|
|
installShellCompletion --fish completions/fish/completions/*
|
|
|
|
installShellCompletion --zsh completions/zsh/site-functions/*
|
2020-10-15 21:49:26 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Clipboard Manager written in Rust Programming Language";
|
2021-02-08 14:14:19 +01:00
|
|
|
homepage = "https://github.com/xrelkd/clipcat";
|
|
|
|
license = licenses.gpl3Only;
|
2020-10-15 21:49:26 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ xrelkd ];
|
|
|
|
};
|
|
|
|
}
|