nixpkgs/pkgs/tools/misc/ffsend/default.nix

62 lines
2.0 KiB
Nix
Raw Normal View History

2019-03-17 03:27:17 +00:00
{ stdenv, fetchFromGitLab, rustPlatform, cmake, pkgconfig, openssl
2019-09-08 22:58:15 +01:00
, darwin, installShellFiles
, x11Support ? stdenv.isLinux || stdenv.hostPlatform.isBSD
, xclip ? null, xsel ? null
, preferXsel ? false # if true and xsel is non-null, use it instead of xclip
2019-03-17 03:27:17 +00:00
}:
let
usesX11 = stdenv.isLinux || stdenv.hostPlatform.isBSD;
in
assert (x11Support && usesX11) -> xclip != null || xsel != null;
2019-03-17 03:27:17 +00:00
with rustPlatform;
buildRustPackage rec {
2019-04-20 06:50:51 +01:00
pname = "ffsend";
2019-08-29 23:09:36 +01:00
version = "0.2.51";
2019-03-17 03:27:17 +00:00
src = fetchFromGitLab {
owner = "timvisee";
repo = "ffsend";
rev = "v${version}";
2019-08-29 23:09:36 +01:00
sha256 = "1ckzgzbv2fh5y7c5r0b9n6y2migmsrnlwdg7dybr0c82s39swr7f";
2019-03-17 03:27:17 +00:00
};
2019-08-29 23:09:36 +01:00
cargoSha256 = "1x4hxar60lwimldpsi0frdlssgsb72qahn3dmb980sj6cmbq3f0b";
2019-03-17 03:27:17 +00:00
2019-09-08 22:58:15 +01:00
nativeBuildInputs = [ cmake pkgconfig installShellFiles ];
2019-03-17 03:27:17 +00:00
buildInputs = [ openssl ]
++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices Security AppKit ])
;
preBuild = stdenv.lib.optionalString (x11Support && usesX11) (
if preferXsel && xsel != null then ''
export XSEL_PATH="${xsel}/bin/xsel"
'' else ''
export XCLIP_PATH="${xclip}/bin/xclip"
''
);
2019-03-17 03:27:17 +00:00
postInstall = ''
2019-09-08 22:58:15 +01:00
installShellCompletion contrib/completions/ffsend.{bash,fish} --zsh contrib/completions/_ffsend
2019-03-17 03:27:17 +00:00
'';
# There's also .elv and .ps1 completion files but I don't know where to install those
2019-03-17 03:27:17 +00:00
meta = with stdenv.lib; {
description = "Easily and securely share files from the command line. A fully featured Firefox Send client";
longDescription = ''
Easily and securely share files and directories from the command line through a safe, private
and encrypted link using a single simple command. Files are shared using the Send service and
may be up to 2GB. Others are able to download these files with this tool, or through their
web browser.
'';
homepage = https://gitlab.com/timvisee/ffsend;
license = licenses.gpl3;
maintainers = [ maintainers.lilyball ];
platforms = platforms.unix;
2019-03-17 03:27:17 +00:00
};
}