2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitLab, rustPlatform, cmake, pkg-config, openssl
|
2021-05-03 20:48:10 +00:00
|
|
|
, installShellFiles
|
|
|
|
, CoreFoundation, CoreServices, Security, AppKit, libiconv
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
, x11Support ? stdenv.isLinux || stdenv.hostPlatform.isBSD
|
|
|
|
, xclip ? null, xsel ? null
|
|
|
|
, preferXsel ? false # if true and xsel is non-null, use it instead of xclip
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-04-22 02:08:21 +00:00
|
|
|
usesX11 = stdenv.isLinux || stdenv.isBSD;
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
assert (x11Support && usesX11) -> xclip != null || xsel != null;
|
|
|
|
|
|
|
|
with rustPlatform;
|
|
|
|
|
|
|
|
buildRustPackage rec {
|
|
|
|
pname = "ffsend";
|
2021-04-25 03:57:28 +00:00
|
|
|
version = "0.2.71";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "timvisee";
|
|
|
|
repo = "ffsend";
|
|
|
|
rev = "v${version}";
|
2021-04-25 03:57:28 +00:00
|
|
|
sha256 = "sha256-dXFnM8085XVzUwk1e3SoO+O+z9lJ40htJzHBGRQ95XY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-04-25 03:57:28 +00:00
|
|
|
cargoSha256 = "sha256-VwxIH/n1DjZsMOLAREclqanb4q7QEOZ35KWWciyrnyQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config installShellFiles ];
|
2020-05-29 06:06:01 +00:00
|
|
|
buildInputs =
|
2021-05-03 20:48:10 +00:00
|
|
|
if stdenv.isDarwin then [ libiconv CoreFoundation CoreServices Security AppKit ]
|
2020-05-29 06:06:01 +00:00
|
|
|
else [ openssl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
preBuild = lib.optionalString (x11Support && usesX11) (
|
2020-04-24 23:36:52 +00:00
|
|
|
if preferXsel && xsel != null then ''
|
|
|
|
export XSEL_PATH="${xsel}/bin/xsel"
|
|
|
|
'' else ''
|
|
|
|
export XCLIP_PATH="${xclip}/bin/xclip"
|
|
|
|
''
|
|
|
|
);
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion contrib/completions/ffsend.{bash,fish} --zsh contrib/completions/_ffsend
|
|
|
|
'';
|
|
|
|
# There's also .elv and .ps1 completion files but I don't know where to install those
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +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.
|
|
|
|
'';
|
|
|
|
homepage = "https://gitlab.com/timvisee/ffsend";
|
2021-04-25 03:57:28 +00:00
|
|
|
license = licenses.gpl3Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ lilyball equirosa ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|