nixpkgs-suyu/pkgs/applications/networking/sync/rclone/default.nix

46 lines
1.2 KiB
Nix
Raw Normal View History

2020-09-02 23:21:21 +02:00
{ stdenv, buildGoModule, fetchFromGitHub, buildPackages, installShellFiles }:
2020-09-02 23:21:21 +02:00
buildGoModule rec {
2019-02-23 01:35:27 +01:00
pname = "rclone";
version = "1.53.3";
src = fetchFromGitHub {
2019-08-27 13:35:54 +02:00
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "10nimrq8nmpmfk2d4fx0yp916wk5q027m283izpshrbwvx7l6xx0";
};
2020-09-02 23:21:21 +02:00
vendorSha256 = "1l4iz31k1pylvf0zrp4nhxna70s1ma4981x6q1s3dhszjxil5c88";
subPackages = [ "." ];
2017-07-23 03:29:21 +02:00
outputs = [ "out" "man" ];
2019-02-23 01:35:27 +01:00
2020-04-26 05:16:53 +02:00
nativeBuildInputs = [ installShellFiles ];
2020-09-02 23:21:21 +02:00
buildFlagsArray = [ "-ldflags=-s -w -X github.com/rclone/rclone/fs.Version=${version}" ];
2020-02-01 12:27:00 +01:00
postInstall =
let
rcloneBin =
if stdenv.buildPlatform == stdenv.hostPlatform
then "$out"
2020-02-01 12:27:00 +01:00
else stdenv.lib.getBin buildPackages.rclone;
in
2020-09-02 23:21:21 +02: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 03:29:21 +02:00
2017-01-02 23:43:07 +01:00
meta = with stdenv.lib; {
description = "Command line program to sync files and directories to and from major cloud storage";
homepage = "https://rclone.org";
2017-01-02 23:43:07 +01:00
license = licenses.mit;
2020-08-08 06:20:00 +02:00
maintainers = with maintainers; [ danielfullmer marsam ];
};
}