2020-02-01 12:27:00 +01:00
|
|
|
{ stdenv, buildGoPackage, fetchFromGitHub, buildPackages }:
|
2016-06-30 06:47:43 +02:00
|
|
|
|
2019-09-21 11:23:00 +02:00
|
|
|
buildGoPackage rec {
|
2019-02-23 01:35:27 +01:00
|
|
|
pname = "rclone";
|
2020-02-28 06:25:50 +01:00
|
|
|
version = "1.51.0";
|
2016-06-30 06:47:43 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2019-08-27 13:35:54 +02:00
|
|
|
owner = pname;
|
2019-04-14 04:08:10 +02:00
|
|
|
repo = pname;
|
2016-06-30 06:47:43 +02:00
|
|
|
rev = "v${version}";
|
2020-02-28 06:25:50 +01:00
|
|
|
sha256 = "0z4kaq6wnj5dgl52g7f86phxlvnk5pbpda7prgh3hahpyhxj0z7d";
|
2016-06-30 06:47:43 +02:00
|
|
|
};
|
|
|
|
|
2019-09-21 11:23:00 +02:00
|
|
|
goPackagePath = "github.com/rclone/rclone";
|
2019-04-14 04:08:10 +02:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
2017-07-23 03:29:21 +02:00
|
|
|
|
2019-09-21 11:23:00 +02:00
|
|
|
outputs = [ "bin" "out" "man" ];
|
2019-02-23 01:35:27 +01:00
|
|
|
|
2020-02-01 12:27:00 +01:00
|
|
|
postInstall =
|
|
|
|
let
|
|
|
|
rcloneBin =
|
|
|
|
if stdenv.buildPlatform == stdenv.hostPlatform
|
|
|
|
then "$bin"
|
|
|
|
else stdenv.lib.getBin buildPackages.rclone;
|
|
|
|
in
|
|
|
|
''
|
|
|
|
install -D -m644 $src/rclone.1 $man/share/man/man1/rclone.1
|
|
|
|
mkdir -p $bin/share/zsh/site-functions $bin/share/bash-completion/completions/
|
|
|
|
${rcloneBin}/bin/rclone genautocomplete zsh $bin/share/zsh/site-functions/_rclone
|
|
|
|
${rcloneBin}/bin/rclone genautocomplete bash $bin/share/bash-completion/completions/rclone.bash
|
|
|
|
'';
|
2017-07-23 03:29:21 +02:00
|
|
|
|
2017-01-02 23:43:07 +01:00
|
|
|
meta = with stdenv.lib; {
|
2016-06-30 06:47:43 +02:00
|
|
|
description = "Command line program to sync files and directories to and from major cloud storage";
|
2018-06-27 22:12:57 +02:00
|
|
|
homepage = https://rclone.org;
|
2017-01-02 23:43:07 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ danielfullmer ];
|
|
|
|
platforms = platforms.all;
|
2016-06-30 06:47:43 +02:00
|
|
|
};
|
|
|
|
}
|