about summary refs log tree commit diff
path: root/pkgs/tools/misc/ffsend
diff options
context:
space:
mode:
authorLily Ballard <lily@sb.org>2019-03-19 20:51:24 -0700
committerLily Ballard <lily@sb.org>2019-03-19 20:59:55 -0700
commit59fdbac729bbf9477ca3d655b6d4f7920da25af0 (patch)
tree52437309a381560b235219553ef5aaf0c6589db6 /pkgs/tools/misc/ffsend
parente6ccb67e23bce78e152ddcd9a85b6a44651e276f (diff)
ffsend: 0.2.36 -> 0.2.38
Also add support for xclip on Linux.
Diffstat (limited to 'pkgs/tools/misc/ffsend')
-rw-r--r--pkgs/tools/misc/ffsend/default.nix28
1 files changed, 16 insertions, 12 deletions
diff --git a/pkgs/tools/misc/ffsend/default.nix b/pkgs/tools/misc/ffsend/default.nix
index dba608f41af9e..326192ff5bd1f 100644
--- a/pkgs/tools/misc/ffsend/default.nix
+++ b/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";