forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / applications / version-management / git-cliff / default.nix
blob0a9121f623eeec13d8b525668e681af69066ead6
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , rustPlatform
5 , installShellFiles
6 }:
8 rustPlatform.buildRustPackage rec {
9   pname = "git-cliff";
10   version = "2.6.1";
12   src = fetchFromGitHub {
13     owner = "orhun";
14     repo = "git-cliff";
15     rev = "v${version}";
16     hash = "sha256-le/E+26N/SEam9Rvo2xzB2cFly65FO0RA+Xvh9NOSfE=";
17   };
19   cargoHash = "sha256-QC/7MctcfGWQpSSz/mS6czHh37llJl7aWJgyaa/WvB0=";
21   # attempts to run the program on .git in src which is not deterministic
22   doCheck = false;
24   nativeBuildInputs = [ installShellFiles ];
26   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
27     export OUT_DIR=$(mktemp -d)
29     # Generate shell completions
30     $out/bin/git-cliff-completions
31     installShellCompletion \
32       --bash $OUT_DIR/git-cliff.bash \
33       --fish $OUT_DIR/git-cliff.fish \
34       --zsh $OUT_DIR/_git-cliff
36     # Generate man page
37     $out/bin/git-cliff-mangen
38     installManPage $OUT_DIR/git-cliff.1
39   '';
41   meta = with lib; {
42     description = "Highly customizable Changelog Generator that follows Conventional Commit specifications";
43     homepage = "https://github.com/orhun/git-cliff";
44     changelog = "https://github.com/orhun/git-cliff/blob/v${version}/CHANGELOG.md";
45     license = licenses.gpl3Only;
46     maintainers = with maintainers; [ siraben ];
47     mainProgram = "git-cliff";
48   };