rclone: build with 'cmount' support (#117119)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
parent
b219457ac0
commit
de679c57ca
1 changed files with 10 additions and 3 deletions
|
@ -1,4 +1,7 @@
|
|||
{ lib, stdenv, buildGoModule, fetchFromGitHub, buildPackages, installShellFiles }:
|
||||
{ lib, stdenv, buildGoModule, fetchFromGitHub, buildPackages, installShellFiles
|
||||
, makeWrapper
|
||||
, enableCmount ? true, fuse, macfuse-stubs
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "rclone";
|
||||
|
@ -17,9 +20,11 @@ buildGoModule rec {
|
|||
|
||||
outputs = [ "out" "man" ];
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
buildInputs = lib.optional enableCmount (if stdenv.isDarwin then macfuse-stubs else fuse);
|
||||
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
||||
|
||||
buildFlagsArray = [ "-ldflags=-s -w -X github.com/rclone/rclone/fs.Version=${version}" ];
|
||||
buildFlagsArray = lib.optionals enableCmount [ "-tags=cmount" ]
|
||||
++ [ "-ldflags=-s -w -X github.com/rclone/rclone/fs.Version=${version}" ];
|
||||
|
||||
postInstall =
|
||||
let
|
||||
|
@ -34,6 +39,8 @@ buildGoModule rec {
|
|||
${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell
|
||||
installShellCompletion rclone.$shell
|
||||
done
|
||||
'' + lib.optionalString (enableCmount && !stdenv.isDarwin) ''
|
||||
wrapProgram $out/bin/rclone --prefix LD_LIBRARY_PATH : "${fuse}/lib"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
|
Loading…
Reference in a new issue