2020-10-15 19:49:26 +00:00
|
|
|
{ lib, fetchFromGitHub, installShellFiles, rustPlatform, rustfmt, xorg
|
2021-01-17 02:09:27 +00:00
|
|
|
, pkg-config, llvmPackages, clang, protobuf, python3 }:
|
2020-10-15 19:49:26 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "clipcat";
|
2021-02-08 13:14:19 +00:00
|
|
|
version = "0.5.0";
|
2020-10-15 19:49:26 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xrelkd";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-02-08 13:14:19 +00:00
|
|
|
sha256 = "0rxl3ksjinw07q3p2vjqg80k3c6wx2q7pzpf2344zyfb4gkqzx1c";
|
2020-10-15 19:49:26 +00:00
|
|
|
};
|
|
|
|
|
2021-05-07 11:00:49 +00:00
|
|
|
cargoSha256 = "1n4il3l59m2a6ca54vfaivzg25abf8s4w5kpd5q51p13624iz0kb";
|
2020-10-15 19:49:26 +00: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 08:23:57 +00:00
|
|
|
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
|
2020-10-15 19:49:26 +00:00
|
|
|
|
|
|
|
# needed for internal protobuf c wrapper library
|
|
|
|
PROTOC = "${protobuf}/bin/protoc";
|
|
|
|
PROTOC_INCLUDE = "${protobuf}/include";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-01-17 02:09:27 +00:00
|
|
|
pkg-config
|
2020-10-15 19:49:26 +00:00
|
|
|
|
|
|
|
clang
|
|
|
|
llvmPackages.libclang
|
|
|
|
|
|
|
|
rustfmt
|
|
|
|
protobuf
|
|
|
|
|
|
|
|
python3
|
|
|
|
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
buildInputs = [ xorg.libxcb ];
|
|
|
|
|
2021-11-15 23:48:05 +00:00
|
|
|
buildFeatures = [ "all" ];
|
2020-10-15 19:49:26 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2021-02-08 13:14:19 +00:00
|
|
|
installShellCompletion --bash completions/bash-completion/completions/*
|
|
|
|
installShellCompletion --fish completions/fish/completions/*
|
|
|
|
installShellCompletion --zsh completions/zsh/site-functions/*
|
2020-10-15 19:49:26 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Clipboard Manager written in Rust Programming Language";
|
2021-02-08 13:14:19 +00:00
|
|
|
homepage = "https://github.com/xrelkd/clipcat";
|
|
|
|
license = licenses.gpl3Only;
|
2020-10-15 19:49:26 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ xrelkd ];
|
|
|
|
};
|
|
|
|
}
|