Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support installation of luarocks packages as vim plugins #131499

Merged
merged 1 commit into from
Aug 9, 2021

Conversation

teto
Copy link
Member

@teto teto commented Jul 25, 2021

Motivation for this change

neovim has a vibrant lua ecosystem and I would like to encourage vim plugin authors to rely on luaroicks rather than having every user specify the dependencies themselves. May lead nowhere.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Relase notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

rapidjson,,,,,
readline,,,,,
say,,,,,
std__debug,std._debug,,,,
std-_debug,std._debug,,,,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

normalization is not fully working.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean ? original package name is std._debug it gets renamed to std-_debug.

Comment on lines 93 to 94
# Normalize package name
nix_pkg_name_normalized=$(sed 's/\./-/' <(echo "$nix_pkg_name"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Normalize package name
nix_pkg_name_normalized=$(sed 's/\./-/' <(echo "$nix_pkg_name"))
# Normalize package name
nix_pkg_name_normalized=$(sed 's/\./-/' <(echo "$nix_pkg_name"))

Comment on lines 10 to 42
# this is an approximation
target="$out/$rtpPath/$pname"
mkdir -p $out/${rtpPath}
cp -r . $target

# build help tags
if [ -d "$target/doc" ]; then
echo "Building help tags"
if ! @vimBinary@ -N -u NONE -i NONE -n -E -s -V1 -c "helptags $target/doc" +quit!; then
echo "Failed to build help tags!"
exit 1
fi
else
echo "No docs available"
fi

if [ -n "$addonInfo" ]; then
echo "$addonInfo" > $target/addon-info.json
fi
runHook postInstall
echo "Finished executing vimPluginInstallPhase"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is formated inconsistend.

@teto
Copy link
Member Author

teto commented Aug 8, 2021

I am now able to install neovim lua packages registered on luarocks via this, for instance gitsigns.nvim. Should be mostly ready.

This commit shows how to convert luarocks packages into (neo)vim ones.
The advantage for neovim lua plugins to register their rockspec (aka
package definition) is that the plugin can express its dependencies and
a few metadata through it.
@teto teto changed the title Vim hooks support installation of luarocks packages as vim plugins Aug 9, 2021
@teto teto merged commit 0668479 into NixOS:master Aug 9, 2021
@teto teto deleted the vim-hooks branch August 9, 2021 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants