2021-01-17 03:51:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitLab, rustPlatform, cmake, pkg-config, openssl
|
2021-04-26 10:42:59 +01:00
|
|
|
, installShellFiles
|
|
|
|
, CoreFoundation, CoreServices, Security, AppKit, libiconv
|
2019-03-20 03:51:24 +00:00
|
|
|
|
2019-05-04 22:36:40 +01:00
|
|
|
, x11Support ? stdenv.isLinux || stdenv.hostPlatform.isBSD
|
2019-03-26 04:09:42 +00:00
|
|
|
, 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
|
|
|
}:
|
|
|
|
|
2019-05-04 22:36:40 +01:00
|
|
|
let
|
2021-04-18 21:12:09 +01:00
|
|
|
usesX11 = stdenv.isLinux || stdenv.isBSD;
|
2019-05-04 22:36:40 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
assert (x11Support && usesX11) -> xclip != null || xsel != null;
|
2019-03-20 03:51:24 +00:00
|
|
|
|
2019-03-17 03:27:17 +00:00
|
|
|
with rustPlatform;
|
|
|
|
|
|
|
|
buildRustPackage rec {
|
2019-04-20 06:50:51 +01:00
|
|
|
pname = "ffsend";
|
2021-10-27 17:34:57 +01:00
|
|
|
version = "0.2.74";
|
2019-03-17 03:27:17 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "timvisee";
|
|
|
|
repo = "ffsend";
|
|
|
|
rev = "v${version}";
|
2021-10-27 17:34:57 +01:00
|
|
|
sha256 = "0ia9agh0h9hp06ijmlgnw63n3xz2jajjw1maz27sawqp342x9vn5";
|
2019-03-17 03:27:17 +00:00
|
|
|
};
|
|
|
|
|
2021-10-27 17:34:57 +01:00
|
|
|
cargoSha256 = "0dl671sw3amny52a81bx7imh94dvi91dprwhcm1b0g40mjic45pw";
|
2019-03-17 03:27:17 +00:00
|
|
|
|
2021-01-17 03:51:22 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config installShellFiles ];
|
2020-05-21 00:17:59 +01:00
|
|
|
buildInputs =
|
2021-04-26 10:42:59 +01:00
|
|
|
if stdenv.isDarwin then [ libiconv CoreFoundation CoreServices Security AppKit ]
|
2020-05-21 00:17:59 +01:00
|
|
|
else [ openssl ];
|
2019-03-17 03:27:17 +00:00
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
preBuild = lib.optionalString (x11Support && usesX11) (
|
2019-03-26 04:09:42 +00:00
|
|
|
if preferXsel && xsel != null then ''
|
|
|
|
export XSEL_PATH="${xsel}/bin/xsel"
|
|
|
|
'' else ''
|
|
|
|
export XCLIP_PATH="${xclip}/bin/xclip"
|
|
|
|
''
|
|
|
|
);
|
2019-03-20 03:51:24 +00:00
|
|
|
|
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
|
|
|
'';
|
2019-03-20 03:51:24 +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
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-03-17 03:27:17 +00:00
|
|
|
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.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://gitlab.com/timvisee/ffsend";
|
2021-04-23 10:56:44 +01:00
|
|
|
license = licenses.gpl3Only;
|
2019-12-06 06:55:16 +00:00
|
|
|
maintainers = with maintainers; [ lilyball equirosa ];
|
2019-05-04 22:36:40 +01:00
|
|
|
platforms = platforms.unix;
|
2019-03-17 03:27:17 +00:00
|
|
|
};
|
|
|
|
}
|