git.iko.soy/typeable/nixpkgs
on master help sign in
rclone: build with 'cmount' support (#117119)
de679c5midchildan
pkgs/applications/networking/sync/rclone/default.nix+10−3
@@ -1,4 +1,7 @@
1−{ lib, stdenv, buildGoModule, fetchFromGitHub, buildPackages, installShellFiles }:
1+{ lib, stdenv, buildGoModule, fetchFromGitHub, buildPackages, installShellFiles
2+, makeWrapper
3+, enableCmount ? true, fuse, macfuse-stubs
4+}:
2
5
3buildGoModule rec {
6buildGoModule rec {
4 pname = "rclone";
7 pname = "rclone";
@@ -17,9 +20,11 @@ buildGoModule rec {
17
20
18 outputs = [ "out" "man" ];
21 outputs = [ "out" "man" ];
19
22
23+ buildInputs = lib.optional enableCmount (if stdenv.isDarwin then macfuse-stubs else fuse);
20− nativeBuildInputs = [ installShellFiles ];
24+ nativeBuildInputs = [ installShellFiles makeWrapper ];
21
25
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}" ];
23
28
24 postInstall =
29 postInstall =
25 let
30 let
@@ -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
36 done
41 done
42+ '' + lib.optionalString (enableCmount && !stdenv.isDarwin) ''
43+ wrapProgram $out/bin/rclone --prefix LD_LIBRARY_PATH : "${fuse}/lib"
37 '';
44 '';
38
45
39 meta = with lib; {
46 meta = with lib; {