Merge pull request #57941 from lilyball/ffsend

ffsend: 0.2.36 -> 0.2.38
This commit is contained in:
Vladyslav M 2019-03-21 23:18:38 +02:00 committed by GitHub
commit 059349e71d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,38 +1,42 @@
{ stdenv, fetchFromGitLab, rustPlatform, cmake, pkgconfig, openssl { stdenv, fetchFromGitLab, rustPlatform, cmake, pkgconfig, openssl
, darwin , darwin
, x11Support ? stdenv.isLinux
, xclip ? null
}: }:
assert x11Support -> xclip != null;
with rustPlatform; with rustPlatform;
buildRustPackage rec { buildRustPackage rec {
name = "ffsend-${version}"; name = "ffsend-${version}";
version = "0.2.36"; version = "0.2.38";
src = fetchFromGitLab { src = fetchFromGitLab {
owner = "timvisee"; owner = "timvisee";
repo = "ffsend"; repo = "ffsend";
rev = "v${version}"; rev = "v${version}";
sha256 = "0k2sl1f5isxj8qajmhf36xh6k9j9qq7nkqm27wfm3gvc6b4flk0r"; sha256 = "1kxxcqyilbhzcsnddlf7ha3dd57qj82yvbb9jsssimnlcskx84hx";
}; };
cargoSha256 = "1l4060kawba56gxsngba2yjshhaygrs17k1msjbj38vrg07zrnbp"; cargoSha256 = "1qxvm2pz01na6nijdn0hlv5hxshiz3pfy6km7n9hjyakwi684a0l";
# Note: On Linux, the clipboard feature requires `xclip` to be in the `PATH`. Ideally we'd
# depend on `xclip` and patch the source to run `xclip` from the Nix store instead of from `PATH`.
# However, as I use macOS and not Linux, I'm not inclined to maintain a patch like that, nor do I
# have a means to test it. To that end, we'll just leave the clipboard feature enabled and
# trust that users that want to copy links to their clipboard will install `xclip` into their
# profile.
nativeBuildInputs = [ cmake pkgconfig ]; nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [ openssl ] buildInputs = [ openssl ]
++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices Security AppKit ]) ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices Security AppKit ])
; ;
preBuild = if x11Support then ''
export XCLIP_PATH="${xclip}/bin/xclip"
'' else null;
postInstall = '' postInstall = ''
mkdir -p $out/share/zsh/site-functions install -Dm644 contrib/completions/_ffsend "$out/share/zsh/site-functions/_ffsend"
cp contrib/completions/zsh/_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"
''; '';
# There's also .elv and .ps1 completion files but I don't know where to install those
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Easily and securely share files from the command line. A fully featured Firefox Send client"; description = "Easily and securely share files from the command line. A fully featured Firefox Send client";