mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
build(nix): use the correct versions of the bundled treesitter parsers
This commit is contained in:
@@ -7,13 +7,50 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils }:
|
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: {
|
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";
|
version = self.shortRev or "dirty";
|
||||||
src = ../.;
|
src = ../.;
|
||||||
preConfigure = ''
|
preConfigure = oa.preConfigure or "" + ''
|
||||||
sed -i cmake.config/versiondef.h.in -e 's/@NVIM_VERSION_PRERELEASE@/-dev-${version}/'
|
sed -i cmake.config/versiondef.h.in -e 's/@NVIM_VERSION_PRERELEASE@/-dev-${version}/'
|
||||||
'';
|
'';
|
||||||
nativeBuildInputs = oa.nativeBuildInputs ++ [
|
nativeBuildInputs = oa.nativeBuildInputs ++ [
|
||||||
|
Reference in New Issue
Block a user