APKBUILD examples:Neovim

From Alpine Linux

[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.