2022-04-27 09:35:20 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2022-10-21 18:38:19 +00:00
|
|
|
, AppKit
|
2022-04-27 09:35:20 +00:00
|
|
|
, Cocoa
|
|
|
|
, Foundation
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "topgrade";
|
2024-07-01 15:47:52 +00:00
|
|
|
version = "15.0.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-10-21 18:38:19 +00:00
|
|
|
owner = "topgrade-rs";
|
|
|
|
repo = "topgrade";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "v${version}";
|
2024-07-01 15:47:52 +00:00
|
|
|
hash = "sha256-w3JsMUuARJ5UtA8Io3kzeNjXoa014YzyT8hHPwEgljQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-07-01 15:47:52 +00:00
|
|
|
cargoHash = "sha256-DEZlpt9mOy/BOnvkkINz2+q3hUx2aBSzBfOVxv43w6g=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
2020-11-03 02:18:15 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
|
2022-12-28 21:21:41 +00:00
|
|
|
AppKit
|
|
|
|
Cocoa
|
|
|
|
Foundation
|
|
|
|
];
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.hostPlatform.isDarwin [
|
2022-12-28 21:21:41 +00:00
|
|
|
"-framework"
|
|
|
|
"AppKit"
|
2023-03-04 12:14:45 +00:00
|
|
|
]);
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
2022-12-02 08:20:57 +00:00
|
|
|
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
|
2020-11-03 02:18:15 +00:00
|
|
|
installManPage topgrade.8
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Upgrade all the things";
|
2022-10-21 18:38:19 +00:00
|
|
|
homepage = "https://github.com/topgrade-rs/topgrade";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/topgrade-rs/topgrade/releases/tag/v${version}";
|
2021-02-13 14:23:35 +00:00
|
|
|
license = licenses.gpl3Only;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with maintainers; [ SuperSandro2000 xyenon ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "topgrade";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|