nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 fetchpatch,
6 pkg-config,
7 libgit2,
8 zlib,
9 vimUtils,
10 nix-update-script,
11}:
12
13let
14 version = "0.54";
15
16 src = fetchFromGitHub {
17 owner = "liuchengxu";
18 repo = "vim-clap";
19 tag = "v${version}";
20 hash = "sha256-rhCum59GCIAwdi5QgSaPfrALelAIMncNetu81i53Q8c=";
21 };
22
23 meta = with lib; {
24 description = "Modern performant fuzzy picker for Vim and NeoVim";
25 mainProgram = "maple";
26 homepage = "https://github.com/liuchengxu/vim-clap";
27 changelog = "https://github.com/liuchengxu/vim-clap/blob/${src.rev}/CHANGELOG.md";
28 license = licenses.mit;
29 maintainers = [ ];
30 };
31
32 maple = rustPlatform.buildRustPackage {
33 pname = "maple";
34 inherit version src meta;
35
36 cargoHash = "sha256-FEeSwa8KmIyfhWAU9Dpric6uB2e0yK+Tig/k2zwq2Rg=";
37
38 nativeBuildInputs = [
39 pkg-config
40 ];
41
42 # Remove after next release
43 cargoPatches = [
44 (fetchpatch {
45 name = "rust-1.80";
46 url = "https://github.com/liuchengxu/vim-clap/commit/3e8d001f5c9be10e4bb680a1d409326902c96c10.patch";
47 hash = "sha256-qMflfQEssH4OGXmLFUcQwzbYWgPD0S/pClb35ZRUaPM=";
48 })
49 ];
50
51 buildInputs = [
52 libgit2
53 zlib
54 ];
55 };
56in
57
58vimUtils.buildVimPlugin {
59 pname = "vim-clap";
60 inherit version src meta;
61
62 postInstall = ''
63 ln -s ${maple}/bin/maple $out/bin/maple
64 '';
65
66 passthru = {
67 inherit maple;
68 updateScript = nix-update-script {
69 attrPath = "vimPlugins.vim-clap.maple";
70 };
71 };
72}