APKBUILD examples:Neovim: Difference between revisions

From Alpine Linux
(Neovim plugin packaging policy)
 
 
Line 1: Line 1:
== [Draft] Neovim plugin packaging policy ==
== [Draft] Neovim plugin packaging policy ==


See [https://gitlab.alpinelinux.org/alpine/aports/-/issues/16021 #16021].
See {{issue|16021}}.


=== Name ===
=== Name ===

Latest revision as of 20:15, 16 September 2024

[Draft] Neovim plugin packaging policy

See #16021.

Name

  • Must be prefixed with nvim-
  • Only have a single nvim- prefix:
    • Use nvim-treesitter, instead of nvim-nvim-treesitter
  • Omit .nvim suffix:
    • Use nvim-telescope, instead of nvim-telescope.nvim

Version

If there are no tags, upstream should be requested to release.

Site

Plugins must be installed in "$pkgdir"/usr/share/nvim/site/pack/dist/opt/$pkgname/. This allows users to lazy load apk managed neovim packages using: :packadd $pkgname, or vim.cmd.packadd('$pkgname').

Doc

If upstream doesn't contain generated helptags, do so in build:

build() {
    nvim -u NONE -i NONE -e --headless -c "helptags doc" -c quit
}

amove neovim help files and tags in doc:

doc() {
    default_doc
    amove usr/share/nvim/site/pack/dist/opt/$pkgname/doc
}

Tests

Skipping check is fine if testing a plugin requires vusted (which is not yet packaged):

options="!check"  # requires vusted

Example

See community/nvim-lspconfig for a complete example.