APKBUILD examples:Neovim

From Alpine Linux
Revision as of 20:15, 16 September 2024 by Zcrayfish (talk | contribs) (→‎[Draft] Neovim plugin packaging policy: Use issue template.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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