2020-04-26 04:16:53 +01:00
|
|
|
{ stdenv, buildGoPackage, fetchFromGitHub, buildPackages, installShellFiles }:
|
2016-06-30 05:47:43 +01:00
|
|
|
|
2019-09-21 10:23:00 +01:00
|
|
|
buildGoPackage rec {
|
2019-02-23 00:35:27 +00:00
|
|
|
pname = "rclone";
|
2020-02-28 05:25:50 +00:00
|
|
|
version = "1.51.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}";
|
2020-02-28 05:25:50 +00:00
|
|
|
sha256 = "0z4kaq6wnj5dgl52g7f86phxlvnk5pbpda7prgh3hahpyhxj0z7d";
|
2016-06-30 05:47:43 +01:00
|
|
|
};
|
|
|
|
|
2019-09-21 10:23:00 +01:00
|
|
|
goPackagePath = "github.com/rclone/rclone";
|
2019-04-14 03:08:10 +01:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
2017-07-23 02:29:21 +01:00
|
|
|
|
2019-09-21 10:23:00 +01:00
|
|
|
outputs = [ "bin" "out" "man" ];
|
2019-02-23 00:35:27 +00:00
|
|
|
|
2020-04-26 04:16:53 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2020-02-01 11:27:00 +00:00
|
|
|
postInstall =
|
|
|
|
let
|
|
|
|
rcloneBin =
|
|
|
|
if stdenv.buildPlatform == stdenv.hostPlatform
|
|
|
|
then "$bin"
|
|
|
|
else stdenv.lib.getBin buildPackages.rclone;
|
|
|
|
in
|
|
|
|
''
|
2020-04-26 04:16:53 +01:00
|
|
|
installManPage $src/rclone.1
|
|
|
|
for shell in bash zsh; do
|
|
|
|
${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell
|
|
|
|
installShellCompletion rclone.$shell
|
|
|
|
done
|
2020-02-01 11:27:00 +00:00
|
|
|
'';
|
2017-07-23 02:29:21 +01:00
|
|
|
|
2017-01-02 22:43:07 +00:00
|
|
|
meta = with stdenv.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";
|
2017-01-02 22:43:07 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ danielfullmer ];
|
|
|
|
platforms = platforms.all;
|
2016-06-30 05:47:43 +01:00
|
|
|
};
|
|
|
|
}
|