Unverified Commit 9f82eccc authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

vimPluginsUpdater: generate plugin licenses (#513747)

parents 28efb7d9 72a716a7
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -115,6 +115,25 @@ patch those plugins but expose the necessary configuration under
`PLUGIN.passthru.initLua` for neovim plugins. For instance, the `unicode-vim` plugin
needs the path towards a unicode database so we expose the following snippet `vim.g.Unicode_data_directory="${self.unicode-vim}/autoload/unicode"` under `vimPlugins.unicode-vim.passthru.initLua`.

### Plugin license overrides {#neovim-plugin-license-overrides}

Generated Vim and Neovim plugins get their `meta.license` from GitHub license metadata when possible.
Some upstream repositories do not expose a license file that GitHub can detect, or only mention the license in a README.
In those cases, add a manual `meta.license` override in [overrides.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/editors/vim/plugins/overrides.nix).

For example, if upstream documents that a plugin uses the Vim license but GitHub does not detect it:

```nix
{
  foo-nvim = super.foo-nvim.overrideAttrs (old: {
    meta = old.meta // {
      # README says this plugin is distributed under the Vim license.
      license = lib.licenses.vim;
    };
  });
}
```

## LuaRocks based plugins {#neovim-luarocks-based-plugins}

In order to automatically handle plugin dependencies, several Neovim plugins
+3 −0
Original line number Diff line number Diff line
@@ -4483,6 +4483,9 @@
    "index.html#neovim-plugin-required-snippet",
    "index.html#vim-plugin-required-snippet"
  ],
  "neovim-plugin-license-overrides": [
    "index.html#neovim-plugin-license-overrides"
  ],
  "updating-plugins-in-nixpkgs": [
    "index.html#updating-plugins-in-nixpkgs"
  ],
+1979 −132

File changed.

Preview size limit exceeded, changes collapsed.

+1333 −80

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ let
  parse = _name: value: {
    inherit (value) pname version;
    homePage = value.meta.homepage;
    license = value.meta.license.spdxId or null;
    checksum =
      if hasChecksum value then
        {
Loading