koji: 2.2.0 -> 3.2.0 (#395704)

This commit is contained in:
Pol Dellaiera
2025-04-04 23:20:19 +02:00
committed by GitHub
+42 -13
View File
@@ -1,45 +1,74 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
pkg-config,
perl,
udev,
openssl,
gitMinimal,
writableTmpDirAsHomeHook,
installShellFiles,
versionCheckHook,
}:
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "koji";
version = "2.2.0";
version = "3.2.0";
src = fetchFromGitHub {
owner = "its-danny";
owner = "cococonscious";
repo = "koji";
rev = version;
hash = "sha256-2kBjHX7izo4loJ8oyPjE9FtCvUODC3Sm4T8ETIdeGZM=";
tag = "v${finalAttrs.version}";
hash = "sha256-+xtq4btFbOfiyFMDHXo6riSBMhAwTLQFuE91MUHtg5Q=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-ZHti7nMfHiYur1kjxj+ySIF4/l0UU9q2urabUWZyk6E=";
cargoHash = "sha256-WiFXDXLJc2ictv29UoRFRpIpAqeJlEBEOvThXhLXLJA=";
OPENSSL_NO_VENDOR = 1;
nativeBuildInputs = [
pkg-config
perl
udev
installShellFiles
];
buildInputs = [
openssl.dev
openssl
] ++ lib.optionals stdenv.hostPlatform.isLinux [ udev ];
nativeCheckInputs = [
gitMinimal
writableTmpDirAsHomeHook
];
meta = with lib; {
preCheck = ''
git config --global user.name 'nix-user'
git config --global user.email 'nix-user@example.com'
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd koji \
--bash <($out/bin/koji completions bash) \
--fish <($out/bin/koji completions fish) \
--zsh <($out/bin/koji completions zsh)
'';
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}";
meta = {
description = "Interactive CLI for creating conventional commits";
homepage = "https://github.com/its-danny/koji";
license = with licenses; [ mit ];
maintainers = with maintainers; [ ByteSudoer ];
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
ByteSudoer
WeetHet
];
mainProgram = "koji";
platforms = platforms.unix;
platforms = lib.platforms.unix;
};
}
})