biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / misc / page / default.nix
blob889baff28b2599fb672ef29e3801350eb564a9b2
1 { lib, rustPlatform, fetchFromGitHub, fetchpatch, installShellFiles }:
3 rustPlatform.buildRustPackage rec {
4   pname = "page";
5   version = "4.6.3";
7   src = fetchFromGitHub {
8     owner = "I60R";
9     repo = pname;
10     rev = "v${version}";
11     hash = "sha256-uNdtgx9/9+KOfQvHiKNrT8NFWtR2tfJuI2bMwywBC/4=";
12   };
14   cargoHash = "sha256-ctYQMBAdSUfEek2vcCa3gnI9N6ZG9b+VvtAzT20jlXY=";
16   cargoPatches = [
17     # Cargo.lock is outdated.
18     # https://github.com/I60R/page/pull/45.
19     (fetchpatch {
20       url = "https://github.com/I60R/page/commit/83f936b64620ba74043c1db31207b4366c0f7e3d.patch";
21       hash = "sha256-qA5oP4K/6eG0A+syVNb1izl+bnYll5V6sWM3LVFTb4o=";
22     })
23   ];
25   nativeBuildInputs = [ installShellFiles ];
26   postInstall = ''
27     completions_dir=$(find "target" -name "assets" -type d -printf "%T+\t%p\n" | sort | awk 'NR==1{print $2}')
28     installShellCompletion --bash $completions_dir/page.bash
29     installShellCompletion --fish $completions_dir/page.fish
30     installShellCompletion --zsh $completions_dir/_page
31   '';
33   meta = with lib; {
34     description = "Use neovim as pager";
35     homepage = "https://github.com/I60R/page";
36     license = licenses.mit;
37     mainProgram = "page";
38     maintainers = [ maintainers.s1341 ];
39   };