mirror of
https://github.com/neovim/neovim.git
synced 2024-12-19 10:45:16 -07:00
build(nix): use the correct versions of the bundled treesitter parsers
This commit is contained in:
parent
9eef2b111d
commit
8df3381202
@ -7,13 +7,50 @@
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
let
|
||||
inherit (builtins)
|
||||
elemAt
|
||||
foldl'
|
||||
mapAttrs
|
||||
match
|
||||
readFile
|
||||
;
|
||||
inherit (nixpkgs.lib)
|
||||
const
|
||||
flip
|
||||
pipe
|
||||
remove
|
||||
splitString
|
||||
toLower
|
||||
;
|
||||
in
|
||||
{
|
||||
overlay = final: prev: {
|
||||
|
||||
neovim = final.neovim-unwrapped.overrideAttrs (oa: rec {
|
||||
neovim = (final.neovim-unwrapped.override {
|
||||
treesitter-parsers = pipe ../cmake.deps/deps.txt [
|
||||
readFile
|
||||
(splitString "\n")
|
||||
(map (match "TREESITTER_([A-Z_]+)_(URL|SHA256)[[:space:]]+([^[:space:]]+)[[:space:]]*"))
|
||||
(remove null)
|
||||
(flip foldl' { }
|
||||
(acc: matches:
|
||||
let
|
||||
lang = toLower (elemAt matches 0);
|
||||
type = toLower (elemAt matches 1);
|
||||
value = elemAt matches 2;
|
||||
in
|
||||
acc // {
|
||||
${lang} = acc.${lang} or { } // {
|
||||
${type} = value;
|
||||
};
|
||||
}))
|
||||
(mapAttrs (const final.fetchurl))
|
||||
];
|
||||
}).overrideAttrs (oa: rec {
|
||||
version = self.shortRev or "dirty";
|
||||
src = ../.;
|
||||
preConfigure = ''
|
||||
preConfigure = oa.preConfigure or "" + ''
|
||||
sed -i cmake.config/versiondef.h.in -e 's/@NVIM_VERSION_PRERELEASE@/-dev-${version}/'
|
||||
'';
|
||||
nativeBuildInputs = oa.nativeBuildInputs ++ [
|
||||
|
Loading…
Reference in New Issue
Block a user