2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPackages,
|
|
|
|
fetchFromGitHub,
|
|
|
|
rustPlatform,
|
|
|
|
installShellFiles,
|
|
|
|
libiconv,
|
|
|
|
darwin,
|
|
|
|
nix-update-script,
|
|
|
|
pkg-config,
|
|
|
|
openssl,
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
canRunGitGr = stdenv.hostPlatform.emulatorAvailable buildPackages;
|
|
|
|
gitGr = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/git-gr";
|
|
|
|
pname = "git-gr";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "1.4.3";
|
2024-04-21 15:54:59 +00:00
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "9999years";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-t308Ep27iRvRHSdvVMOrRGVoajBtnTutHAkKbZkO7Wg=";
|
2024-04-21 15:54:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildFeatures = [ "clap_mangen" ];
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
cargoHash = "sha256-oukVU3YZMI2Z6HqIrEe2npmCj9PtwQUT6VOPkklM0Ig=";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
OPENSSL_NO_VENDOR = true;
|
|
|
|
|
|
|
|
nativeBuildInputs =
|
|
|
|
[installShellFiles]
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optional stdenv.hostPlatform.isLinux pkg-config;
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
buildInputs =
|
2024-09-26 11:04:55 +00:00
|
|
|
lib.optional stdenv.hostPlatform.isLinux openssl
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-04-21 15:54:59 +00:00
|
|
|
libiconv
|
|
|
|
darwin.apple_sdk.frameworks.CoreServices
|
|
|
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = lib.optionalString canRunGitGr ''
|
|
|
|
manpages=$(mktemp -d)
|
|
|
|
${gitGr} manpages "$manpages"
|
|
|
|
for manpage in "$manpages"/*; do
|
|
|
|
installManPage "$manpage"
|
|
|
|
done
|
|
|
|
|
|
|
|
installShellCompletion --cmd git-gr \
|
|
|
|
--bash <(${gitGr} completions bash) \
|
|
|
|
--fish <(${gitGr} completions fish) \
|
|
|
|
--zsh <(${gitGr} completions zsh)
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/9999years/git-gr";
|
2024-07-27 06:49:29 +00:00
|
|
|
changelog = "https://github.com/9999years/git-gr/releases/tag/v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Gerrit CLI client";
|
2024-04-21 15:54:59 +00:00
|
|
|
license = [ licenses.mit ];
|
|
|
|
maintainers = [ maintainers._9999years ];
|
|
|
|
mainProgram = "git-gr";
|
|
|
|
};
|
|
|
|
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
}
|