3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/sync/rclone/default.nix

47 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, stdenv, buildGoModule, fetchFromGitHub, buildPackages, installShellFiles }:
2020-09-02 22:21:21 +01:00
buildGoModule rec {
2019-02-23 00:35:27 +00:00
pname = "rclone";
2021-02-03 22:02:06 +00:00
version = "1.54.0";
src = fetchFromGitHub {
2019-08-27 12:35:54 +01:00
owner = pname;
repo = pname;
rev = "v${version}";
2021-02-03 22:02:06 +00:00
sha256 = "sha256-A0c5bHP5W/NTwAh1ifGaw4AG37qYXK9P/Fjk68gkUNk=";
};
2021-02-03 22:02:06 +00:00
vendorSha256 = "sha256-Cpn/dUD9E2BzUlAISC+IDCW59OkEKZTpqdlvF/clV+M=";
subPackages = [ "." ];
2017-07-23 02:29:21 +01:00
outputs = [ "out" "man" ];
2019-02-23 00:35:27 +00:00
2020-04-26 04:16:53 +01:00
nativeBuildInputs = [ installShellFiles ];
2020-09-02 22:21:21 +01:00
buildFlagsArray = [ "-ldflags=-s -w -X github.com/rclone/rclone/fs.Version=${version}" ];
2020-02-01 11:27:00 +00:00
postInstall =
let
rcloneBin =
if stdenv.buildPlatform == stdenv.hostPlatform
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
'';
2017-07-23 02:29:21 +01:00
meta = with lib; {
description = "Command line program to sync files and directories to and from major cloud storage";
homepage = "https://rclone.org";
changelog = "https://github.com/rclone/rclone/blob/v${version}/docs/content/changelog.md";
2017-01-02 22:43:07 +00:00
license = licenses.mit;
2020-08-08 05:20:00 +01:00
maintainers = with maintainers; [ danielfullmer marsam ];
};
}