@@ -1,4 +1,7 @@
1−{ lib, stdenv, buildGoModule, fetchFromGitHub, buildPackages, installShellFiles }:
1+{ lib, stdenv, buildGoModule, fetchFromGitHub, buildPackages, installShellFiles
3+, enableCmount ? true, fuse, macfuse-stubs
3buildGoModule rec {
6buildGoModule rec {
4 pname = "rclone";
7 pname = "rclone";
@@ -17,9 +20,11 @@ buildGoModule rec {
18 outputs = [ "out" "man" ];
21 outputs = [ "out" "man" ];
23+ buildInputs = lib.optional enableCmount (if stdenv.isDarwin then macfuse-stubs else fuse);
20− nativeBuildInputs = [ installShellFiles ];
24+ nativeBuildInputs = [ installShellFiles makeWrapper ];
26+ buildFlagsArray = lib.optionals enableCmount [ "-tags=cmount" ]
22− buildFlagsArray = [ "-ldflags=-s -w -X github.com/rclone/rclone/fs.Version=${version}" ];
27+ ++ [ "-ldflags=-s -w -X github.com/rclone/rclone/fs.Version=${version}" ];
24 postInstall =
29 postInstall =
@@ -34,6 +39,8 @@ buildGoModule rec {
34 ${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell
39 ${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell
35 installShellCompletion rclone.$shell
40 installShellCompletion rclone.$shell
42+ '' + lib.optionalString (enableCmount && !stdenv.isDarwin) ''
43+ wrapProgram $out/bin/rclone --prefix LD_LIBRARY_PATH : "${fuse}/lib"
39 meta = with lib; {
46 meta = with lib; {