Merge pull request #23968 from figsoda/bundle

build(nix): use the correct versions of the bundled treesitter parsers
This commit is contained in:
Matthieu Coudron 2023-06-11 15:38:30 +02:00 committed by GitHub
commit dcb341315a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 63 additions and 8 deletions

View File

@ -1,12 +1,15 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": { "locked": {
"lastModified": 1667395993, "lastModified": 1685518550,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -17,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1681465517, "lastModified": 1686226982,
"narHash": "sha256-EasJh15/jcJNAHtq2SGbiADRXteURAnQbj1NqBoKkzU=", "narHash": "sha256-nLuiPoeiVfqqzeq9rmXxpybh77VS37dsY/k8N2LoxVg=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "abe7316dd51a313ce528972b104f4f04f56eefc4", "rev": "a64b73e07d4aa65cfcbda29ecf78eaf9e72e44bd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,6 +39,21 @@
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -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 ++ [