2019-03-17 04:27:17 +01:00
|
|
|
{ stdenv, fetchFromGitLab, rustPlatform, cmake, pkgconfig, openssl
|
|
|
|
, darwin
|
2019-03-20 04:51:24 +01:00
|
|
|
|
2019-05-04 23:36:40 +02:00
|
|
|
, x11Support ? stdenv.isLinux || stdenv.hostPlatform.isBSD
|
2019-03-26 05:09:42 +01:00
|
|
|
, xclip ? null, xsel ? null
|
|
|
|
, preferXsel ? false # if true and xsel is non-null, use it instead of xclip
|
2019-03-17 04:27:17 +01:00
|
|
|
}:
|
|
|
|
|
2019-05-04 23:36:40 +02:00
|
|
|
let
|
|
|
|
usesX11 = stdenv.isLinux || stdenv.hostPlatform.isBSD;
|
|
|
|
in
|
|
|
|
|
|
|
|
assert (x11Support && usesX11) -> xclip != null || xsel != null;
|
2019-03-20 04:51:24 +01:00
|
|
|
|
2019-03-17 04:27:17 +01:00
|
|
|
with rustPlatform;
|
|
|
|
|
|
|
|
buildRustPackage rec {
|
2019-04-20 07:50:51 +02:00
|
|
|
pname = "ffsend";
|
2019-06-21 02:02:46 +02:00
|
|
|
version = "0.2.48";
|
2019-03-17 04:27:17 +01:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "timvisee";
|
|
|
|
repo = "ffsend";
|
|
|
|
rev = "v${version}";
|
2019-06-21 02:02:46 +02:00
|
|
|
sha256 = "0hs74z76yayv3hxcpcfb1bsyq6dclyri7q7siap98nxlv650896n";
|
2019-03-17 04:27:17 +01:00
|
|
|
};
|
|
|
|
|
2019-06-21 02:02:46 +02:00
|
|
|
cargoSha256 = "1hkdpzz2q2lqnq15gr1npipmbvdda637ylgkzn443bl09jd3j1q6";
|
2019-03-17 04:27:17 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkgconfig ];
|
|
|
|
buildInputs = [ openssl ]
|
|
|
|
++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices Security AppKit ])
|
|
|
|
;
|
|
|
|
|
2019-05-04 23:36:40 +02:00
|
|
|
preBuild = stdenv.lib.optionalString (x11Support && usesX11) (
|
2019-03-26 05:09:42 +01:00
|
|
|
if preferXsel && xsel != null then ''
|
|
|
|
export XSEL_PATH="${xsel}/bin/xsel"
|
|
|
|
'' else ''
|
|
|
|
export XCLIP_PATH="${xclip}/bin/xclip"
|
|
|
|
''
|
|
|
|
);
|
2019-03-20 04:51:24 +01:00
|
|
|
|
2019-03-17 04:27:17 +01:00
|
|
|
postInstall = ''
|
2019-03-20 04:51:24 +01:00
|
|
|
install -Dm644 contrib/completions/_ffsend "$out/share/zsh/site-functions/_ffsend"
|
|
|
|
install -Dm644 contrib/completions/ffsend.bash "$out/share/bash-completion/completions/ffsend.bash"
|
|
|
|
install -Dm644 contrib/completions/ffsend.fish "$out/share/fish/vendor_completions.d/ffsend.fish"
|
2019-03-17 04:27:17 +01:00
|
|
|
'';
|
2019-03-20 04:51:24 +01:00
|
|
|
# There's also .elv and .ps1 completion files but I don't know where to install those
|
2019-03-17 04:27:17 +01: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 ];
|
2019-05-04 23:36:40 +02:00
|
|
|
platforms = platforms.unix;
|
2019-03-17 04:27:17 +01:00
|
|
|
};
|
|
|
|
}
|