Skip to content

Commit

Permalink
Merge pull request #57941 from lilyball/ffsend
Browse files Browse the repository at this point in the history
ffsend: 0.2.36 -> 0.2.38
  • Loading branch information
dywedir committed Mar 21, 2019
2 parents ec7a34c + 59fdbac commit 059349e
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions pkgs/tools/misc/ffsend/default.nix
@@ -1,38 +1,42 @@
{ stdenv, fetchFromGitLab, rustPlatform, cmake, pkgconfig, openssl
, darwin

, x11Support ? stdenv.isLinux
, xclip ? null
}:

assert x11Support -> xclip != null;

with rustPlatform;

buildRustPackage rec {
name = "ffsend-${version}";
version = "0.2.36";
version = "0.2.38";

src = fetchFromGitLab {
owner = "timvisee";
repo = "ffsend";
rev = "v${version}";
sha256 = "0k2sl1f5isxj8qajmhf36xh6k9j9qq7nkqm27wfm3gvc6b4flk0r";
sha256 = "1kxxcqyilbhzcsnddlf7ha3dd57qj82yvbb9jsssimnlcskx84hx";
};

cargoSha256 = "1l4060kawba56gxsngba2yjshhaygrs17k1msjbj38vrg07zrnbp";

# 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.
cargoSha256 = "1qxvm2pz01na6nijdn0hlv5hxshiz3pfy6km7n9hjyakwi684a0l";

nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [ openssl ]
++ 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 = ''
mkdir -p $out/share/zsh/site-functions
cp contrib/completions/zsh/_ffsend $out/share/zsh/site-functions/_ffsend
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"
'';
# There's also .elv and .ps1 completion files but I don't know where to install those

meta = with stdenv.lib; {
description = "Easily and securely share files from the command line. A fully featured Firefox Send client";
Expand Down

0 comments on commit 059349e

Please sign in to comment.