mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
46 lines
1.2 KiB
Nix
46 lines
1.2 KiB
Nix
{ lib, stdenv, buildGoModule, fetchFromGitHub, buildPackages, installShellFiles }:
|
|
|
|
buildGoModule rec {
|
|
pname = "rclone";
|
|
version = "1.53.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = pname;
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "10nimrq8nmpmfk2d4fx0yp916wk5q027m283izpshrbwvx7l6xx0";
|
|
};
|
|
|
|
vendorSha256 = "1l4iz31k1pylvf0zrp4nhxna70s1ma4981x6q1s3dhszjxil5c88";
|
|
|
|
subPackages = [ "." ];
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
buildFlagsArray = [ "-ldflags=-s -w -X github.com/rclone/rclone/fs.Version=${version}" ];
|
|
|
|
postInstall =
|
|
let
|
|
rcloneBin =
|
|
if stdenv.buildPlatform == stdenv.hostPlatform
|
|
then "$out"
|
|
else stdenv.lib.getBin buildPackages.rclone;
|
|
in
|
|
''
|
|
installManPage rclone.1
|
|
for shell in bash zsh fish; do
|
|
${rcloneBin}/bin/rclone genautocomplete $shell rclone.$shell
|
|
installShellCompletion rclone.$shell
|
|
done
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Command line program to sync files and directories to and from major cloud storage";
|
|
homepage = "https://rclone.org";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ danielfullmer marsam ];
|
|
};
|
|
}
|