depot/third_party/nixpkgs/pkgs/tools/misc/topgrade/default.nix
Default email 4bac34ead1 Project import generated by Copybara.
GitOrigin-RevId: 724bfc0892363087709bd3a5a1666296759154b1
2023-02-09 12:40:11 +01:00

56 lines
1.3 KiB
Nix

{ stdenv
, lib
, fetchFromGitHub
, rustPlatform
, AppKit
, Cocoa
, Foundation
, installShellFiles
}:
rustPlatform.buildRustPackage rec {
pname = "topgrade";
version = "10.3.1";
src = fetchFromGitHub {
owner = "topgrade-rs";
repo = "topgrade";
rev = "v${version}";
hash = "sha256-sOXp/oo29oVdmn3qEb7HCSlYYOvbTpD21dX4JSYaqps=";
};
cargoHash = "sha256-fZjMTVn4gx1hvtiD5NRkXY2f9HNSv7Vx3HdHypne5U0=";
nativeBuildInputs = [
installShellFiles
];
buildInputs = lib.optionals stdenv.isDarwin [
AppKit
Cocoa
Foundation
];
NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [
"-framework"
"AppKit"
];
postInstall = ''
installShellCompletion --cmd topgrade \
--bash <($out/bin/topgrade --gen-completion bash) \
--fish <($out/bin/topgrade --gen-completion fish) \
--zsh <($out/bin/topgrade --gen-completion zsh)
$out/bin/topgrade --gen-manpage > topgrade.8
installManPage topgrade.8
'';
meta = with lib; {
description = "Upgrade all the things";
homepage = "https://github.com/topgrade-rs/topgrade";
changelog = "https://github.com/topgrade-rs/topgrade/releases/tag/v${version}";
license = licenses.gpl3Only;
maintainers = with maintainers; [ SuperSandro2000 xyenon ];
};
}