lol

tree-sitter: allow use of 'generate' argument

+6 -5
+3 -2
pkgs/development/tools/parsing/tree-sitter/default.nix
··· 41 41 fetchSubmodules = true; 42 42 }; 43 43 44 - update-all-grammars = callPackage ./update.nix {}; 44 + update-all-grammars = callPackage ./update.nix { }; 45 45 46 46 fetchGrammar = (v: fetchgit { inherit (v) url rev sha256 fetchSubmodules; }); 47 47 ··· 62 62 inherit version; 63 63 src = grammar.src or (fetchGrammar grammar); 64 64 location = grammar.location or null; 65 + generate = grammar.generate or false; 65 66 }; 66 67 grammars' = import ./grammars { inherit lib; } // extraGrammars; 67 68 grammars = grammars' // ··· 111 112 inherit src version cargoSha256; 112 113 113 114 buildInputs = 114 - lib.optionals stdenv.isDarwin [ Security CoreServices]; 115 + lib.optionals stdenv.isDarwin [ Security CoreServices ]; 115 116 nativeBuildInputs = 116 117 [ which ] 117 118 ++ lib.optionals webUISupport [ emscripten ];
+3 -3
pkgs/development/tools/parsing/tree-sitter/grammar.nix
··· 28 28 29 29 stripDebugList = [ "parser" ]; 30 30 31 - configurePhase = lib.optionalString generate '' 32 - tree-sitter generate 33 - '' + lib.optionalString (location != null) '' 31 + configurePhase = lib.optionalString (location != null) '' 34 32 cd ${location} 33 + '' + lib.optionalString generate '' 34 + tree-sitter generate 35 35 ''; 36 36 37 37 # When both scanner.{c,cc} exist, we should not link both since they may be the same but in