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

45 lines
1.1 KiB
Nix
Raw Normal View History

2020-04-25 20:16:53 -07:00
{ stdenv, buildGoPackage, fetchFromGitHub, buildPackages, installShellFiles }:
2019-09-21 02:23:00 -07:00
buildGoPackage rec {
2019-02-22 16:35:27 -08:00
pname = "rclone";
2020-08-07 21:20:00 -07:00
version = "1.52.3";
src = fetchFromGitHub {
2019-08-27 04:35:54 -07:00
owner = pname;
repo = pname;
rev = "v${version}";
2020-08-07 21:20:00 -07:00
sha256 = "1bf3rhs4dcb8vkzs4a6pk5xrhnkhqsrbf4xrhcqf407r668gdav1";
};
2019-09-21 02:23:00 -07:00
goPackagePath = "github.com/rclone/rclone";
subPackages = [ "." ];
2017-07-22 18:29:21 -07:00
outputs = [ "out" "man" ];
2019-02-22 16:35:27 -08:00
2020-04-25 20:16:53 -07:00
nativeBuildInputs = [ installShellFiles ];
2020-02-01 03:27:00 -08:00
postInstall =
let
rcloneBin =
if stdenv.buildPlatform == stdenv.hostPlatform
then "$out"
2020-02-01 03:27:00 -08:00
else stdenv.lib.getBin buildPackages.rclone;
in
''
2020-04-25 20:16:53 -07:00
installManPage $src/rclone.1
2020-05-27 18:20:20 -07:00
for shell in bash zsh fish; do
2020-04-25 20:16:53 -07:00
${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell
installShellCompletion rclone.$shell
done
2020-02-01 03:27:00 -08:00
'';
2017-07-22 18:29:21 -07:00
2017-01-02 14:43:07 -08: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 14:43:07 -08:00
license = licenses.mit;
maintainers = with maintainers; [ danielfullmer ];
platforms = platforms.all;
};
}