2021-04-07 09:41:35 +01:00
|
|
|
{ lib, stdenv, buildGoModule, fetchFromGitHub, buildPackages, installShellFiles
|
|
|
|
, makeWrapper
|
|
|
|
, enableCmount ? true, fuse, macfuse-stubs
|
|
|
|
}:
|
2016-06-30 05:47:43 +01:00
|
|
|
|
2020-09-02 22:21:21 +01:00
|
|
|
buildGoModule rec {
|
2019-02-23 00:35:27 +00:00
|
|
|
pname = "rclone";
|
2021-07-22 05:20:00 +01:00
|
|
|
version = "1.56.0";
|
2016-06-30 05:47:43 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-08-27 12:35:54 +01:00
|
|
|
owner = pname;
|
2019-04-14 03:08:10 +01:00
|
|
|
repo = pname;
|
2016-06-30 05:47:43 +01:00
|
|
|
rev = "v${version}";
|
2021-07-22 05:20:00 +01:00
|
|
|
sha256 = "03fqwsbpwb8vmgxg6knkp8f4xlvgg88n2c7inwjg8x91c7c77i0b";
|
2016-06-30 05:47:43 +01:00
|
|
|
};
|
|
|
|
|
2021-07-22 05:20:00 +01:00
|
|
|
vendorSha256 = "1gryisn63f6ss889s162ncvlsaznwgvgxdwk2pn5c5zw8dkmjdmi";
|
2019-04-14 03:08:10 +01:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
2017-07-23 02:29:21 +01:00
|
|
|
|
2020-04-28 02:50:57 +01:00
|
|
|
outputs = [ "out" "man" ];
|
2019-02-23 00:35:27 +00:00
|
|
|
|
2021-04-07 09:41:35 +01:00
|
|
|
buildInputs = lib.optional enableCmount (if stdenv.isDarwin then macfuse-stubs else fuse);
|
|
|
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
2020-04-26 04:16:53 +01:00
|
|
|
|
2021-04-07 09:41:35 +01:00
|
|
|
buildFlagsArray = lib.optionals enableCmount [ "-tags=cmount" ]
|
|
|
|
++ [ "-ldflags=-s -w -X github.com/rclone/rclone/fs.Version=${version}" ];
|
2020-09-02 22:21:21 +01:00
|
|
|
|
2020-02-01 11:27:00 +00:00
|
|
|
postInstall =
|
|
|
|
let
|
|
|
|
rcloneBin =
|
|
|
|
if stdenv.buildPlatform == stdenv.hostPlatform
|
2020-04-28 02:50:57 +01:00
|
|
|
then "$out"
|
2021-01-15 13:21:58 +00:00
|
|
|
else lib.getBin buildPackages.rclone;
|
2020-02-01 11:27:00 +00:00
|
|
|
in
|
2020-09-02 22:21:21 +01:00
|
|
|
''
|
|
|
|
installManPage rclone.1
|
|
|
|
for shell in bash zsh fish; do
|
|
|
|
${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell
|
|
|
|
installShellCompletion rclone.$shell
|
|
|
|
done
|
2021-04-07 09:41:35 +01:00
|
|
|
'' + lib.optionalString (enableCmount && !stdenv.isDarwin) ''
|
|
|
|
wrapProgram $out/bin/rclone --prefix LD_LIBRARY_PATH : "${fuse}/lib"
|
2020-09-02 22:21:21 +01:00
|
|
|
'';
|
2017-07-23 02:29:21 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-06-30 05:47:43 +01:00
|
|
|
description = "Command line program to sync files and directories to and from major cloud storage";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://rclone.org";
|
2021-01-21 03:41:24 +00:00
|
|
|
changelog = "https://github.com/rclone/rclone/blob/v${version}/docs/content/changelog.md";
|
2017-01-02 22:43:07 +00:00
|
|
|
license = licenses.mit;
|
2021-03-09 10:41:52 +00:00
|
|
|
maintainers = with maintainers; [ danielfullmer marsam SuperSandro2000 ];
|
2016-06-30 05:47:43 +01:00
|
|
|
};
|
|
|
|
}
|